Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
fhicl::detail::PrettifierPrefixAnnotated Class Reference

#include <PrettifierPrefixAnnotated.h>

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

Public Types

using name_t = std::string
 
- Public Types inherited from fhicl::ParameterSetWalker
using key_t = std::string
 
using any_t = std::any
 

Public Member Functions

std::string result () const
 
- Public Member Functions inherited from fhicl::ParameterSetWalker
virtual ~ParameterSetWalker () noexcept=default
 
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

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.

66 {
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)
def key(type, name=None)
Definition: graph.py:13
const double a
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.

16 {
17  info_ = ps->get_src_info(key);
18 }
def key(type, name=None)
Definition: graph.py:13
static constexpr double ps
Definition: Units.h:99
void PrettifierPrefixAnnotated::enter_sequence ( key_t const &  key,
any_t const &  a 
)
overrideprivatevirtual

Implements fhicl::ParameterSetWalker.

Definition at line 43 of file PrettifierPrefixAnnotated.cc.

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)
def key(type, name=None)
Definition: graph.py:13
const double a
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.

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)
def key(type, name=None)
Definition: graph.py:13
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

Reimplemented from fhicl::ParameterSetWalker.

Definition at line 53 of file PrettifierPrefixAnnotated.cc.

55 {
56  indent_.pop();
58  << printed_suffix(key, sequence_sizes_.top()) << nl();
59  pop_size_();
60 }
std::string printed_suffix(std::string const &key, std::size_t const sz)
def key(type, name=None)
Definition: graph.py:13
std::string nl(std::size_t i=1)
void PrettifierPrefixAnnotated::exit_table ( key_t const &  key,
any_t const &   
)
overrideprivatevirtual

Reimplemented from fhicl::ParameterSetWalker.

Definition at line 32 of file PrettifierPrefixAnnotated.cc.

33 {
34  name_stack_.pop_back();
35  indent_.pop();
37  << printed_suffix(key, sequence_sizes_.top()) << nl();
38 }
std::string printed_suffix(std::string const &key, std::size_t const sz)
def key(type, name=None)
Definition: graph.py:13
std::string nl(std::size_t i=1)
std::string closing_brace()
void PrettifierPrefixAnnotated::pop_size_ ( )
private
std::string PrettifierPrefixAnnotated::print_full_key_ ( name_t const &  k) const
private

Definition at line 89 of file PrettifierPrefixAnnotated.cc.

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 }
static QCString name
Definition: declinfo.cpp:673
auto copy_all(FwdCont &, FwdIter)
void PrettifierPrefixAnnotated::push_size_ ( any_t const &  a)
private

Definition at line 75 of file PrettifierPrefixAnnotated.cc.

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:92
const double a
std::string fhicl::detail::PrettifierPrefixAnnotated::result ( ) const
inline

Definition at line 151 of file PrettifierPrefixAnnotated.h.

152  {
153  return buffer_.str();
154  }

Member Data Documentation

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

Definition at line 173 of file PrettifierPrefixAnnotated.h.

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

Definition at line 177 of file PrettifierPrefixAnnotated.h.

Indentation fhicl::detail::PrettifierPrefixAnnotated::indent_ {}
private

Definition at line 174 of file PrettifierPrefixAnnotated.h.

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

Definition at line 175 of file PrettifierPrefixAnnotated.h.

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

Definition at line 178 of file PrettifierPrefixAnnotated.h.

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

Definition at line 176 of file PrettifierPrefixAnnotated.h.


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