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

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

Inheritance diagram for fhicl::OptionalAtom< T >:
fhicl::detail::AtomBase fhicl::detail::RegisterIfTableMember fhicl::detail::ParameterBase

Public Types

using value_type = T
 

Public Member Functions

 OptionalAtom (Name &&name)
 
 OptionalAtom (Name &&name, Comment &&comment)
 
 OptionalAtom (Name &&name, Comment &&comment, std::function< bool()> maybeUse)
 
bool operator() (T &value) const
 
bool hasValue () const
 
 OptionalAtom ()
 
std::string stringified_value () 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

std::string get_stringified_value () const override
 
void do_set_value (fhicl::ParameterSet const &, bool const) override
 

Private Attributes

T value_ {}
 
bool has_value_ {false}
 

Detailed Description

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

Definition at line 27 of file type_traits.h.

Member Typedef Documentation

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

Definition at line 59 of file OptionalAtom.h.

Constructor & Destructor Documentation

template<typename T>
fhicl::OptionalAtom< T >::OptionalAtom ( Name &&  name)
explicit
template<typename T>
fhicl::OptionalAtom< T >::OptionalAtom ( Name &&  name,
Comment &&  comment 
)
explicit
template<typename T>
fhicl::OptionalAtom< T >::OptionalAtom ( Name &&  name,
Comment &&  comment,
std::function< bool()>  maybeUse 
)
explicit
template<typename T>
fhicl::OptionalAtom< T >::OptionalAtom ( )

Member Function Documentation

std::string fhicl::detail::ParameterBase::comment ( ) const
inlineinherited
template<typename T>
void fhicl::OptionalAtom< T >::do_set_value ( fhicl::ParameterSet const &  ,
bool  const 
)
overrideprivatevirtual
template<typename T>
std::string fhicl::OptionalAtom< T >::get_stringified_value ( ) const
overrideprivatevirtual
bool fhicl::detail::ParameterBase::has_default ( ) const
inlineinherited
template<typename T>
bool fhicl::OptionalAtom< T >::hasValue ( ) const
inline

Definition at line 53 of file OptionalAtom.h.

54  {
55  return has_value_;
56  }
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::string fhicl::detail::ParameterBase::name ( ) const
inlineinherited
template<typename T>
bool fhicl::OptionalAtom< T >::operator() ( T value) const
inline

Definition at line 43 of file OptionalAtom.h.

44  {
45  if (has_value_) {
46  value = value_;
47  return true;
48  }
49  return false;
50  }
const XML_Char int const XML_Char * value
Definition: expat.h:331
par_type fhicl::detail::ParameterBase::parameter_type ( ) const
inlineinherited
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_
std::string fhicl::detail::AtomBase::stringified_value ( ) const
inlineinherited

Definition at line 24 of file AtomBase.h.

References fhicl::detail::AtomBase::get_stringified_value(), and string.

25  {
26  return get_stringified_value();
27  }
virtual std::string get_stringified_value() const =0

Member Data Documentation

template<typename T>
bool fhicl::OptionalAtom< T >::has_value_ {false}
private
template<typename T>
T fhicl::OptionalAtom< T >::value_ {}
private

Definition at line 64 of file OptionalAtom.h.

Referenced by fhicl::OptionalAtom< RunNumber_t >::operator()().


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