LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 83 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 bool fhicl::detail::ParameterWalker< C >::before_action ( tt::maybe_const_t< ParameterBase, C > &  )
inlineprivatevirtual

Definition at line 142 of file ParameterWalker.h.

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

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

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

97  {
98  after_action(p);
99  }
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 124 of file ParameterWalker.h.

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

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

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

92  {
93  return before_action(p);
94  }
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 130 of file ParameterWalker.h.

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

131  {
133  }
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 113 of file ParameterWalker.h.

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

114  {
115  enter_sequence(s);
116  }
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 102 of file ParameterWalker.h.

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

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

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

119  {
120  exit_sequence(s);
121  }
virtual void exit_sequence(tt::maybe_const_t< SequenceBase, C > &)
template<tt::const_flavor C>
void fhicl::detail::ParameterWalker< C >::do_exit_table ( tt::maybe_const_t< TableBase, C > &  t)
inline

Definition at line 107 of file ParameterWalker.h.

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

108  {
109  exit_table(t);
110  }
virtual void exit_table(tt::maybe_const_t< TableBase, C > &)
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 162 of file ParameterWalker.h.

References 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(), fhicl::is_atom(), fhicl::detail::is_sequence(), fhicl::detail::is_table(), and pt.

Referenced by fhicl::detail::ValidateThenSet::delegated_parameter(), fhicl::OptionalSequence< art::InputTag >::do_walk_elements(), fhicl::Sequence< float, 3u >::do_walk_elements(), fhicl::OptionalSequence< T,-1ull >::do_walk_elements(), fhicl::Sequence< T,-1ull >::do_walk_elements(), fhicl::OptionalTuple< ARGS... >::iterate_over_tuple(), fhicl::Tuple< T >::iterate_over_tuple(), and fhicl::detail::TableBase::print_allowed_configuration().

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

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