Flow123d
release_3.0.0-968-gc359144
|
Base abstract class for output description of the Input::Type tree. More...
#include <type_output.hh>
Public Member Functions | |
virtual ostream & | print (ostream &stream)=0 |
Performs output of the documentation into given stream . More... | |
Protected Types | |
enum | DocumentationType { key_record, full_record } |
Types of documentation output. More... | |
Protected Member Functions | |
OutputBase () | |
Constructor. More... | |
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... | |
const string & | get_abstract_description (const Abstract *a_rec) |
Gets description of the given abstract type. 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_vec (Record rec, std::vector< std::shared_ptr< Abstract > > &parent_vec) |
Gets pointer of parent Abstract for given Record. More... | |
void | get_array_type (Array array, std::shared_ptr< 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... | |
void | get_adhoc_parent_name (const AdHocAbstract *a_rec, string &parent_name) |
Gets ancestor_.type_name of the given AdHocAbstract type. More... | |
Abstract::ChildDataIter | get_adhoc_parent_data (const AdHocAbstract *a_rec) |
Gets iterator to begin of ancestor_.child_data_ of the given AdHocAbstract type. More... | |
void | get_attr_and_param_data (const TypeBase *type, TypeBase::attribute_map &attr_map, TypeBase::TypeHash &generic_type_hash, TypeBase::json_string ¶meter_map_to_json) |
Gets data of attributes and parameters of the given type. More... | |
template<class T > | |
void | print_generic (ostream &stream, const TypeBase *type) |
void | print_base (ostream &stream, const TypeBase *type) |
Perform resolution according to actual type (using typeid) and call particular print_impl method. More... | |
virtual void | print_impl (ostream &stream, const Record *type)=0 |
Implements printout of Record type . More... | |
virtual void | print_impl (ostream &stream, const Array *type)=0 |
Implements printout of Array type . More... | |
virtual void | print_impl (ostream &stream, const Abstract *type)=0 |
Implements printout of Abstract type . More... | |
virtual void | print_impl (ostream &stream, const AdHocAbstract *type)=0 |
Implements printout of AdHocAbstract type . More... | |
virtual void | print_impl (ostream &stream, const Selection *type)=0 |
Implements printout of Selection type . More... | |
virtual void | print_impl (ostream &stream, const Integer *type)=0 |
Implements printout of Integer type . More... | |
virtual void | print_impl (ostream &stream, const Double *type)=0 |
Implements printout of Double type . More... | |
virtual void | print_impl (ostream &stream, const Bool *type)=0 |
Implements printout of Bool type . More... | |
virtual void | print_impl (ostream &stream, const String *type)=0 |
Implements printout of String type . More... | |
virtual void | print_impl (ostream &stream, const FileName *type)=0 |
Implements printout of FileName type . More... | |
virtual void | print_impl (ostream &stream, const Parameter *type)=0 |
Implements printout of FileName type . More... | |
void | write_description (std::ostream &stream, const string &str, unsigned int padding, unsigned int hash_count=1) |
Write out a string with given padding of every new line. More... | |
void | write_default_value (std::ostream &stream, Default dft) |
Write value stored in dft . More... | |
void | clear_processed_types () |
Clear all data of processed types. More... | |
bool | was_written (std::size_t hash) |
Returns true if the type was printed out. More... | |
Protected Attributes | |
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::set< std::size_t > | processed_types_hash_ |
Set of hashes of outputed types. Should replace keys. More... | |
TypeBase::TypeHash | full_hash_ |
Content hash of full IST, value is used for key IST_hash. More... | |
Static Protected Attributes | |
static const unsigned int | padding_size = 4 |
Padding of new level of printout, used where we use indentation. More... | |
Base abstract class for output description of the Input::Type tree.
Output into various formats is implemented by derived classes:
Usage example:
Definition at line 65 of file type_output.hh.
|
protected |
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 82 of file type_output.hh.
|
protected |
Constructor.
Definition at line 53 of file type_output.cc.
|
protectedvirtual |
Destructor.
Definition at line 49 of file type_output.cc.
|
protected |
Clear all data of processed types.
Definition at line 218 of file type_output.cc.
|
protected |
Gets description of the given abstract type.
Definition at line 91 of file type_output.cc.
|
protected |
Gets iterator to begin of ancestor_.child_data_ of the given AdHocAbstract type.
Definition at line 128 of file type_output.cc.
|
protected |
Gets ancestor_.type_name of the given AdHocAbstract type.
Definition at line 123 of file type_output.cc.
|
protected |
Gets range of array.
Definition at line 72 of file type_output.cc.
|
protected |
Gets pointer of inner type for given Array.
Definition at line 79 of file type_output.cc.
|
protected |
Gets data of attributes and parameters of the given type.
Definition at line 231 of file type_output.cc.
|
protected |
Gets values of default for given record key.
Definition at line 103 of file type_output.cc.
|
protected |
Gets range of double.
Definition at line 65 of file type_output.cc.
|
protected |
Gets range of integer.
Definition at line 58 of file type_output.cc.
|
protected |
Gets pointer of parent Abstract for given Record.
Definition at line 97 of file type_output.cc.
|
protected |
Gets description of the given record type.
Definition at line 85 of file type_output.cc.
|
protected |
Gets description of the given selection type.
Definition at line 118 of file type_output.cc.
|
pure virtual |
Performs output of the documentation into given stream
.
The same effect has the reloaded operator '<<'. Returns reference to the same stream.
Implemented in Input::Type::OutputJSONMachine, and Input::Type::OutputText.
|
protected |
Perform resolution according to actual type
(using typeid) and call particular print_impl method.
Definition at line 141 of file type_output.cc.
|
protected |
Definition at line 133 of file type_output.cc.
|
protectedpure virtual |
Implements printout of Record type
.
Implemented in Input::Type::OutputJSONMachine, and Input::Type::OutputText.
|
protectedpure virtual |
Implements printout of Array type
.
Implemented in Input::Type::OutputJSONMachine, and Input::Type::OutputText.
|
protectedpure virtual |
Implements printout of Abstract type
.
Implemented in Input::Type::OutputJSONMachine, and Input::Type::OutputText.
|
protectedpure virtual |
Implements printout of AdHocAbstract type
.
Implemented in Input::Type::OutputJSONMachine, and Input::Type::OutputText.
|
protectedpure virtual |
Implements printout of Selection type
.
Implemented in Input::Type::OutputJSONMachine, and Input::Type::OutputText.
|
protectedpure virtual |
Implements printout of Integer type
.
Implemented in Input::Type::OutputJSONMachine, and Input::Type::OutputText.
|
protectedpure virtual |
Implements printout of Double type
.
Implemented in Input::Type::OutputJSONMachine, and Input::Type::OutputText.
|
protectedpure virtual |
Implements printout of Bool type
.
Implemented in Input::Type::OutputJSONMachine, and Input::Type::OutputText.
|
protectedpure virtual |
Implements printout of String type
.
Implemented in Input::Type::OutputJSONMachine, and Input::Type::OutputText.
|
protectedpure virtual |
Implements printout of FileName type
.
Implemented in Input::Type::OutputJSONMachine, and Input::Type::OutputText.
|
protectedpure virtual |
Implements printout of FileName type
.
Implemented in Input::Type::OutputJSONMachine, and Input::Type::OutputText.
|
protected |
Returns true if the type was printed out.
Checks if the processed_types_hash_
contains hash of given type.
Definition at line 224 of file type_output.cc.
|
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 193 of file type_output.cc.
|
protected |
Write out a string with given padding of every new line.
stream | Output stream |
str | Printed description |
padding | Number of spaces added from left |
hash_count | Count of '#' chars in description |
Definition at line 201 of file type_output.cc.
|
protected |
Type of documentation output.
Definition at line 182 of file type_output.hh.
|
protected |
Content hash of full IST, value is used for key IST_hash.
Definition at line 189 of file type_output.hh.
|
staticprotected |
Padding of new level of printout, used where we use indentation.
Definition at line 180 of file type_output.hh.
|
protected |
Set of hashes of outputed types. Should replace keys.
Definition at line 187 of file type_output.hh.
|
protected |
temporary value for printout of description (used in std::setw function)
Definition at line 184 of file type_output.hh.