#include <OSOptionalQuantity.hpp>
Public Member Functions | |
Constructors and Destructors | |
OSOptionalQuantity (const UnitSystem &sys=UnitSystem::Mixed) | |
OSOptionalQuantity (const Unit &units) | |
OSOptionalQuantity (const Quantity &quantity) | |
OSOptionalQuantity (const OSOptionalQuantity &oq) | |
OSOptionalQuantity & | operator= (const OSOptionalQuantity &oq) |
Getters and Queries | |
bool | empty () const |
Returns true if there is no value. More... | |
bool | isSet () const |
Returns true if there is a value. More... | |
Quantity | get () const |
Returns the corresponding Quantity. More... | |
Unit | units () const |
Returns a clone of this object's units. More... | |
OSOptionalQuantity class to be used in OpenStudio ModelObject properties.
Always contains a Unit. Optionally contains a value. The constructors and assignment operator ensure that this class behaves as "plain old data" (POD) by cloning any units information (to avoid multiple objects pointing to the exact same unit data).
|
explicit |
|
explicit |
openstudio::OSOptionalQuantity::OSOptionalQuantity | ( | const Quantity & | quantity | ) |
openstudio::OSOptionalQuantity::OSOptionalQuantity | ( | const OSOptionalQuantity & | oq | ) |
bool openstudio::OSOptionalQuantity::empty | ( | ) | const |
Returns true if there is no value.
Quantity openstudio::OSOptionalQuantity::get | ( | ) | const |
bool openstudio::OSOptionalQuantity::isSet | ( | ) | const |
Returns true if there is a value.
OSOptionalQuantity& openstudio::OSOptionalQuantity::operator= | ( | const OSOptionalQuantity & | oq | ) |
Unit openstudio::OSOptionalQuantity::units | ( | ) | const |
Returns a clone of this object's units.