Flow123d  jenkins-Flow123d-linux-release-multijob-282
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Input::Type::OutputBase Class Referenceabstract

Base abstract class for output description of the Input::Type tree. More...

#include <type_output.hh>

Inheritance diagram for Input::Type::OutputBase:
Inheritance graph
[legend]
Collaboration diagram for Input::Type::OutputBase:
Collaboration graph
[legend]

Classes

class  ProcessedTypes
 Internal data class. Contains flags of written Input::Types objects and functionality of regular expression filter of Input::Types full names. More...
 

Public Member Functions

virtual ostream & print (ostream &stream)
 Performs output of the documentation into given stream. The same effect has the reloaded operator '<<'. Returns reference to the same stream. More...
 
void set_filter (string regex_filter)
 Initializes and allocates regular expression filter regex_filter. More...
 

Protected Types

enum  DocumentationType { key_record, full_record }
 

Protected Member Functions

 OutputBase (const TypeBase *type, unsigned int depth=0)
 
virtual ~OutputBase ()
 Destructor. More...
 
void get_array_sizes (Array array, unsigned int &lower, unsigned int &upper)
 Gets range of array. More...
 
const string & get_record_description (const Record *rec)
 Gets description of the given record type. More...
 
void get_record_key (Record rec, unsigned int key_idx, Record::Key &key)
 Gets record key for given index. More...
 
void get_integer_bounds (Integer integer, int &lower, int &upper)
 Gets range of integer. More...
 
void get_double_bounds (Double dbl, double &lower, double &upper)
 Gets range of double. More...
 
void get_parent_ptr (Record rec, boost::shared_ptr< AbstractRecord > &parent_ptr)
 Gets pointer of parent AbstractRecord for given Record. More...
 
void get_array_type (Array array, boost::shared_ptr< const TypeBase > &arr_type)
 Gets pointer of inner type for given Array. More...
 
void get_default (Record::KeyIter it, string &type, string &value)
 Gets values of default for given record key. More...
 
const string & get_selection_description (const Selection *sel)
 Gets description of the given selection type. More...
 
const string & get_adhoc_parent_name (const AdHocAbstractRecord *a_rec)
 Gets parent_name_ of the given AdHocAbstractRecord type. More...
 
AbstractRecord::ChildDataIter get_adhoc_parent_data (const AdHocAbstractRecord *a_rec)
 Gets iterator to begin of parent_data_ of the given AdHocAbstractRecord type. More...
 
const void * get_record_data (const Record *rec)
 Gets pointer of inner data for given Record. More...
 
const void * get_abstract_record_data (const AbstractRecord *a_rec)
 Gets pointer of inner data for given AbstractRecord. More...
 
const void * get_selection_data (const Selection *sel)
 Gets pointer of inner data for given Selection. More...
 
const void * get_array_data (const Array *array)
 Gets pointer of inner data for given Array. More...
 
const void * get_type_base_data (const TypeBase *type)
 Gets pointer of inner data for given TypeBase. More...
 
void print (ostream &stream, const TypeBase *type, unsigned int depth)
 
virtual void print_impl (ostream &stream, const Record *type, unsigned int depth)=0
 
virtual void print_impl (ostream &stream, const Array *type, unsigned int depth)=0
 
virtual void print_impl (ostream &stream, const AbstractRecord *type, unsigned int depth)=0
 
virtual void print_impl (ostream &stream, const AdHocAbstractRecord *type, unsigned int depth)=0
 
virtual void print_impl (ostream &stream, const Selection *type, unsigned int depth)=0
 
virtual void print_impl (ostream &stream, const Integer *type, unsigned int depth)=0
 
virtual void print_impl (ostream &stream, const Double *type, unsigned int depth)=0
 
virtual void print_impl (ostream &stream, const Bool *type, unsigned int depth)=0
 
virtual void print_impl (ostream &stream, const String *type, unsigned int depth)=0
 
virtual void print_impl (ostream &stream, const FileName *type, unsigned int depth)=0
 
void write_description (std::ostream &stream, const string &str, unsigned int padding, unsigned int hash_count=1)
 
void write_default_value (std::ostream &stream, Default dft)
 

Protected Attributes

const TypeBasetype_
 Object for which is created printout. More...
 
unsigned int depth_
 Depth of printout (for value 0 is printed all input tree) More...
 
DocumentationType doc_type_
 Type of documentation output. More...
 
unsigned int size_setw_
 temporary value for printout of description (used in std::setw function) More...
 
std::string format_head
 
std::string format_tail
 
ProcessedTypes doc_flags_
 Stores flags and references of processed type. More...
 

Static Protected Attributes

static const unsigned int padding_size = 4
 Padding of new level of printout, used where we use indentation. More...
 

