LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 const & key () const
 
std::string const & name () const
 
std::string const & 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 preset_value (fhicl::ParameterSet const &ps)
 
void set_par_style (par_style const vt)
 

Private Member Functions

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

Private Attributes

fhicl::ParameterSet pset_ {}
 

Detailed Description

Definition at line 15 of file DelegatedParameter.h.

Constructor & Destructor Documentation

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

Definition at line 7 of file DelegatedParameter.cc.

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

8  : DelegatedParameter{std::move(name), Comment("")}
9  {}
std::string const & name() const
fhicl::DelegatedParameter::DelegatedParameter ( Name &&  name,
Comment &&  comment 
)
explicit

Definition at line 11 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.

12  : DelegateBase{std::move(name),
13  std::move(comment),
16  , RegisterIfTableMember{this}
17  {
19  }
DelegateBase(Name const &name, Comment const &comment, par_style const vt, std::function< bool()> maybeUse)
Definition: DelegateBase.h:10
std::function< bool()> AlwaysUse()
std::string const & name() const
std::string const & comment() const
fhicl::DelegatedParameter::DelegatedParameter ( Name &&  name,
Comment &&  comment,
std::function< bool()>  maybeUse 
)
explicit

Definition at line 21 of file DelegatedParameter.cc.

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

24  : DelegateBase{std::move(name),
25  std::move(comment),
27  maybeUse}
28  , RegisterIfTableMember{this}
29  {
31  }
DelegateBase(Name const &name, Comment const &comment, par_style const vt, std::function< bool()> maybeUse)
Definition: DelegateBase.h:10
std::string const & name() const
std::string const & comment() const

Member Function Documentation

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

Implements fhicl::detail::ParameterBase.

Definition at line 36 of file DelegatedParameter.h.

References pset_.

37  {
38  pset_ = pset;
39  };
fhicl::ParameterSet pset_
template<typename T >
auto fhicl::DelegatedParameter::get ( ) const
inline

Definition at line 28 of file DelegatedParameter.h.

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

Referenced by calo::GnocchiCalorimetry::GnocchiCalorimetry().

29  {
30  auto const trimmed_key = detail::strip_first_containing_name(key());
31  return pset_.get<T>(trimmed_key);
32  }
std::string strip_first_containing_name(std::string const &key)
T get(std::string const &key) const
Definition: ParameterSet.h:314
std::string const & key() const
Definition: ParameterBase.cc:6
fhicl::ParameterSet pset_
bool fhicl::detail::ParameterBase::is_conditional ( ) const
inherited
std::string const & fhicl::detail::ParameterBase::key ( ) const
inherited

Definition at line 6 of file ParameterBase.cc.

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::OptionalTuple< ARGS... >::do_prepare_elements_for_validation(), fhicl::OptionalSequence< art::InputTag >::do_prepare_elements_for_validation(), fhicl::OptionalSequence< T,-1ull >::do_prepare_elements_for_validation(), fhicl::OptionalSequence< T, N >::do_preset_value(), fhicl::OptionalSequence< T,-1ull >::do_preset_value(), fhicl::Atom< T >::do_set_value(), fhicl::OptionalAtom< T >::do_set_value(), fhicl::detail::ValidateThenSet::enter_sequence(), fhicl::detail::PrintAllowedConfiguration::enter_sequence(), fhicl::detail::SearchAllowedConfiguration::form_absolute(), get(), fhicl::OptionalDelegatedParameter::get_if_present(), fhicl::OptionalDelegatedParameter::hasValue(), fhicl::detail::MaybeDisplayParent::is_sequence_element(), fhicl::detail::TableBase::maybe_select_pset(), fhicl::detail::PrintAllowedConfiguration::maybeReleaseTopLevelParameter(), fhicl::detail::RegisterIfTableMember::RegisterIfTableMember(), fhicl::detail::TableBase::select_pset(), and fhicl::detail::PrintAllowedConfiguration::suppressFormat().

7  {
8  return mdata_.key();
9  }
ParameterMetadata mdata_
Definition: ParameterBase.h:63
std::string const & key() const
bool fhicl::detail::ParameterBase::preset_value ( fhicl::ParameterSet const &  ps)
inherited

Definition at line 63 of file ParameterBase.cc.

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

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

64  {
65  return do_preset_value(ps);
66  }
virtual bool do_preset_value(fhicl::ParameterSet const &)
void fhicl::detail::ParameterBase::set_par_style ( par_style const  vt)
inherited
void fhicl::detail::ParameterBase::set_value ( fhicl::ParameterSet const &  ps)
inherited

Definition at line 58 of file ParameterBase.cc.

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

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

59  {
60  do_set_value(ps);
61  }
virtual void do_set_value(fhicl::ParameterSet const &)=0
bool fhicl::detail::ParameterBase::should_use ( ) const
inherited

Definition at line 41 of file ParameterBase.cc.

References fhicl::detail::ParameterBase::maybeUse_.

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

42  {
43  return maybeUse_();
44  }
std::function< bool()> maybeUse_
Definition: ParameterBase.h:64

Member Data Documentation

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

Definition at line 41 of file DelegatedParameter.h.

Referenced by do_set_value(), and get().


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