Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
The description of an unit dimension. More...
#include <bayeux/datatools/units.h>
Public Types | |
enum | base_dimension_type { BD_INVALID = 0, BD_MASS = 1, BD_LENGTH = 2, BD_TIME = 3, BD_ELECTRIC_CURRENT = 4, BD_TEMPERATURE = 5, BD_ABSOLUTE_TEMPERATURE = 5, BD_AMOUNT = 6, BD_AMOUNT_OF_SUBSTANCE = 6, BD_LUMINOUS_INTENSITY = 7, BD_PROCEDURE_DEFINED = 8, BD_LAST = BD_PROCEDURE_DEFINED + 1 } |
Base dimension index. 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 | |
unit_dimension () | |
Default constructor. More... | |
unit_dimension (const std::string &label_, const std::string &default_unit_symbol_) | |
Default constructor. More... | |
virtual | ~unit_dimension () |
Destructor. More... | |
bool | is_valid () const |
Check validity. More... | |
void | reset () |
Reset. More... | |
bool | has_label () const |
Check the label. More... | |
unit_dimension & | set_label (const std::string &) |
Set the label of the unit dimension. More... | |
const std::string & | get_label () const |
Return the label of the unit dimension. More... | |
bool | has_unit (const std::string &unit_name_) const |
Check if a unit is known by name. More... | |
unit_dimension & | add_unit (const std::string &unit_name_, bool default_unit_=false) |
Add an unit by name. More... | |
void | remove_unit (const std::string &unit_name_) |
Remove an unit by name. More... | |
const std::set< std::string > & | get_unit_names () const |
Return the set of unit names. More... | |
bool | has_default_unit () const |
Check if a default unit is defined. More... | |
unit_dimension & | set_default_unit_name (const std::string &unit_name_) |
Set the name of the default unit. More... | |
const std::string & | get_default_unit_name () const |
Return the name of the default unit. More... | |
bool | has_dimensional_powers () const |
Check if the dimensional analysis information is available. More... | |
void | reset_dimensional_powers () |
Reset the the dimensional analysis information. More... | |
bool | decode_dimensional_powers (const std::string &word_) |
Decode and set the dimensional powers from a character string. More... | |
void | encode_dimensional_powers (std::string &word_) const |
Encode the set of dimensional powers. More... | |
bool | is_dimensionless () const |
Check if unit dimension is dimensionless. More... | |
bool | match_dimensional_powers (const unit_dimension &ud_) const |
Check if the dimensional powers match another unit dimension. 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... | |
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 |
Static Public Member Functions | |
static std::string | base_dimension_to_symbol (base_dimension_type) |
static base_dimension_type | symbol_to_base_dimension (const std::string &) |
static std::string | base_dimension_to_label (base_dimension_type) |
static base_dimension_type | label_to_base_dimension (const std::string &) |
static bool | validate_dimension_label (const std::string &name_) |
Validate a unit dimension label. More... | |
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_) |
Protected Member Functions | |
void | _set_default () |
Set default attributes. More... | |
The description of an unit dimension.
datatools::units::unit_dimension::unit_dimension | ( | ) |
Default constructor.
datatools::units::unit_dimension::unit_dimension | ( | const std::string & | label_, |
const std::string & | default_unit_symbol_ | ||
) |
Default constructor.
|
virtual |
Destructor.
|
protected |
Set default attributes.
unit_dimension& datatools::units::unit_dimension::add_unit | ( | const std::string & | unit_name_, |
bool | default_unit_ = false |
||
) |
Add an unit by name.
|
static |
|
static |
bool datatools::units::unit_dimension::decode_dimensional_powers | ( | const std::string & | word_ | ) |
Decode and set the dimensional powers from a character string.
void datatools::units::unit_dimension::encode_dimensional_powers | ( | std::string & | word_ | ) | const |
Encode the set of dimensional powers.
const std::string& datatools::units::unit_dimension::get_default_unit_name | ( | ) | const |
Return the name of the default unit.
const std::string& datatools::units::unit_dimension::get_label | ( | ) | const |
Return the label of the unit dimension.
const std::set<std::string>& datatools::units::unit_dimension::get_unit_names | ( | ) | const |
Return the set of unit names.
bool datatools::units::unit_dimension::has_default_unit | ( | ) | const |
Check if a default unit is defined.
bool datatools::units::unit_dimension::has_dimensional_powers | ( | ) | const |
Check if the dimensional analysis information is available.
bool datatools::units::unit_dimension::has_label | ( | ) | const |
Check the label.
bool datatools::units::unit_dimension::has_unit | ( | const std::string & | unit_name_ | ) | const |
Check if a unit is known by name.
bool datatools::units::unit_dimension::is_dimensionless | ( | ) | const |
Check if unit dimension is dimensionless.
bool datatools::units::unit_dimension::is_valid | ( | ) | const |
Check validity.
|
static |
bool datatools::units::unit_dimension::match_dimensional_powers | ( | const unit_dimension & | ud_ | ) | const |
Check if the dimensional powers match another unit dimension.
void datatools::units::unit_dimension::remove_unit | ( | const std::string & | unit_name_ | ) |
Remove an unit by name.
void datatools::units::unit_dimension::reset | ( | ) |
Reset.
void datatools::units::unit_dimension::reset_dimensional_powers | ( | ) |
Reset the the dimensional analysis information.
unit_dimension& datatools::units::unit_dimension::set_default_unit_name | ( | const std::string & | unit_name_ | ) |
Set the name of the default unit.
unit_dimension& datatools::units::unit_dimension::set_label | ( | const std::string & | ) |
Set the label of the unit dimension.
|
static |
|
virtual |
Smart print.
Reimplemented from datatools::i_tree_dumpable.
|
static |
Validate a unit dimension label.