LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
fhicl::DelegatedParameter Class Referencefinal

#include "DelegatedParameter.h"

Inheritance diagram for fhicl::DelegatedParameter:
fhicl::detail::DelegateBase fhicl::detail::RegisterIfTableMember fhicl::detail::ParameterBase

Public Member Functions

 DelegatedParameter (Name &&name)
 
 DelegatedParameter (Name &&name, Comment &&comment)
 
 DelegatedParameter (Name &&name, Comment &&comment, std::function< bool()> maybeUse)
 
template<typename T >
auto get () const
 
std::string key () const
 
std::string name () const
 
std::string comment () const
 
bool has_default () const
 
bool is_optional () const
 
bool is_conditional () const
 
par_type parameter_type () const
 
bool should_use () const
 
void set_value (fhicl::ParameterSet const &ps, bool trimParents)
 
void set_par_style (par_style const vt)
 
void set_key (std::string const &key)
 

Private Member Functions

void do_set_value (fhicl::ParameterSet const &pset, bool const ) override
 

Private Attributes

fhicl::ParameterSet pset_ {}
 

Detailed Description

Definition at line 17 of file DelegatedParameter.h.

Constructor & Destructor Documentation

fhicl::DelegatedParameter::DelegatedParameter ( Name &&  name)
explicit

Definition at line 8 of file DelegatedParameter.cc.

References fhicl::detail::ParameterBase::name().

9  : DelegatedParameter{std::move(name), Comment("")}
10  {}
std::string name() const
Definition: ParameterBase.h:49
fhicl::DelegatedParameter::DelegatedParameter ( Name &&  name,
Comment &&  comment 
)
explicit

Definition at line 12 of file DelegatedParameter.cc.

References fhicl::detail::AlwaysUse(), fhicl::detail::ParameterBase::comment(), fhicl::NameStackRegistry::end_of_ctor(), fhicl::detail::ParameterBase::name(), fhicl::detail::RegisterIfTableMember::RegisterIfTableMember(), and fhicl::REQUIRED.

13  : DelegateBase{std::move(name),
14  std::move(comment),
17  , RegisterIfTableMember{this}
18  {
20  }
DelegateBase(Name const &name, Comment const &comment, par_style const vt, std::function< bool()> maybeUse)
Definition: DelegateBase.h:16
std::function< bool()> AlwaysUse()
std::string name() const
Definition: ParameterBase.h:49
std::string comment() const
Definition: ParameterBase.h:54
fhicl::DelegatedParameter::DelegatedParameter ( Name &&  name,
Comment &&  comment,
std::function< bool()>  maybeUse 
)
explicit

Member Function Documentation

void fhicl::DelegatedParameter::do_set_value ( fhicl::ParameterSet const &  pset,
bool  const 
)
inlineoverrideprivatevirtual

Implements fhicl::detail::ParameterBase.

Definition at line 39 of file DelegatedParameter.h.

References pset_.

41  {
42  pset_ = pset;
43  };
fhicl::ParameterSet pset_
template<typename T >
auto fhicl::DelegatedParameter::get ( ) const
inline

Definition at line 30 of file DelegatedParameter.h.

References fhicl::ParameterSet::get(), fhicl::detail::ParameterBase::key(), pset_, and fhicl::detail::strip_first_containing_name().

31  {
32  std::string const& trimmed_key =
34  return pset_.get<T>(trimmed_key);
35  }
std::string strip_first_containing_name(std::string const &key)
T get(std::string const &key) const
Definition: ParameterSet.h:231
fhicl::ParameterSet pset_
std::string key() const
Definition: ParameterBase.h:44
bool fhicl::detail::ParameterBase::is_conditional ( ) const
inlineinherited
std::string fhicl::detail::ParameterBase::key ( ) const
inlineinherited

Definition at line 44 of file ParameterBase.h.

References fhicl::detail::ParameterMetadata::key(), and fhicl::detail::ParameterBase::mdata_.

Referenced by fhicl::detail::PrintAllowedConfiguration::after_action(), fhicl::detail::ValidateThenSet::before_action(), fhicl::detail::PrintAllowedConfiguration::before_action(), fhicl::detail::SearchAllowedConfiguration::before_action(), fhicl::detail::PrintAllowedConfiguration::cacheTopLevelParameter(), detinfo::LArPropertiesStandard::Configure(), fhicl::OptionalSequence< Table< T >< art::RootInputFileSequence::Config::SecondaryFile > >::do_prepare_elements_for_validation(), fhicl::OptionalTuple< ARGS... >::do_prepare_elements_for_validation(), fhicl::OptionalSequence< T,-1ull >::do_prepare_elements_for_validation(), fhicl::detail::ValidateThenSet::enter_sequence(), fhicl::detail::PrintAllowedConfiguration::enter_sequence(), evgen::MARLEYHelper::fhicl_parameter_to_json(), fhicl::detail::SearchAllowedConfiguration::form_absolute(), get(), fhicl::OptionalDelegatedParameter::get_if_present(), fhicl::OptionalDelegatedParameter::hasValue(), fhicl::detail::MaybeDisplayParent::is_sequence_element(), fhicl::detail::PrintAllowedConfiguration::maybeReleaseTopLevelParameter(), fhicl::detail::RegisterIfTableMember::RegisterIfTableMember(), and fhicl::detail::PrintAllowedConfiguration::suppressFormat().

45  {
46  return mdata_.key();
47  }
void fhicl::detail::ParameterBase::set_key ( std::string const &  key)
inlineinherited
void fhicl::detail::ParameterBase::set_par_style ( par_style const  vt)
inlineinherited
void fhicl::detail::ParameterBase::set_value ( fhicl::ParameterSet const &  ps,
bool  trimParents 
)
inlineinherited

Definition at line 96 of file ParameterBase.h.

References fhicl::detail::ParameterBase::do_set_value().

Referenced by fhicl::detail::ValidateThenSet::after_action().

97  {
98  do_set_value(ps, trimParents);
99  }
virtual void do_set_value(fhicl::ParameterSet const &, bool trimParents)=0
bool fhicl::detail::ParameterBase::should_use ( ) const
inlineinherited

Member Data Documentation

fhicl::ParameterSet fhicl::DelegatedParameter::pset_ {}
private

Definition at line 45 of file DelegatedParameter.h.

Referenced by do_set_value(), and get().


The documentation for this class was generated from the following files: