LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 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 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  }
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  }
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  }
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  }
Float_t s
Definition: plot.C:23
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  }
Float_t s
Definition: plot.C:23
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 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 >::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 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(), pt, and s.

Referenced by fhicl::detail::ValidateThenSet::delegated_parameter(), art::detail::describe(), fhicl::OptionalSequence< Table< T >< art::RootInputFileSequence::Config::SecondaryFile > >::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... >::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 
195  do_after_action(p);
196  }
Float_t s
Definition: plot.C:23
bool is_atom(par_type const pt)
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
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:111
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: