scifir-units 2.0.0
scifir-units is a library of units of measurement, angles, coordinates, fields, and related data, all lightweight, that help in the development of scientific software and scientific machines
|
Class that represents prefixes of the SI system of units. Each prefix sizes 1 byte. The prefix micro is added to a dimension with the symbol µ. More...
#include <prefix.hpp>
Public Types | |
enum | type : int8_t { NONE , QUETTA , RONNA , YOTTA , ZETTA , EXA , PETA , TERA , GIGA , MEGA , KILO , HECTO , DECA , DECI , CENTI , MILLI , MICRO , NANO , PICO , FEMTO , ATTO , ZEPTO , YOCTO , RONTO , QUECTO } |
Represents a prefix of the SI system of units. All the prefixes of the SI system of units are supported. More... | |
Public Member Functions | |
prefix () | |
Default constructor. The prefix_type is set to NONE. | |
prefix (const prefix &x) | |
Copy constructor. The prefix_type is copied from the prefix x. | |
prefix (prefix &&x) | |
Move constructor. The prefix_type is moved from the prefix x. | |
prefix (prefix::type new_type) | |
Constructor. The prefix_type is set to the new_type given. | |
prefix (const string &new_type) | |
Constructor. The prefix_type is set to the new_type specified in the string. | |
prefix & | operator= (const prefix &x) |
Copy assignment. The prefix_type is copied from the prefix x. | |
prefix & | operator= (prefix &&x) |
Move assignment. The prefix_type is moved from the prefix x. | |
int | get_conversion_factor () const |
Returns the conversion factor of the prefix given the prefix_type. It uses the SI system of units for the value of each conversion factor. | |
string | get_name () const |
Name of the prefix given the prefix_type. | |
string | get_symbol () const |
Symbol of the prefix given the prefix_type. The symbol of micro is supported in his Unicode version. | |
bool | operator< (const scifir::prefix &x) const |
This operator allows to order the prefixes from the lower to the greather. | |
Public Attributes | |
prefix::type | prefix_type |
It stores the prefix type currently being used. | |
Class that represents prefixes of the SI system of units. Each prefix sizes 1 byte. The prefix micro is added to a dimension with the symbol µ.
Definition at line 13 of file prefix.hpp.
Represents a prefix of the SI system of units. All the prefixes of the SI system of units are supported.
Definition at line 16 of file prefix.hpp.
prefix::prefix | ( | ) |
Default constructor. The prefix_type is set to NONE.
Definition at line 9 of file prefix.cpp.
Copy constructor. The prefix_type is copied from the prefix x.
Definition at line 12 of file prefix.cpp.
prefix::prefix | ( | prefix && | x | ) |
Move constructor. The prefix_type is moved from the prefix x.
Definition at line 15 of file prefix.cpp.
|
explicit |
Constructor. The prefix_type is set to the new_type given.
Definition at line 18 of file prefix.cpp.
Constructor. The prefix_type is set to the new_type specified in the string.
Definition at line 21 of file prefix.cpp.
int prefix::get_conversion_factor | ( | ) | const |
Returns the conversion factor of the prefix given the prefix_type. It uses the SI system of units for the value of each conversion factor.
Definition at line 36 of file prefix.cpp.
string prefix::get_name | ( | ) | const |
Name of the prefix given the prefix_type.
Definition at line 94 of file prefix.cpp.
string prefix::get_symbol | ( | ) | const |
Symbol of the prefix given the prefix_type. The symbol of micro is supported in his Unicode version.
Definition at line 152 of file prefix.cpp.
bool prefix::operator< | ( | const scifir::prefix & | x | ) | const |
This operator allows to order the prefixes from the lower to the greather.
Definition at line 210 of file prefix.cpp.
Copy assignment. The prefix_type is copied from the prefix x.
Definition at line 24 of file prefix.cpp.
Move assignment. The prefix_type is moved from the prefix x.
Definition at line 30 of file prefix.cpp.
prefix::prefix_type |
It stores the prefix type currently being used.
Definition at line 33 of file prefix.hpp.