Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
Data description. More...
#include <bayeux/datatools/introspection/data_description.h>
Public Types | |
enum | dd_xc_flags { DD_XC_CLEAR = bit_mask::bit00, DD_XC_TYPE = bit_mask::bit01, DD_XC_LAYOUT = bit_mask::bit02, DD_XC_VECTOR_FIXED_SIZE = bit_mask::bit03, DD_XC_UNIT_INFO = bit_mask::bit04, DD_XC_TYPE_ID = bit_mask::bit05, DD_XC_DEFAULT, DD_XC_LAST = DD_XC_TYPE_ID } |
Flags for export to a container of properties. More... | |
Public Types inherited from datatools::i_tree_dumpable | |
enum | ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 } |
Enumeration for standard output streams. More... | |
Public Member Functions | |
data_description () | |
Default constructor. More... | |
~data_description () | |
Destructor. More... | |
bool | has_type () const |
Check if data type is defined. More... | |
data_type | get_type () const |
Return the data type. More... | |
void | set_type (data_type) |
Set the data type. More... | |
const std::type_info & | native_type () const |
Return the native type. More... | |
bool | has_layout () const |
Check if data layout is defined. More... | |
data_layout | get_layout () const |
Return the data layout. More... | |
std::string | get_layout_label () const |
Return the labale associated to the data layout. More... | |
void | set_layout (data_layout) |
Set the data layout. More... | |
bool | has_vector_fixed_size () const |
Check if vector fixed size is defined. More... | |
std::size_t | get_vector_fixed_size () const |
Return the vector fixed size. More... | |
void | set_vector_fixed_size (std::size_t) |
Set the vector fixed size. More... | |
void | reset_vector_fixed_size () |
Reset the vector fixed size. More... | |
bool | has_unit_info () const |
Check if unit info is defined. More... | |
bool | has_unit_support () const |
Check if data description has unit support. More... | |
const unit_info & | get_unit_info () const |
Return the unit information. More... | |
void | set_unit_info (const unit_info &ui_) |
Set the unit information. More... | |
void | reset_unit_info () |
Reset the unit info. More... | |
bool | is_dimensionless () const |
Check if real data is dimensionless. More... | |
bool | has_implicit_unit () const |
Check if the (real) data is stored using an implicit unit (ex: "volt", "ns", "mA"...) More... | |
const std::string & | get_implicit_unit_symbol () const |
Return the real data implicit unit symbol. More... | |
bool | has_explicit_unit_dimension () const |
Check if the (real) data is stored using an explicit unit of known dimension (ex: "length"/"time"/"mass"...) More... | |
const std::string & | get_explicit_unit_dimension_label () const |
Return the real data explicit unit dimension label ("length"/"time"/"mass"...) More... | |
bool | has_preferred_unit () const |
Check if the (real) data has a preferred unit (ex: "volt", "ns", "mA"...) More... | |
const std::string & | get_preferred_unit_symbol () const |
Return the (real) data preferred unit (ex: "volt", "ns", "mA"...) More... | |
std::string | get_unit_dimension_label () const |
Return the unit dimension label. More... | |
bool | has_type_id () const |
Check if the data has a type identifier (for enumeration and class) More... | |
const std::string & | get_type_id () const |
Return the type identifier (for enumeration and class) More... | |
void | set_type_id (const std::string &) |
Set the type identifier (for enumeration and class) More... | |
void | reset_type_id () |
Reset the type identifier (for enumeration and class) More... | |
bool | is_valid () const |
Check validity. More... | |
void | initialize () |
Initialization. More... | |
void | initialize (const datatools::properties &) |
Initialization. More... | |
void | reset () |
Reset. More... | |
void | export_to_config (datatools::properties &config_, uint32_t flags_=DD_XC_DEFAULT, const std::string &prefix_="") const |
Export to a container of properties. More... | |
virtual void | tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const |
Smart print. More... | |
void | make_scalar (data_type, const std::string &info_="", const std::string &info2_="") |
Build a scalar data. More... | |
void | make_fixed_size_vector (data_type, std::size_t size_, const std::string &info_="", const std::string &info2_="") |
Build a vector data with fixed size. More... | |
void | make_free_size_vector (data_type, const std::string &info_="", const std::string &info2_="") |
Build a vector data with free size. More... | |
Public Member Functions inherited from datatools::i_tree_dumpable | |
i_tree_dumpable () | |
Constructor. More... | |
virtual | ~i_tree_dumpable () |
Destructor. More... | |
virtual void | print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const |
Main new interface method for printing. More... | |
void | print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const |
Printing with jsonized options. More... | |
void | print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const |
Printing with jsonized options. More... | |
void | tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const |
void | tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const |
void | smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const |
Additional Inherited Members | |
Static Public Member Functions inherited from datatools::i_tree_dumpable | |
static const boost::property_tree::ptree & | empty_options () |
static boost::property_tree::ptree | make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false) |
static std::ostream & | last_skip_tag (std::ostream &out_) |
static std::ostream & | skip_tag (std::ostream &out_) |
static std::ostream & | last_tag (std::ostream &out_) |
static std::ostream & | tag (std::ostream &out_) |
Data description.
datatools::introspection::data_description::data_description | ( | ) |
Default constructor.
datatools::introspection::data_description::~data_description | ( | ) |
Destructor.
void datatools::introspection::data_description::export_to_config | ( | datatools::properties & | config_, |
uint32_t | flags_ = DD_XC_DEFAULT , |
||
const std::string & | prefix_ = "" |
||
) | const |
Export to a container of properties.
const std::string& datatools::introspection::data_description::get_explicit_unit_dimension_label | ( | ) | const |
Return the real data explicit unit dimension label ("length"/"time"/"mass"...)
const std::string& datatools::introspection::data_description::get_implicit_unit_symbol | ( | ) | const |
Return the real data implicit unit symbol.
data_layout datatools::introspection::data_description::get_layout | ( | ) | const |
Return the data layout.
std::string datatools::introspection::data_description::get_layout_label | ( | ) | const |
Return the labale associated to the data layout.
const std::string& datatools::introspection::data_description::get_preferred_unit_symbol | ( | ) | const |
Return the (real) data preferred unit (ex: "volt", "ns", "mA"...)
data_type datatools::introspection::data_description::get_type | ( | ) | const |
Return the data type.
const std::string& datatools::introspection::data_description::get_type_id | ( | ) | const |
Return the type identifier (for enumeration and class)
std::string datatools::introspection::data_description::get_unit_dimension_label | ( | ) | const |
Return the unit dimension label.
Return the unit information.
std::size_t datatools::introspection::data_description::get_vector_fixed_size | ( | ) | const |
Return the vector fixed size.
bool datatools::introspection::data_description::has_explicit_unit_dimension | ( | ) | const |
Check if the (real) data is stored using an explicit unit of known dimension (ex: "length"/"time"/"mass"...)
bool datatools::introspection::data_description::has_implicit_unit | ( | ) | const |
Check if the (real) data is stored using an implicit unit (ex: "volt", "ns", "mA"...)
bool datatools::introspection::data_description::has_layout | ( | ) | const |
Check if data layout is defined.
bool datatools::introspection::data_description::has_preferred_unit | ( | ) | const |
Check if the (real) data has a preferred unit (ex: "volt", "ns", "mA"...)
bool datatools::introspection::data_description::has_type | ( | ) | const |
Check if data type is defined.
bool datatools::introspection::data_description::has_type_id | ( | ) | const |
Check if the data has a type identifier (for enumeration and class)
bool datatools::introspection::data_description::has_unit_info | ( | ) | const |
Check if unit info is defined.
bool datatools::introspection::data_description::has_unit_support | ( | ) | const |
Check if data description has unit support.
bool datatools::introspection::data_description::has_vector_fixed_size | ( | ) | const |
Check if vector fixed size is defined.
void datatools::introspection::data_description::initialize | ( | ) |
Initialization.
void datatools::introspection::data_description::initialize | ( | const datatools::properties & | ) |
Initialization.
Example:
bool datatools::introspection::data_description::is_dimensionless | ( | ) | const |
Check if real data is dimensionless.
bool datatools::introspection::data_description::is_valid | ( | ) | const |
Check validity.
void datatools::introspection::data_description::make_fixed_size_vector | ( | data_type | , |
std::size_t | size_, | ||
const std::string & | info_ = "" , |
||
const std::string & | info2_ = "" |
||
) |
Build a vector data with fixed size.
void datatools::introspection::data_description::make_free_size_vector | ( | data_type | , |
const std::string & | info_ = "" , |
||
const std::string & | info2_ = "" |
||
) |
Build a vector data with free size.
void datatools::introspection::data_description::make_scalar | ( | data_type | , |
const std::string & | info_ = "" , |
||
const std::string & | info2_ = "" |
||
) |
Build a scalar data.
const std::type_info& datatools::introspection::data_description::native_type | ( | ) | const |
Return the native type.
void datatools::introspection::data_description::reset | ( | ) |
Reset.
void datatools::introspection::data_description::reset_type_id | ( | ) |
Reset the type identifier (for enumeration and class)
void datatools::introspection::data_description::reset_unit_info | ( | ) |
Reset the unit info.
void datatools::introspection::data_description::reset_vector_fixed_size | ( | ) |
Reset the vector fixed size.
void datatools::introspection::data_description::set_layout | ( | data_layout | ) |
Set the data layout.
void datatools::introspection::data_description::set_type | ( | data_type | ) |
Set the data type.
void datatools::introspection::data_description::set_type_id | ( | const std::string & | ) |
Set the type identifier (for enumeration and class)
Set the unit information.
void datatools::introspection::data_description::set_vector_fixed_size | ( | std::size_t | ) |
Set the vector fixed size.
|
virtual |
Smart print.
Reimplemented from datatools::i_tree_dumpable.