Conditional configuration objects should be able to report if they were enabled
fhicl::Sequence<std::string> namesin my configuration structure, which was conditionally enabled and with no default value.
namesis disabled, a call
names()returns a vector with a single empty string in it (of course, no value was provided from the configuration).
I am told this is the current expected behaviour, of initialising the container with a single, default-constructed element.
I would like to have:
- definition of what to expect from that value; "undefined" is also acceptable to me, although the expectation would have been an empty collection
- a way to determine if the atom, sequence or table was enabled; right now I can use
names.should_use()which seems to do the right thing, but it is undocumented and it's not clear whether it is considered part of the stable user interface
The quickest acceptable solution to me is to declare the content of the parameter undefined unless the parameter is enabled, and to have
should_use() blessed for common use. I would though recommend a more user-friendly name for it (maybe
enabled()... I am not good with names!).
#1 Updated by Kyle Knoepfel about 2 years ago
- Status changed from New to Accepted
We are happy to provide this functionality and to provide patterns for how to use conditional configuration parameters. We would like to poll the stakeholders as to which behaviors (and their associated trade-offs) are desired whenever the parameter has not been enabled.