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

#include <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 84 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

Definition at line 148 of file ParameterWalker.h.

149  {}
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 143 of file ParameterWalker.h.

144  {
145  return true;
146  }
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 97 of file ParameterWalker.h.

98  {
99  after_action(p);
100  }
virtual void after_action(tt::maybe_const_t< ParameterBase, C > &)
p
Definition: test.py:223
template<tt::const_flavor C>
void fhicl::detail::ParameterWalker< C >::do_atom ( tt::maybe_const_t< AtomBase, C > &  a)
inline

Definition at line 125 of file ParameterWalker.h.

126  {
127  atom(a);
128  }
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 92 of file ParameterWalker.h.

93  {
94  return before_action(p);
95  }
p
Definition: test.py:223
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 131 of file ParameterWalker.h.

132  {
134  }
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 114 of file ParameterWalker.h.

115  {
116  enter_sequence(s);
117  }
static QCString * s
Definition: config.cpp:1042
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 103 of file ParameterWalker.h.

104  {
105  enter_table(t);
106  }
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 119 of file ParameterWalker.h.

120  {
121  exit_sequence(s);
122  }
virtual void exit_sequence(tt::maybe_const_t< SequenceBase, C > &)
static QCString * s
Definition: config.cpp:1042
template<tt::const_flavor C>
void fhicl::detail::ParameterWalker< C >::do_exit_table ( tt::maybe_const_t< TableBase, C > &  t)
inline

Definition at line 108 of file ParameterWalker.h.

109  {
110  exit_table(t);
111  }
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

Definition at line 154 of file ParameterWalker.h.

155  {}
template<tt::const_flavor C>
virtual void fhicl::detail::ParameterWalker< C >::exit_table ( tt::maybe_const_t< TableBase, C > &  )
inlineprivatevirtual

Definition at line 151 of file ParameterWalker.h.

152  {}
template<tt::const_flavor C>
void fhicl::detail::ParameterWalker< C >::walk_over ( tt::maybe_const_t< ParameterBase, C > &  p)

Definition at line 163 of file ParameterWalker.h.

164  {
165  if (!do_before_action(p))
166  return;
167 
168  fhicl::par_type const pt = p.parameter_type();
169 
170  auto& tw = *this;
171 
172  if (is_table(pt)) {
173  using maybe_const_table = tt::maybe_const_t<TableBase, C>;
174  maybe_const_table& t = dynamic_cast<maybe_const_table&>(p);
175  do_enter_table(t);
176  cet::for_all(t.members(), [&tw](auto m) { tw.walk_over(*m); });
177  do_exit_table(t);
178  } else if (is_sequence(pt)) {
179  using maybe_const_sequence = tt::maybe_const_t<SequenceBase, C>;
180  maybe_const_sequence& s = dynamic_cast<maybe_const_sequence&>(p);
182  s.walk_elements(tw);
183  do_exit_sequence(s);
184  } else if (is_atom(pt)) {
185  using maybe_const_atom = tt::maybe_const_t<AtomBase, C>;
186  maybe_const_atom& a = dynamic_cast<maybe_const_atom&>(p);
187  do_atom(a);
188  } else {
189  using maybe_const_delegate = tt::maybe_const_t<DelegateBase, C>;
190  maybe_const_delegate& dp = dynamic_cast<maybe_const_delegate&>(p);
192  }
193 
195  }
bool is_atom(par_type const pt)
void do_delegated_parameter(tt::maybe_const_t< DelegateBase, C > &dp)
void do_after_action(tt::maybe_const_t< ParameterBase, C > &p)
const double a
p
Definition: test.py:223
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:112
bool is_table(std::any const &val)
Definition: coding.h:55
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)
static QCString * s
Definition: config.cpp:1042
bool is_sequence(std::any const &val)
Definition: coding.h:49

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