BeeeOn Gateway
v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
|
Representation of physical units. More...
#include <ModuleType.h>
Public Member Functions | |
Unit (const UnitEnum::Raw &raw) | |
bool | isValid (double value) const |
std::string | symbol (bool plain=false) const |
std::string | format (double value, bool plain=false) const |
Public Member Functions inherited from BeeeOn::Enum< UnitEnum > | |
Enum (const Raw &raw) | |
Raw | raw () const |
const std::string & | toString () const |
operator Raw () const | |
bool | operator== (const Enum &other) const |
bool | operator== (const Enum::Raw &other) const |
bool | operator!= (const Enum &other) const |
bool | operator!= (const Enum::Raw &other) const |
bool | operator< (const Enum &other) const |
bool | operator< (const Enum::Raw &other) const |
bool | operator> (const Enum &other) const |
bool | operator> (const Enum::Raw &other) const |
bool | operator<= (const Enum &other) const |
bool | operator<= (const Enum::Raw &other) const |
bool | operator>= (const Enum &other) const |
bool | operator>= (const Enum::Raw &other) const |
Additional Inherited Members | |
Public Types inherited from BeeeOn::Enum< UnitEnum > | |
typedef typename UnitEnum::Raw | Raw |
typedef Enum< UnitEnum, typename UnitEnum::Raw, EnumNamesInitializer< typename UnitEnum::Raw > > | ThisEnum |
typedef EnumHelper< Raw >::ValueMap | ValueMap |
typedef EnumHelper< Raw >::Value | Value |
Static Public Member Functions inherited from BeeeOn::Enum< UnitEnum > | |
static const Iterable & | all () |
static ThisEnum | parse (const std::string &input) |
static ThisEnum | fromRaw (const Raw &raw) |
static ThisEnum | fromRaw (const unsigned int raw) |
static ThisEnum | random () |
Static Protected Member Functions inherited from BeeeOn::Enum< UnitEnum > | |
static EnumHelper< Raw >::RawMap & | rawMap () |
static const EnumHelper< Raw > ::NamesMap & | namesMap () |
Representation of physical units.
string ModuleType::Unit::format | ( | double | value, |
bool | plain = false |
||
) | const |
bool ModuleType::Unit::isValid | ( | double | value | ) | const |
string ModuleType::Unit::symbol | ( | bool | plain = false | ) | const |
Get symbol for the given unit. If plain is false, the returned value can be a Unicode code point. When plain is true, the return value is a plain ASCII.