Project

General

Profile

Feature #17964

Conditional configuration objects should be able to report if they were enabled

Added by Gianluca Petrillo almost 2 years ago. Updated about 1 year ago.

Status:
Accepted
Priority:
Normal
Assignee:
-
Target version:
Start date:
10/19/2017
Due date:
% Done:

0%

Estimated time:
1.00 h
Duration:

Description

Using a fhicl::Sequence<std::string> names in my configuration structure, which was conditionally enabled and with no default value.
When names is 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:
  1. definition of what to expect from that value; "undefined" is also acceptable to me, although the expectation would have been an empty collection
  2. 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!).

History

#1 Updated by Kyle Knoepfel almost 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.

#2 Updated by Kyle Knoepfel over 1 year ago

  • Target version set to Vega

#3 Updated by Kyle Knoepfel over 1 year ago

  • Estimated time set to 1.00 h

#4 Updated by Kyle Knoepfel over 1 year ago

  • Project changed from fhicl to fhicl-cpp

#5 Updated by Kyle Knoepfel about 1 year ago

  • Subject changed from Optional configuration objects should be able to report if they were enabled to Conditional configuration objects should be able to report if they were enabled


Also available in: Atom PDF