Detailed Description

Base abstract class for output description of the Input::Type tree.

Output into various formats is implemented by derived classes:

Usage example:

* cout << OutputText( &my_record, 3) << endl;
*

Definition at line 37 of file type_output.hh.

Member Enumeration Documentation

Types of documentation output.

Used in print_impl methods for basic and full printout of Input::Type

Enumerator
key_record 

Printout only basic data.

full_record 

Printout full documentation.

Definition at line 61 of file type_output.hh.

Constructor & Destructor Documentation

Input::Type::OutputBase::OutputBase ( const TypeBase type,
unsigned int  depth = 0 
)
protected

Constructor

Parameters
typeStores input sequence
depthDepth of output

Definition at line 29 of file type_output.cc.

Input::Type::OutputBase::~OutputBase ( )
protectedvirtual

Destructor.

Definition at line 25 of file type_output.cc.

Member Function Documentation

const void * Input::Type::OutputBase::get_abstract_record_data ( const AbstractRecord a_rec)
protected

Gets pointer of inner data for given AbstractRecord.

Definition at line 138 of file type_output.cc.

Here is the caller graph for this function:

AbstractRecord::ChildDataIter Input::Type::OutputBase::get_adhoc_parent_data ( const AdHocAbstractRecord a_rec)
protected

Gets iterator to begin of parent_data_ of the given AdHocAbstractRecord type.

Definition at line 127 of file type_output.cc.

Here is the caller graph for this function:

const string & Input::Type::OutputBase::get_adhoc_parent_name ( const AdHocAbstractRecord a_rec)
protected

Gets parent_name_ of the given AdHocAbstractRecord type.

Definition at line 122 of file type_output.cc.

Here is the caller graph for this function:

const void * Input::Type::OutputBase::get_array_data ( const Array array)
protected

Gets pointer of inner data for given Array.

Definition at line 147 of file type_output.cc.

Here is the caller graph for this function:

void Input::Type::OutputBase::get_array_sizes ( Array  array,
unsigned int &  lower,
unsigned int &  upper 
)
protected

Gets range of array.

Definition at line 70 of file type_output.cc.

Here is the caller graph for this function:

void Input::Type::OutputBase::get_array_type ( Array  array,
boost::shared_ptr< const TypeBase > &  arr_type 
)
protected

Gets pointer of inner type for given Array.

Definition at line 77 of file type_output.cc.

Here is the caller graph for this function:

void Input::Type::OutputBase::get_default ( Record::KeyIter  it,
string &  type,
string &  value 
)
protected

Gets values of default for given record key.

Definition at line 102 of file type_output.cc.

Here is the caller graph for this function:

void Input::Type::OutputBase::get_double_bounds ( Double  dbl,
double &  lower,
double &  upper 
)
protected

Gets range of double.

Definition at line 63 of file type_output.cc.

Here is the caller graph for this function:

void Input::Type::OutputBase::get_integer_bounds ( Integer  integer,
int &  lower,
int &  upper 
)
protected

Gets range of integer.

Definition at line 56 of file type_output.cc.

Here is the caller graph for this function:

void Input::Type::OutputBase::get_parent_ptr ( Record  rec,
boost::shared_ptr< AbstractRecord > &  parent_ptr 
)
protected

Gets pointer of parent AbstractRecord for given Record.

Definition at line 96 of file type_output.cc.

Here is the caller graph for this function:

const void * Input::Type::OutputBase::get_record_data ( const Record rec)
protected

Gets pointer of inner data for given Record.

Definition at line 134 of file type_output.cc.

Here is the caller graph for this function:

const string & Input::Type::OutputBase::get_record_description ( const Record rec)
protected

Gets description of the given record type.

Definition at line 83 of file type_output.cc.

Here is the caller graph for this function:

void Input::Type::OutputBase::get_record_key ( Record  rec,
unsigned int  key_idx,
Record::Key key 
)
protected

Gets record key for given index.

Definition at line 89 of file type_output.cc.

const void * Input::Type::OutputBase::get_selection_data ( const Selection sel)
protected

Gets pointer of inner data for given Selection.

Definition at line 142 of file type_output.cc.

Here is the caller graph for this function:

const string & Input::Type::OutputBase::get_selection_description ( const Selection sel)
protected

Gets description of the given selection type.

Definition at line 117 of file type_output.cc.

Here is the caller graph for this function:

const void * Input::Type::OutputBase::get_type_base_data ( const TypeBase type)
protected

Gets pointer of inner data for given TypeBase.

Definition at line 152 of file type_output.cc.

ostream & Input::Type::OutputBase::print ( ostream &  stream)
virtual

