1 #ifndef fhiclcpp_types_OptionalTable_h 2 #define fhiclcpp_types_OptionalTable_h 24 class OptionalTable final :
public detail::TableBase,
25 private detail::RegisterIfTableMember {
41 std::set<std::string>
const& keysToIgnore);
47 return value_ ? std::make_optional(*
value_) : std::nullopt;
84 std::set<std::string>
const& keysToIgnore = {});
87 using members_t = std::vector<cet::exempt_ptr<ParameterBase>>;
89 std::shared_ptr<T>
value_{std::make_shared<T>()};
102 template <
typename T>
104 operator<<(std::ostream& os, OptionalTable<T>
const&
t)
106 std::ostringstream
config;
107 t.print_allowed_configuration(config);
108 return os << config.str();
121 template <
typename T>
126 template <
typename T>
137 template <
typename T>
150 template <
typename T>
152 std::set<std::string>
const& keysToIgnore)
163 template <
typename T>
166 std::set<std::string>
const& keysToIgnore)
174 template <
typename T>
184 template <
typename T>
std::string const & name() const
void validate(ParameterSet const &pset, std::set< std::string > const &keysToIgnore={})
void do_set_value(fhicl::ParameterSet const &pset) override
#define NO_DELEGATED_PARAMETERS
std::shared_ptr< T > value_
std::optional< T > operator()() const
ChannelGroupService::Name Name
static void end_of_ctor()
std::function< bool()> AlwaysUse()
#define NO_NESTED_FHICL_TYPES_IN_TABLE
std::string optional_parameter_message(bool const with_comment=true)
std::string strip_first_containing_name(std::string const &key)
members_t const & get_members() const override
RegisterIfTableMember(ParameterBase *pb)
std::vector< cet::exempt_ptr< ParameterBase > > const & members() const
#define NO_STD_CONTAINERS
std::vector< cet::exempt_ptr< ParameterBase >> members_t
void print_allowed_configuration(std::ostream &os, std::string const &tab=std::string(3, ' ')) const
#define NO_NESTED_TABLE_FRAGMENTS
std::string const & key() const
bool operator()(T &value) const
std::optional< T > get_if_present(std::string const &key) const
auto for_all(FwdCont &, Func)
std::string const & comment() const
TableBase(Name const &name, Comment const &comment, par_style const vt, std::function< bool()> maybeUse)
ParameterSet const & get_PSet() const
static std::vector< base_ptr > release_members()
void function(int client, int *resource, int parblock, int *test, int p)