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

#include "PrettifierPrefixAnnotated.h"

Inheritance diagram for fhicl::detail::PrettifierPrefixAnnotated:
fhicl::ParameterSetWalker

Public Types

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

Public Member Functions

std::string result () const
 
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 before_action (key_t const &, any_t const &, ParameterSet const *) override
 
void enter_table (key_t const &, any_t const &) override
 
void enter_sequence (key_t const &, any_t const &) override
 
void exit_table (key_t const &, any_t const &) override
 
void exit_sequence (key_t const &, any_t const &) override
 
void atom (key_t const &, any_t const &) override
 
void push_size_ (any_t const &)
 
void pop_size_ ()
 
std::string print_full_key_ (name_t const &k) const
 

Private Attributes

std::stringstream buffer_ {}
 
Indentation indent_ {}
 
std::string info_ {}
 
std::stack< std::size_t > sequence_sizes_ {{-1u}}
 
std::size_t curr_size_ {}
 
std::vector< name_tname_stack_ {}
 

Detailed Description

Definition at line 146 of file PrettifierPrefixAnnotated.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.

Definition at line 148 of file PrettifierPrefixAnnotated.h.

Member Function Documentation

void PrettifierPrefixAnnotated::atom ( key_t const &  key,
any_t const &  a 
)
overrideprivatevirtual

Implements fhicl::ParameterSetWalker.

Definition at line 65 of file PrettifierPrefixAnnotated.cc.

References buffer_, indent_, info_, fhicl::detail::nl(), print_full_key_(), fhicl::detail::print_prefix_annotated_info(), fhicl::detail::atom::printed_prefix(), fhicl::detail::printed_suffix(), sequence_sizes_, and fhicl::detail::atom::value().

Referenced by result().

66 {
68  << nl() << indent_() << atom::printed_prefix(key) << atom::value(a)
69  << printed_suffix(key, sequence_sizes_.top()) << nl();
70 }
std::string printed_suffix(std::string const &key, std::size_t const sz)
std::string print_prefix_annotated_info(std::string const &curr_info)
std::string print_full_key_(name_t const &k) const
std::string value(std::any const &)
std::string printed_prefix(std::string const &key)
std::string nl(std::size_t i=1)
void PrettifierPrefixAnnotated::before_action ( key_t const &  key,
any_t const &  ,
ParameterSet const *  ps 
)
overrideprivatevirtual

Reimplemented from fhicl::ParameterSetWalker.

Definition at line 13 of file PrettifierPrefixAnnotated.cc.

References fhicl::ParameterSet::get_src_info(), and info_.

Referenced by result().

16 {
17  info_ = ps->get_src_info(key);
18 }
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 PrettifierPrefixAnnotated::enter_sequence ( key_t const &  key,
any_t const &  a 
)
overrideprivatevirtual

Implements fhicl::ParameterSetWalker.

Definition at line 43 of file PrettifierPrefixAnnotated.cc.

References buffer_, indent_, info_, fhicl::detail::nl(), print_full_key_(), fhicl::detail::print_prefix_annotated_info(), fhicl::detail::sequence::printed_prefix(), fhicl::detail::Indentation::push(), and push_size_().

Referenced by result().

45 {
46  push_size_(a);
48  << nl() << indent_() << sequence::printed_prefix(key) << nl();
49  indent_.push();
50 }
std::string printed_prefix(std::string const &key)
std::string print_prefix_annotated_info(std::string const &curr_info)
std::string print_full_key_(name_t const &k) const
std::string nl(std::size_t i=1)
void PrettifierPrefixAnnotated::enter_table ( key_t const &  key,
any_t const &   
)
overrideprivatevirtual

Implements fhicl::ParameterSetWalker.

Definition at line 23 of file PrettifierPrefixAnnotated.cc.

References buffer_, indent_, info_, name_stack_, fhicl::detail::nl(), print_full_key_(), fhicl::detail::print_prefix_annotated_info(), fhicl::detail::table::printed_prefix(), and fhicl::detail::Indentation::push().

Referenced by result().

24 {
26  << nl() << indent_() << table::printed_prefix(key) << nl();
27  indent_.push();
28  name_stack_.emplace_back(key);
29 }
std::string print_prefix_annotated_info(std::string const &curr_info)
std::string printed_prefix(std::string const &key)
std::string print_full_key_(name_t const &k) const
std::string nl(std::size_t i=1)
void PrettifierPrefixAnnotated::exit_sequence ( key_t const &  key,
any_t const &   
)
overrideprivatevirtual
void PrettifierPrefixAnnotated::exit_table ( key_t const &  key,
any_t const &   
)
overrideprivatevirtual
void PrettifierPrefixAnnotated::pop_size_ ( )
private

Definition at line 82 of file PrettifierPrefixAnnotated.cc.

References curr_size_, and sequence_sizes_.

Referenced by exit_sequence(), and result().

std::string PrettifierPrefixAnnotated::print_full_key_ ( name_t const &  k) const
private

Definition at line 89 of file PrettifierPrefixAnnotated.cc.

References name_stack_.

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

90 {
91  std::ostringstream os;
92  os << "#KEY|";
93  cet::copy_all(name_stack_, std::ostream_iterator<std::string>{os, "."});
94  os << name << "|";
95  return os.str();
96 }
void PrettifierPrefixAnnotated::push_size_ ( any_t const &  a)
private

Definition at line 75 of file PrettifierPrefixAnnotated.cc.

References curr_size_, sequence_sizes_, and util::size().

Referenced by enter_sequence(), and result().

76 {
77  sequence_sizes_.emplace(std::any_cast<ps_sequence_t>(a).size());
79 }
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
std::string fhicl::detail::PrettifierPrefixAnnotated::result ( ) const
inline

Member Data Documentation

std::stringstream fhicl::detail::PrettifierPrefixAnnotated::buffer_ {}
private
std::size_t fhicl::detail::PrettifierPrefixAnnotated::curr_size_ {}
private

Definition at line 177 of file PrettifierPrefixAnnotated.h.

Referenced by pop_size_(), and push_size_().

Indentation fhicl::detail::PrettifierPrefixAnnotated::indent_ {}
private
std::string fhicl::detail::PrettifierPrefixAnnotated::info_ {}
private

Definition at line 175 of file PrettifierPrefixAnnotated.h.

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

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

Definition at line 178 of file PrettifierPrefixAnnotated.h.

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

std::stack<std::size_t> fhicl::detail::PrettifierPrefixAnnotated::sequence_sizes_ {{-1u}}
private

Definition at line 176 of file PrettifierPrefixAnnotated.h.

Referenced by atom(), exit_sequence(), exit_table(), pop_size_(), and push_size_().


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