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

#include <PrettifierAnnotated.h>

Inheritance diagram for fhicl::detail::PrettifierAnnotated:
fhicl::ParameterSetWalker

Public Member Functions

 PrettifierAnnotated (unsigned initial_indent_level=0)
 
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 after_action (key_t 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_ ()
 

Private Attributes

std::ostringstream buffer_
 
Indentation indent_
 
std::string curr_info_
 
std::string cached_info_
 
std::stack< std::size_t > sequence_sizes_
 
std::size_t curr_size_
 

Additional Inherited Members

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

Detailed Description

Definition at line 105 of file PrettifierAnnotated.h.

Constructor & Destructor Documentation

PrettifierAnnotated::PrettifierAnnotated ( unsigned  initial_indent_level = 0)

Definition at line 12 of file PrettifierAnnotated.cc.

Member Function Documentation

void PrettifierAnnotated::after_action ( key_t const &  )
overrideprivatevirtual

Reimplemented from fhicl::ParameterSetWalker.

Definition at line 31 of file PrettifierAnnotated.cc.

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

Implements fhicl::ParameterSetWalker.

Definition at line 77 of file PrettifierAnnotated.cc.

78 {
82 }
std::string printed_suffix(std::string const &key, std::size_t const sz)
std::string print_annotated_info(std::string const &curr_info, std::string const &cached_info)
def key(type, name=None)
Definition: graph.py:13
const double a
std::string value(std::any const &)
std::string printed_prefix(std::string const &key)
std::string nl(std::size_t i=1)
void PrettifierAnnotated::before_action ( key_t const &  key,
any_t const &  ,
ParameterSet const *  ps 
)
overrideprivatevirtual

Reimplemented from fhicl::ParameterSetWalker.

Definition at line 23 of file PrettifierAnnotated.cc.

26 {
27  curr_info_ = ps->get_src_info(key);
28 }
def key(type, name=None)
Definition: graph.py:13
static constexpr double ps
Definition: Units.h:99
void PrettifierAnnotated::enter_sequence ( key_t const &  key,
any_t const &  a 
)
overrideprivatevirtual

Implements fhicl::ParameterSetWalker.

Definition at line 57 of file PrettifierAnnotated.cc.

58 {
59  push_size_(a);
62  indent_.push();
63 }
std::string print_annotated_info(std::string const &curr_info, std::string const &cached_info)
std::string printed_prefix(std::string const &key)
def key(type, name=None)
Definition: graph.py:13
const double a
std::string nl(std::size_t i=1)
void PrettifierAnnotated::enter_table ( key_t const &  key,
any_t const &   
)
overrideprivatevirtual

Implements fhicl::ParameterSetWalker.

Definition at line 39 of file PrettifierAnnotated.cc.

40 {
43  indent_.push();
44 }
std::string print_annotated_info(std::string const &curr_info, std::string const &cached_info)
std::string printed_prefix(std::string const &key)
def key(type, name=None)
Definition: graph.py:13
std::string nl(std::size_t i=1)
void PrettifierAnnotated::exit_sequence ( key_t const &  key,
any_t const &   
)
overrideprivatevirtual

Reimplemented from fhicl::ParameterSetWalker.

Definition at line 66 of file PrettifierAnnotated.cc.

67 {
68  indent_.pop();
70  << printed_suffix(key, curr_size_) << nl();
71  pop_size_();
72 }
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 PrettifierAnnotated::exit_table ( key_t const &  key,
any_t const &   
)
overrideprivatevirtual

Reimplemented from fhicl::ParameterSetWalker.

Definition at line 47 of file PrettifierAnnotated.cc.

48 {
49  indent_.pop();
51  << printed_suffix(key, curr_size_) << nl();
52 }
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 PrettifierAnnotated::pop_size_ ( )
private

Definition at line 94 of file PrettifierAnnotated.cc.

95 {
96  sequence_sizes_.pop();
98 }
std::stack< std::size_t > sequence_sizes_
void PrettifierAnnotated::push_size_ ( any_t const &  a)
private

Definition at line 87 of file PrettifierAnnotated.cc.

88 {
89  sequence_sizes_.emplace(std::any_cast<ps_sequence_t>(a).size());
91 }
std::stack< std::size_t > sequence_sizes_
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
const double a
std::string fhicl::detail::PrettifierAnnotated::result ( ) const
inline

Definition at line 110 of file PrettifierAnnotated.h.

111  {
112  return buffer_.str();
113  }

Member Data Documentation

std::ostringstream fhicl::detail::PrettifierAnnotated::buffer_
private

Definition at line 132 of file PrettifierAnnotated.h.

std::string fhicl::detail::PrettifierAnnotated::cached_info_
private

Definition at line 135 of file PrettifierAnnotated.h.

std::string fhicl::detail::PrettifierAnnotated::curr_info_
private

Definition at line 134 of file PrettifierAnnotated.h.

std::size_t fhicl::detail::PrettifierAnnotated::curr_size_
private

Definition at line 137 of file PrettifierAnnotated.h.

Indentation fhicl::detail::PrettifierAnnotated::indent_
private

Definition at line 133 of file PrettifierAnnotated.h.

std::stack<std::size_t> fhicl::detail::PrettifierAnnotated::sequence_sizes_
private

Definition at line 136 of file PrettifierAnnotated.h.


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