Public Member Functions | Private Member Functions | List of all members
fhicl::detail::ParameterWalker< C > Class Template Referenceabstract

#include "/cvmfs/nova.opensciencegrid.org/externals/fhiclcpp/v4_06_10/source/fhiclcpp/types/detail/ParameterWalker.h"

Public Member Functions

 ParameterWalker ()=default
 
virtual ~ParameterWalker ()=default
 
void walk_over (tt::maybe_const_t< ParameterBase, C > &)
 
bool do_before_action (tt::maybe_const_t< ParameterBase, C > &p)
 
void do_after_action (tt::maybe_const_t< ParameterBase, C > &p)
 
void do_enter_table (tt::maybe_const_t< TableBase, C > &t)
 
void do_exit_table (tt::maybe_const_t< TableBase, C > &t)
 
void do_enter_sequence (tt::maybe_const_t< SequenceBase, C > &s)
 
void do_exit_sequence (tt::maybe_const_t< SequenceBase, C > &s)
 
void do_atom (tt::maybe_const_t< AtomBase, C > &a)
 
void do_delegated_parameter (tt::maybe_const_t< DelegateBase, C > &dp)
 

Private Member Functions

virtual void enter_table (tt::maybe_const_t< TableBase, C > &)=0
 
virtual void enter_sequence (tt::maybe_const_t< SequenceBase, C > &)=0
 
virtual void atom (tt::maybe_const_t< AtomBase, C > &)=0
 
virtual void delegated_parameter (tt::maybe_const_t< DelegateBase, C > &)=0
 
virtual bool before_action (tt::maybe_const_t< ParameterBase, C > &)
 
virtual void after_action (tt::maybe_const_t< ParameterBase, C > &)
 
virtual void exit_table (tt::maybe_const_t< TableBase, C > &)
 
virtual void exit_sequence (tt::maybe_const_t< SequenceBase, C > &)
 

Detailed Description

template<tt::const_flavor C>
class fhicl::detail::ParameterWalker< C >

Definition at line 85 of file ParameterWalker.h.

Constructor & Destructor Documentation

template<tt::const_flavor C>
fhicl::detail::ParameterWalker< C >::ParameterWalker ( )
default
template<tt::const_flavor C>
virtual fhicl::detail::ParameterWalker< C >::~ParameterWalker ( )
virtualdefault

Member Function Documentation

template<tt::const_flavor C>
virtual void fhicl::detail::ParameterWalker< C >::after_action ( tt::maybe_const_t< ParameterBase, C > &  )
inlineprivatevirtual
template<tt::const_flavor C>
virtual void fhicl::detail::ParameterWalker< C >::atom ( tt::maybe_const_t< AtomBase, C > &  )
privatepure virtual
template<tt::const_flavor C>
virtual bool fhicl::detail::ParameterWalker< C >::before_action ( tt::maybe_const_t< ParameterBase, C > &  )
inlineprivatevirtual

Definition at line 144 of file ParameterWalker.h.

Referenced by fhicl::detail::ParameterWalker< tt::const_flavor::require_const >::do_before_action().

145  {
146  return true;
147  }
template<tt::const_flavor C>
virtual void fhicl::detail::ParameterWalker< C >::delegated_parameter ( tt::maybe_const_t< DelegateBase, C > &  )
privatepure virtual
template<tt::const_flavor C>
void fhicl::detail::ParameterWalker< C >::do_after_action ( tt::maybe_const_t< ParameterBase, C > &  p)
inline

Definition at line 98 of file ParameterWalker.h.

Referenced by fhicl::detail::ParameterWalker< C >::walk_over().

99  {
100  after_action(p);
101  }
const char * p
Definition: xmltok.h:285
virtual void after_action(tt::maybe_const_t< ParameterBase, C > &)
template<tt::const_flavor C>
void fhicl::detail::ParameterWalker< C >::do_atom ( tt::maybe_const_t< AtomBase, C > &  a)
inline

Definition at line 126 of file ParameterWalker.h.

Referenced by fhicl::detail::ParameterWalker< C >::walk_over().

127  {
128  atom(a);
129  }
const double a
virtual void atom(tt::maybe_const_t< AtomBase, C > &)=0
template<tt::const_flavor C>
bool fhicl::detail::ParameterWalker< C >::do_before_action ( tt::maybe_const_t< ParameterBase, C > &  p)
inline

Definition at line 93 of file ParameterWalker.h.

Referenced by fhicl::detail::ParameterWalker< C >::walk_over().

94  {
95  return before_action(p);
96  }
const char * p
Definition: xmltok.h:285
virtual bool before_action(tt::maybe_const_t< ParameterBase, C > &)
template<tt::const_flavor C>
void fhicl::detail::ParameterWalker< C >::do_delegated_parameter ( tt::maybe_const_t< DelegateBase, C > &  dp)
inline

Definition at line 132 of file ParameterWalker.h.

Referenced by fhicl::detail::ParameterWalker< C >::walk_over().

133  {
135  }
virtual void delegated_parameter(tt::maybe_const_t< DelegateBase, C > &)=0
template<tt::const_flavor C>
void fhicl::detail::ParameterWalker< C >::do_enter_sequence ( tt::maybe_const_t< SequenceBase, C > &  s)
inline

Definition at line 115 of file ParameterWalker.h.

Referenced by fhicl::detail::ParameterWalker< C >::walk_over().

116  {
117  enter_sequence(s);
118  }
const XML_Char * s
Definition: expat.h:262
virtual void enter_sequence(tt::maybe_const_t< SequenceBase, C > &)=0
template<tt::const_flavor C>
void fhicl::detail::ParameterWalker< C >::do_enter_table ( tt::maybe_const_t< TableBase, C > &  t)
inline

