LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 = boost::any
 

Public Member Functions

 PrettifierPrefixAnnotated ()
 
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 ()
 
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_
 
std::size_t curr_size_
 
std::vector< name_tname_stack_
 

Detailed Description

Definition at line 148 of file PrettifierPrefixAnnotated.h.

Member Typedef Documentation

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

Definition at line 80 of file ParameterSetWalker.h.

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

Definition at line 79 of file ParameterSetWalker.h.

Definition at line 150 of file PrettifierPrefixAnnotated.h.

Constructor & Destructor Documentation

PrettifierPrefixAnnotated::PrettifierPrefixAnnotated ( )

Member Function Documentation

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

Implements fhicl::ParameterSetWalker.

Definition at line 76 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().

77 {
79  << nl() << indent_() << atom::printed_prefix(key) << atom::value(a)
80  << printed_suffix(key, sequence_sizes_.top()) << nl();
81 }
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(boost::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 23 of file PrettifierPrefixAnnotated.cc.

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

Referenced by result().

26 {
27  info_ = ps->get_src_info(key);
28 }
void fhicl::ParameterSetWalker::do_after_action ( )
inlineinherited

Definition at line 104 of file ParameterSetWalker.h.

References fhicl::ParameterSetWalker::after_action().

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

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

Definition at line 93 of file ParameterSetWalker.h.

References fhicl::ParameterSetWalker::atom().

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

94  {
95  atom(k, a);
96  }
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 99 of file ParameterSetWalker.h.

References fhicl::ParameterSetWalker::before_action().

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

100  {
101  before_action(k, a, ps);
102  }
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 88 of file ParameterSetWalker.h.

References fhicl::ParameterSetWalker::enter_sequence().

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

89  {
90  enter_sequence(k, a);
91  }
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 83 of file ParameterSetWalker.h.

References fhicl::ParameterSetWalker::enter_table().

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

84  {
85  enter_table(k, a);
86  }
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 110 of file ParameterSetWalker.h.

References fhicl::ParameterSetWalker::exit_table().

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

111  {
112  exit_table(k, a);
113  }
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 54 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().

56 {
57  push_size_(a);
59  << nl() << indent_() << sequence::printed_prefix(key) << nl();
60  indent_.push();
61 }
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 33 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().

35 {
37  << nl() << indent_() << table::printed_prefix(key) << nl();
38  indent_.push();
39  name_stack_.emplace_back(key);
40 }
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 93 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 100 of file PrettifierPrefixAnnotated.cc.

References name_stack_.

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

101 {
102  std::ostringstream os;
103  os << "#KEY|";
104  cet::copy_all(name_stack_, std::ostream_iterator<std::string>{os, "."});
105  os << name << "|";
106  return os.str();
107 }
void PrettifierPrefixAnnotated::push_size_ ( any_t const &  a)
private

Definition at line 86 of file PrettifierPrefixAnnotated.cc.

References curr_size_, and sequence_sizes_.

Referenced by enter_sequence(), and result().

87 {
88  sequence_sizes_.emplace(boost::any_cast<ps_sequence_t>(a).size());
90 }
std::string fhicl::detail::PrettifierPrefixAnnotated::result ( void  ) const
inline

Member Data Documentation

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

Definition at line 181 of file PrettifierPrefixAnnotated.h.

Referenced by pop_size_(), PrettifierPrefixAnnotated(), and push_size_().

Indentation fhicl::detail::PrettifierPrefixAnnotated::indent_
private
std::string fhicl::detail::PrettifierPrefixAnnotated::info_
private
std::vector<name_t> fhicl::detail::PrettifierPrefixAnnotated::name_stack_
private
std::stack<std::size_t> fhicl::detail::PrettifierPrefixAnnotated::sequence_sizes_
private

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