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

#include "OptionalDelegatedParameter.h"

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

Public Member Functions

 OptionalDelegatedParameter (Name &&name)
 
 OptionalDelegatedParameter (Name &&name, Comment &&comment)
 
 OptionalDelegatedParameter (Name &&name, Comment &&comment, std::function< bool()> maybeUse)
 
bool hasValue () const
 
template<typename T >
bool get_if_present (T &t) 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 OptionalDelegatedParameter.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file OptionalDelegatedParameter.cc.

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

9  : OptionalDelegatedParameter{std::move(name), Comment("")}
10  {}
std::string name() const
Definition: ParameterBase.h:49
fhicl::OptionalDelegatedParameter::OptionalDelegatedParameter ( Name &&  name,
Comment &&  comment 
)
explicit
fhicl::OptionalDelegatedParameter::OptionalDelegatedParameter ( Name &&  name,
Comment &&  comment,
std::function< bool()>  maybeUse 
)
explicit

Member Function Documentation

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

Implements fhicl::detail::ParameterBase.

Definition at line 44 of file OptionalDelegatedParameter.h.

References pset_.

46  {
47  pset_ = pset;
48  };
template<typename T >
bool fhicl::OptionalDelegatedParameter::get_if_present ( T &  t) const
inline

Definition at line 35 of file OptionalDelegatedParameter.h.

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

Referenced by art::EmptyEvent::makePlugin_().

36  {
37  std::string const& trimmed_key =
39  return pset_.get_if_present<T>(trimmed_key, t);
40  }
std::string strip_first_containing_name(std::string const &key)
bool get_if_present(std::string const &key, T &value) const
Definition: ParameterSet.h:208
std::string key() const
Definition: ParameterBase.h:44
bool fhicl::OptionalDelegatedParameter::hasValue ( ) const
inline

Definition at line 28 of file OptionalDelegatedParameter.h.

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

29  {
31  }
std::string strip_first_containing_name(std::string const &key)
bool has_key(std::string const &key) const
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(), fhicl::DelegatedParameter::get(), get_if_present(), 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::OptionalDelegatedParameter::pset_ {}
private

Definition at line 50 of file OptionalDelegatedParameter.h.

Referenced by do_set_value(), get_if_present(), and hasValue().


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