Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | List of all members
datatools::introspection::data_description Class Reference

Data description. More...

#include <bayeux/datatools/introspection/data_description.h>

Inheritance diagram for datatools::introspection::data_description:
datatools::i_tree_dumpable

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_infoget_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_)
 

Detailed Description

Data description.

Member Enumeration Documentation

◆ dd_xc_flags

Flags for export to a container of properties.

Enumerator
DD_XC_CLEAR 
DD_XC_TYPE 
DD_XC_LAYOUT 
DD_XC_VECTOR_FIXED_SIZE 
DD_XC_UNIT_INFO 
DD_XC_TYPE_ID 
DD_XC_DEFAULT 
DD_XC_LAST 

Constructor & Destructor Documentation

◆ data_description()

datatools::introspection::data_description::data_description ( )

Default constructor.

◆ ~data_description()

datatools::introspection::data_description::~data_description ( )

Destructor.

Member Function Documentation

◆ export_to_config()

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.

◆ get_explicit_unit_dimension_label()

const std::string& datatools::introspection::data_description::get_explicit_unit_dimension_label ( ) const

Return the real data explicit unit dimension label ("length"/"time"/"mass"...)

◆ get_implicit_unit_symbol()

const std::string& datatools::introspection::data_description::get_implicit_unit_symbol ( ) const

Return the real data implicit unit symbol.

◆ get_layout()

data_layout datatools::introspection::data_description::get_layout ( ) const

Return the data layout.

◆ get_layout_label()

std::string datatools::introspection::data_description::get_layout_label ( ) const

Return the labale associated to the data layout.

◆ get_preferred_unit_symbol()

const std::string& datatools::introspection::data_description::get_preferred_unit_symbol ( ) const

Return the (real) data preferred unit (ex: "volt", "ns", "mA"...)

◆ get_type()

data_type datatools::introspection::data_description::get_type ( ) const

Return the data type.

◆ get_type_id()

const std::string& datatools::introspection::data_description::get_type_id ( ) const

Return the type identifier (for enumeration and class)

◆ get_unit_dimension_label()

std::string datatools::introspection::data_description::get_unit_dimension_label ( ) const

Return the unit dimension label.

◆ get_unit_info()

const unit_info& datatools::introspection::data_description::get_unit_info ( ) const

Return the unit information.

◆ get_vector_fixed_size()

std::size_t datatools::introspection::data_description::get_vector_fixed_size ( ) const

Return the vector fixed size.

◆ has_explicit_unit_dimension()

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"...)

◆ has_implicit_unit()

bool datatools::introspection::data_description::has_implicit_unit ( ) const

Check if the (real) data is stored using an implicit unit (ex: "volt", "ns", "mA"...)

◆ has_layout()

bool datatools::introspection::data_description::has_layout ( ) const

Check if data layout is defined.

◆ has_preferred_unit()

bool datatools::introspection::data_description::has_preferred_unit ( ) const

Check if the (real) data has a preferred unit (ex: "volt", "ns", "mA"...)

◆ has_type()

bool datatools::introspection::data_description::has_type ( ) const

Check if data type is defined.

◆ has_type_id()

bool datatools::introspection::data_description::has_type_id ( ) const

Check if the data has a type identifier (for enumeration and class)

◆ has_unit_info()

bool datatools::introspection::data_description::has_unit_info ( ) const

Check if unit info is defined.

◆ has_unit_support()

bool datatools::introspection::data_description::has_unit_support ( ) const

Check if data description has unit support.

◆ has_vector_fixed_size()

bool datatools::introspection::data_description::has_vector_fixed_size ( ) const

Check if vector fixed size is defined.

◆ initialize() [1/2]

void datatools::introspection::data_description::initialize ( )

Initialization.

◆ initialize() [2/2]

void datatools::introspection::data_description::initialize ( const datatools::properties )

Initialization.

Example:

type : string = "real"
layout : string = "scalar"
unit.support : string = "explicit_unit_dimension"
unit.explicit_unit_dimension : string = "mass"
unit.preferred_unit : string = "kg"

◆ is_dimensionless()

bool datatools::introspection::data_description::is_dimensionless ( ) const

Check if real data is dimensionless.

◆ is_valid()

bool datatools::introspection::data_description::is_valid ( ) const

Check validity.

◆ make_fixed_size_vector()

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.

◆ make_free_size_vector()

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.

◆ make_scalar()

void datatools::introspection::data_description::make_scalar ( data_type  ,
const std::string &  info_ = "",
const std::string &  info2_ = "" 
)

Build a scalar data.

◆ native_type()

const std::type_info& datatools::introspection::data_description::native_type ( ) const

Return the native type.

◆ reset()

void datatools::introspection::data_description::reset ( )

Reset.

◆ reset_type_id()

void datatools::introspection::data_description::reset_type_id ( )

Reset the type identifier (for enumeration and class)

◆ reset_unit_info()

void datatools::introspection::data_description::reset_unit_info ( )

Reset the unit info.

◆ reset_vector_fixed_size()

void datatools::introspection::data_description::reset_vector_fixed_size ( )

Reset the vector fixed size.

◆ set_layout()

void datatools::introspection::data_description::set_layout ( data_layout  )

Set the data layout.

◆ set_type()

void datatools::introspection::data_description::set_type ( data_type  )

Set the data type.

◆ set_type_id()

void datatools::introspection::data_description::set_type_id ( const std::string &  )

Set the type identifier (for enumeration and class)

◆ set_unit_info()

void datatools::introspection::data_description::set_unit_info ( const unit_info ui_)

Set the unit information.

◆ set_vector_fixed_size()

void datatools::introspection::data_description::set_vector_fixed_size ( std::size_t  )

Set the vector fixed size.

◆ tree_dump()

virtual void datatools::introspection::data_description::tree_dump ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "",
bool  inherit_ = false 
) const
virtual

Smart print.

Reimplemented from datatools::i_tree_dumpable.


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