Performs output of the documentation into given stream. The same effect has the reloaded operator '<<'. Returns reference to the same stream.

Reimplemented in Input::Type::OutputLatex, and Input::Type::OutputJSONTemplate.

Definition at line 38 of file type_output.cc.

Here is the caller graph for this function:

void Input::Type::OutputBase::print ( ostream &  stream,
const TypeBase type,
unsigned int  depth 
)
protected

Perform resolution according to actual type (using typeid) and call particular print_impl method.

Definition at line 171 of file type_output.cc.

virtual void Input::Type::OutputBase::print_impl ( ostream &  stream,
const Record type,
unsigned int  depth 
)
protectedpure virtual

Implements printout of Record type

Implemented in Input::Type::OutputJSONMachine, Input::Type::OutputLatex, Input::Type::OutputJSONTemplate, and Input::Type::OutputText.

Here is the caller graph for this function:

virtual void Input::Type::OutputBase::print_impl ( ostream &  stream,
const Array type,
unsigned int  depth 
)
protectedpure virtual
virtual void Input::Type::OutputBase::print_impl ( ostream &  stream,
const AbstractRecord type,
unsigned int  depth 
)
protectedpure virtual
virtual void Input::Type::OutputBase::print_impl ( ostream &  stream,
const AdHocAbstractRecord type,
unsigned int  depth 
)
protectedpure virtual
virtual void Input::Type::OutputBase::print_impl ( ostream &  stream,
const Selection type,
unsigned int  depth 
)
protectedpure virtual
virtual void Input::Type::OutputBase::print_impl ( ostream &  stream,
const Integer type,
unsigned int  depth 
)
protectedpure virtual
virtual void Input::Type::OutputBase::print_impl ( ostream &  stream,
const Double type,
unsigned int  depth 
)
protectedpure virtual
virtual void Input::Type::OutputBase::print_impl ( ostream &  stream,
const Bool type,
unsigned int  depth 
)
protectedpure virtual
virtual void Input::Type::OutputBase::print_impl ( ostream &  stream,
const String type,
unsigned int  depth 
)
protectedpure virtual
virtual void Input::Type::OutputBase::print_impl ( ostream &  stream,
const FileName type,
unsigned int  depth 
)
protectedpure virtual
void Input::Type::OutputBase::set_filter ( string  regex_filter)

Initializes and allocates regular expression filter regex_filter.

Full names of Input::Type::Record objects are passed through the filter, deleting the first match of the regular expression given by regex_filter. Full Record description is performed only for the first occurrence of the filtered name, further Records with same filtered name are ignored (reported only in short descriptions of individual keys or array subtype, etc.) See ProcessedTypes for details.

Definition at line 49 of file type_output.cc.

Here is the caller graph for this function:

void Input::Type::OutputBase::write_default_value ( std::ostream &  stream,
Default  dft 
)
protected

Write value stored in dft.

Enclose value in quotes if it's needed or write info that value is optional or obligatory.

Definition at line 214 of file type_output.cc.

Here is the caller graph for this function:

void Input::Type::OutputBase::write_description ( std::ostream &  stream,
const string &  str,
unsigned int  padding,
unsigned int  hash_count = 1 
)
protected

Write out a string with given padding of every new line.

Parameters
streamOutput stream
strPrinted description
paddingNumber of spaces added from left
hash_countCount of '#' chars in description

Definition at line 222 of file type_output.cc.

Here is the caller graph for this function:

Member Data Documentation

unsigned int Input::Type::OutputBase::depth_
protected

Depth of printout (for value 0 is printed all input tree)

Definition at line 186 of file type_output.hh.

ProcessedTypes Input::Type::OutputBase::doc_flags_
protected

Stores flags and references of processed type.

Definition at line 290 of file type_output.hh.

DocumentationType Input::Type::OutputBase::doc_type_
protected

Type of documentation output.

Definition at line 188 of file type_output.hh.

std::string Input::Type::OutputBase::format_head
protected

Header of the format, printed before first call of recursive print. see print(stream) method

Definition at line 194 of file type_output.hh.

std::string Input::Type::OutputBase::format_tail
protected

Tail of the format, printed after all recursive prints are finished. see print(stream) method

Definition at line 197 of file type_output.hh.

const unsigned int Input::Type::OutputBase::padding_size = 4
staticprotected

Padding of new level of printout, used where we use indentation.

Definition at line 182 of file type_output.hh.

unsigned int Input::Type::OutputBase::size_setw_
protected

temporary value for printout of description (used in std::setw function)

Definition at line 190 of file type_output.hh.

const TypeBase* Input::Type::OutputBase::type_
protected

Object for which is created printout.

Definition at line 184 of file type_output.hh.


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