Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
fhicl::OptionalTable< T > Class Template Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/fhiclcpp/v4_06_10/source/fhiclcpp/type_traits.h"

Inheritance diagram for fhicl::OptionalTable< T >:
fhicl::detail::TableBase fhicl::detail::RegisterIfTableMember fhicl::detail::ParameterBase

Public Types

using value_type = T
 

Public Member Functions

 OptionalTable (Name &&name)
 
 OptionalTable (Name &&name, Comment &&comment)
 
 OptionalTable (Name &&name, Comment &&comment, std::function< bool()> maybeUse)
 
 OptionalTable (ParameterSet const &pset, std::set< std::string > const &keysToIgnore)
 
bool operator() (T &value) const
 
bool hasValue () const
 
ParameterSet const & get_PSet () const
 
void validate_ParameterSet (ParameterSet const &pset, std::set< std::string > const &keysToIgnore={})
 
void print_allowed_configuration (std::ostream &os, std::string const &tab=std::string(3, ' ')) const
 
 OptionalTable ()
 
std::vector< cet::exempt_ptr< ParameterBase > > const & members () 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 Types

using members_t = std::vector< cet::exempt_ptr< ParameterBase >>
 

Private Member Functions

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

Private Attributes

std::shared_ptr< Tvalue_ {std::make_shared<T>()}
 
bool has_value_ {false}
 
ParameterSet pset_ {}
 
members_t members_
 

Detailed Description

template<typename T>
class fhicl::OptionalTable< T >

Definition at line 32 of file type_traits.h.

Member Typedef Documentation

template<typename T>
using fhicl::OptionalTable< T >::members_t = std::vector<cet::exempt_ptr<ParameterBase>>
private

Definition at line 81 of file OptionalTable.h.

template<typename T>
using fhicl::OptionalTable< T >::value_type = T

Definition at line 76 of file OptionalTable.h.

Constructor & Destructor Documentation

template<typename T>
fhicl::OptionalTable< T >::OptionalTable ( Name &&  name)
explicit
template<typename T>
fhicl::OptionalTable< T >::OptionalTable ( Name &&  name,
Comment &&  comment 
)
explicit
template<typename T>
fhicl::OptionalTable< T >::OptionalTable ( Name &&  name,
Comment &&  comment,
std::function< bool()>  maybeUse 
)
explicit
template<typename T>
fhicl::OptionalTable< T >::OptionalTable ( ParameterSet const &  pset,
std::set< std::string > const &  keysToIgnore 
)
template<typename T>
fhicl::OptionalTable< T >::OptionalTable ( )

Member Function Documentation

std::string fhicl::detail::ParameterBase::comment ( ) const
inlineinherited
template<typename T>
void fhicl::OptionalTable< T >::do_set_value ( fhicl::ParameterSet const &  pset,
bool const  trimParents 
)
overrideprivatevirtual
template<typename T>
members_t const& fhicl::OptionalTable< T >::get_members ( ) const
inlineoverrideprivatevirtual

Implements fhicl::detail::TableBase.

Definition at line 90 of file OptionalTable.h.

91  {
92  return members_;
93  }
template<typename T>
ParameterSet const& fhicl::OptionalTable< T >::get_PSet ( ) const
inline

Definition at line 62 of file OptionalTable.h.

63  {
64  return pset_;
65  }
ParameterSet pset_
Definition: OptionalTable.h:85
bool fhicl::detail::ParameterBase::has_default ( ) const
inlineinherited
template<typename T>
bool fhicl::OptionalTable< T >::hasValue ( ) const
inline

Definition at line 56 of file OptionalTable.h.

57  {
58  return has_value_;
59  }
bool fhicl::detail::ParameterBase::is_conditional ( ) const
inlineinherited
bool fhicl::detail::ParameterBase::is_optional ( ) const
inlineinherited
std::string fhicl::detail::ParameterBase::key ( ) const
inlineinherited
std::vector<cet::exempt_ptr<ParameterBase> > const& fhicl::detail::TableBase::members ( ) const
inlineinherited

Definition at line 24 of file TableBase.h.

References fhicl::detail::TableBase::get_members().

25  {
26  return get_members();
27  }
virtual std::vector< cet::exempt_ptr< ParameterBase > > const & get_members() const =0
std::string fhicl::detail::ParameterBase::name ( ) const
inlineinherited
template<typename T>
bool fhicl::OptionalTable< T >::operator() ( T value) const
inline

Definition at line 46 of file OptionalTable.h.

47  {
48  if (has_value_) {
49  value = *value_;
50  return true;
51  }
52  return false;
53  }
std::shared_ptr< T > value_
Definition: OptionalTable.h:83
const XML_Char int const XML_Char * value
Definition: expat.h:331
par_type fhicl::detail::ParameterBase::parameter_type ( ) const
inlineinherited
template<typename T>
void fhicl::OptionalTable< T >::print_allowed_configuration ( std::ostream &  os,
std::string const &  tab = std::string(3, ' ') 
) const
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().

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

Definition at line 79 of file ParameterBase.h.

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

80  {
81  return maybeUse_();
82  }
std::function< bool()> maybeUse_
template<typename T>
void fhicl::OptionalTable< T >::validate_ParameterSet ( ParameterSet const &  pset,
std::set< std::string > const &  keysToIgnore = {} 
)

Member Data Documentation

template<typename T>
bool fhicl::OptionalTable< T >::has_value_ {false}
private
template<typename T>
members_t fhicl::OptionalTable< T >::members_
private
template<typename T>
ParameterSet fhicl::OptionalTable< T >::pset_ {}
private
template<typename T>
std::shared_ptr<T> fhicl::OptionalTable< T >::value_ {std::make_shared<T>()}
private

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