LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
fhicl::detail::KeyAssembler Class Reference

#include "KeyAssembler.h"

Inheritance diagram for fhicl::detail::KeyAssembler:
fhicl::ParameterSetWalker

Public Types

using key_t = std::string
 
using any_t = std::any
 

Public Member Functions

std::vector< key_t > const & result ()
 
void do_enter_table (key_t const &k, any_t const &a)
 
void do_enter_sequence (key_t const &k, any_t const &a)
 
void do_atom (key_t const &k, any_t const &a)
 
void do_before_action (key_t const &k, any_t const &a, ParameterSet const *ps)
 
void do_after_action (key_t const &k)
 
void do_exit_table (key_t const &k, any_t const &a)
 
void do_exit_sequence (key_t const &k, any_t const &a)
 

Private Member Functions

void enter_table (key_t const &, std::any const &) override
 
void exit_table (key_t const &, std::any const &) override
 
void enter_sequence (key_t const &, std::any const &) override
 
void atom (key_t const &, std::any const &) override
 
std::string full_key_ (name_t const &) const
 

Private Attributes

std::vector< key_tkeys_ {}
 
std::vector< name_tname_stack_ {}
 

Detailed Description

Definition at line 72 of file KeyAssembler.h.

Member Typedef Documentation

using fhicl::ParameterSetWalker::any_t = std::any
inherited

Definition at line 79 of file ParameterSetWalker.h.

using fhicl::ParameterSetWalker::key_t = std::string
inherited

Definition at line 78 of file ParameterSetWalker.h.

Member Function Documentation

void KeyAssembler::atom ( key_t const &  key,
std::any const &   
)
overrideprivatevirtual

Implements fhicl::ParameterSetWalker.

Definition at line 38 of file KeyAssembler.cc.

References full_key_(), and keys_.

Referenced by result().

39 {
40  keys_.emplace_back(full_key_(key));
41 }
std::string full_key_(name_t const &) const
Definition: KeyAssembler.cc:10
std::vector< key_t > keys_
Definition: KeyAssembler.h:89
void fhicl::ParameterSetWalker::do_after_action ( key_t const &  k)
inlineinherited

Definition at line 103 of file ParameterSetWalker.h.

References fhicl::ParameterSetWalker::after_action().

Referenced by fhicl::ParameterSet::walk().

104  {
105  after_action(k);
106  }
virtual void after_action(key_t const &)
void fhicl::ParameterSetWalker::do_atom ( key_t const &  k,
any_t const &  a 
)
inlineinherited

Definition at line 92 of file ParameterSetWalker.h.

References fhicl::ParameterSetWalker::atom().

Referenced by fhicl::ParameterSet::walk().

93  {
94  atom(k, a);
95  }
virtual void atom(key_t const &, any_t const &)=0
void fhicl::ParameterSetWalker::do_before_action ( key_t const &  k,
any_t const &  a,
ParameterSet const *  ps 
)
inlineinherited

Definition at line 98 of file ParameterSetWalker.h.

References fhicl::ParameterSetWalker::before_action().

Referenced by fhicl::ParameterSet::walk().

99  {
100  before_action(k, a, ps);
101  }
virtual void before_action(key_t const &, any_t const &, ParameterSet const *)
void fhicl::ParameterSetWalker::do_enter_sequence ( key_t const &  k,
any_t const &  a 
)
inlineinherited

Definition at line 87 of file ParameterSetWalker.h.

References fhicl::ParameterSetWalker::enter_sequence().

Referenced by fhicl::ParameterSet::walk().

88  {
89  enter_sequence(k, a);
90  }
virtual void enter_sequence(key_t const &, any_t const &)=0
void fhicl::ParameterSetWalker::do_enter_table ( key_t const &  k,
any_t const &  a 
)
inlineinherited

Definition at line 82 of file ParameterSetWalker.h.

References fhicl::ParameterSetWalker::enter_table().

Referenced by fhicl::ParameterSet::walk().

83  {
84  enter_table(k, a);
85  }
virtual void enter_table(key_t const &, any_t const &)=0
void fhicl::ParameterSetWalker::do_exit_sequence ( key_t const &  k,
any_t const &  a 
)
inlineinherited
void fhicl::ParameterSetWalker::do_exit_table ( key_t const &  k,
any_t const &  a 
)
inlineinherited

Definition at line 109 of file ParameterSetWalker.h.

References fhicl::ParameterSetWalker::exit_table().

Referenced by fhicl::ParameterSet::walk().

110  {
111  exit_table(k, a);
112  }
virtual void exit_table(key_t const &, any_t const &)
void KeyAssembler::enter_sequence ( key_t const &  key,
std::any const &   
)
overrideprivatevirtual

Implements fhicl::ParameterSetWalker.

Definition at line 32 of file KeyAssembler.cc.

References full_key_(), and keys_.

Referenced by result().

33 {
34  keys_.emplace_back(full_key_(key));
35 }
std::string full_key_(name_t const &) const
Definition: KeyAssembler.cc:10
std::vector< key_t > keys_
Definition: KeyAssembler.h:89
void KeyAssembler::enter_table ( key_t const &  key,
std::any const &   
)
overrideprivatevirtual

Implements fhicl::ParameterSetWalker.

Definition at line 19 of file KeyAssembler.cc.

References full_key_(), keys_, and name_stack_.

Referenced by result().

20 {
21  keys_.emplace_back(full_key_(key));
22  name_stack_.emplace_back(key);
23 }
std::vector< name_t > name_stack_
Definition: KeyAssembler.h:90
std::string full_key_(name_t const &) const
Definition: KeyAssembler.cc:10
std::vector< key_t > keys_
Definition: KeyAssembler.h:89
void KeyAssembler::exit_table ( key_t const &  ,
std::any const &   
)
overrideprivatevirtual

Reimplemented from fhicl::ParameterSetWalker.

Definition at line 26 of file KeyAssembler.cc.

References name_stack_.

Referenced by result().

27 {
28  name_stack_.pop_back();
29 }
std::vector< name_t > name_stack_
Definition: KeyAssembler.h:90
std::string KeyAssembler::full_key_ ( name_t const &  name) const
private

Definition at line 10 of file KeyAssembler.cc.

References name_stack_.

Referenced by atom(), enter_sequence(), enter_table(), and result().

11 {
12  std::ostringstream os;
13  cet::copy_all(name_stack_, std::ostream_iterator<std::string>{os, "."});
14  os << name;
15  return os.str();
16 }
std::vector< name_t > name_stack_
Definition: KeyAssembler.h:90
std::vector<key_t> const& fhicl::detail::KeyAssembler::result ( )
inline

Definition at line 75 of file KeyAssembler.h.

References atom(), enter_sequence(), enter_table(), exit_table(), full_key_(), and keys_.

Referenced by fhicl::ParameterSet::get_all_keys().

76  {
77  return keys_;
78  }
std::vector< key_t > keys_
Definition: KeyAssembler.h:89

Member Data Documentation

std::vector<key_t> fhicl::detail::KeyAssembler::keys_ {}
private

Definition at line 89 of file KeyAssembler.h.

Referenced by atom(), enter_sequence(), enter_table(), and result().

std::vector<name_t> fhicl::detail::KeyAssembler::name_stack_ {}
private

Definition at line 90 of file KeyAssembler.h.

Referenced by enter_table(), exit_table(), and full_key_().


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