Definition at line 104 of file ParameterWalker.h.

Referenced by fhicl::detail::ParameterWalker< C >::walk_over().

105  {
106  enter_table(t);
107  }
virtual void enter_table(tt::maybe_const_t< TableBase, C > &)=0
template<tt::const_flavor C>
void fhicl::detail::ParameterWalker< C >::do_exit_sequence ( tt::maybe_const_t< SequenceBase, C > &  s)
inline

Definition at line 120 of file ParameterWalker.h.

Referenced by fhicl::detail::ParameterWalker< C >::walk_over().

121  {
122  exit_sequence(s);
123  }
virtual void exit_sequence(tt::maybe_const_t< SequenceBase, C > &)
const XML_Char * s
Definition: expat.h:262
template<tt::const_flavor C>
void fhicl::detail::ParameterWalker< C >::do_exit_table ( tt::maybe_const_t< TableBase, C > &  t)
inline

Definition at line 109 of file ParameterWalker.h.

Referenced by fhicl::detail::ParameterWalker< C >::walk_over().

110  {
111  exit_table(t);
112  }
virtual void exit_table(tt::maybe_const_t< TableBase, C > &)
template<tt::const_flavor C>
virtual void fhicl::detail::ParameterWalker< C >::enter_sequence ( tt::maybe_const_t< SequenceBase, C > &  )
privatepure virtual
template<tt::const_flavor C>
virtual void fhicl::detail::ParameterWalker< C >::enter_table ( tt::maybe_const_t< TableBase, C > &  )
privatepure virtual
template<tt::const_flavor C>
virtual void fhicl::detail::ParameterWalker< C >::exit_sequence ( tt::maybe_const_t< SequenceBase, C > &  )
inlineprivatevirtual
template<tt::const_flavor C>
virtual void fhicl::detail::ParameterWalker< C >::exit_table ( tt::maybe_const_t< TableBase, C > &  )
inlineprivatevirtual
template<tt::const_flavor C>
void fhicl::detail::ParameterWalker< C >::walk_over ( tt::maybe_const_t< ParameterBase, C > &  p)

Definition at line 164 of file ParameterWalker.h.

References a, fhicl::detail::ParameterWalker< C >::do_after_action(), fhicl::detail::ParameterWalker< C >::do_atom(), fhicl::detail::ParameterWalker< C >::do_before_action(), fhicl::detail::ParameterWalker< C >::do_delegated_parameter(), fhicl::detail::ParameterWalker< C >::do_enter_sequence(), fhicl::detail::ParameterWalker< C >::do_enter_table(), fhicl::detail::ParameterWalker< C >::do_exit_sequence(), fhicl::detail::ParameterWalker< C >::do_exit_table(), cet::for_all(), fhicl::is_atom(), fhicl::detail::is_sequence(), fhicl::detail::is_table(), m, gen_flatrecord::pt, and confusionMatrixTree::t.

Referenced by fhicl::OptionalSequence< Table< T >< art::RootInputFileSequence::Config::SecondaryFile > >::do_walk_elements(), fhicl::Sequence< string >::do_walk_elements(), fhicl::OptionalSequence< T,-1ull >::do_walk_elements(), fhicl::Sequence< T,-1ull >::do_walk_elements(), fhicl::OptionalTuple< ARGS... >::visit_element(), and fhicl::Tuple< TYPES >::visit_element().

165  {
166  if (!do_before_action(p))
167  return;
168 
169  fhicl::par_type const pt = p.parameter_type();
170 
171  auto& tw = *this;
172 
173  if (is_table(pt)) {
174  using maybe_const_table = tt::maybe_const_t<TableBase, C>;
175  maybe_const_table& t = dynamic_cast<maybe_const_table&>(p);
176  do_enter_table(t);
177  cet::for_all(t.members(), [&tw](auto m) { tw.walk_over(*m); });
178  do_exit_table(t);
179  } else if (is_sequence(pt)) {
180  using maybe_const_sequence = tt::maybe_const_t<SequenceBase, C>;
181  maybe_const_sequence& s = dynamic_cast<maybe_const_sequence&>(p);
183  s.walk_elements(tw);
184  do_exit_sequence(s);
185  } else if (is_atom(pt)) {
186  using maybe_const_atom = tt::maybe_const_t<AtomBase, C>;
187  maybe_const_atom& a = dynamic_cast<maybe_const_atom&>(p);
188  do_atom(a);
189  } else {
190  using maybe_const_delegate = tt::maybe_const_t<DelegateBase, C>;
191  maybe_const_delegate& dp = dynamic_cast<maybe_const_delegate&>(p);
193  }
194 
196  }
bool is_atom(par_type const pt)
const char * p
Definition: xmltok.h:285
void do_delegated_parameter(tt::maybe_const_t< DelegateBase, C > &dp)
bool is_sequence(boost::any const &val)
Definition: coding.h:50
bool is_table(boost::any const &val)
Definition: coding.h:56
const XML_Char * s
Definition: expat.h:262
void do_after_action(tt::maybe_const_t< ParameterBase, C > &p)
const double a
void do_enter_sequence(tt::maybe_const_t< SequenceBase, C > &s)
void do_enter_table(tt::maybe_const_t< TableBase, C > &t)
void do_exit_sequence(tt::maybe_const_t< SequenceBase, C > &s)
auto for_all(FwdCont &, Func)
typename maybe_const< T, C >::type maybe_const_t
Definition: type_traits.h:107
bool do_before_action(tt::maybe_const_t< ParameterBase, C > &p)
void do_atom(tt::maybe_const_t< AtomBase, C > &a)
void do_exit_table(tt::maybe_const_t< TableBase, C > &t)

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