OpenStudio:utilities
 AllClasses Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages

#include "QuantityFactory.hpp"

Public Member Functions

boost::optional< QuantitycreateQuantity (const std::string &quantityString) const
boost::optional< QuantitycreateQuantity (const std::string &quantityString, UnitSystem system) const
boost::optional< QuantitycreateQuantity (double value, const std::string &unitString) const
boost::optional< QuantitycreateQuantity (double value, const std::string &unitString, UnitSystem system) const

Member Function Documentation

boost::optional<Quantity> openstudio::QuantityFactorySingleton::createQuantity ( const std::string &  quantityString) const

Parses quantity string to separate the value from the unit.

Then creates the quantity with the help of UnitFactory. Uses openstudio::getSystem to intuit the appropriate system, if possible.

boost::optional<Quantity> openstudio::QuantityFactorySingleton::createQuantity ( const std::string &  quantityString,
UnitSystem  system 
) const

Parses quantity string to separate the value from the unit.

Then creates the quantity with the help of UnitFactory. system specifies the preferred unit system–it does not guarantee that the returned result will be in that system.

boost::optional<Quantity> openstudio::QuantityFactorySingleton::createQuantity ( double  value,
const std::string &  unitString 
) const

Creates a quantity from value and unitString, which is passed to UnitFactory.

Uses openstudio::getSystem to intuit the appropriate system, if possible.

boost::optional<Quantity> openstudio::QuantityFactorySingleton::createQuantity ( double  value,
const std::string &  unitString,
UnitSystem  system 
) const

Creates a quantity from value and unitString, which is passed to UnitFactory.

system specifies the preferred unit system–it does not guarantee that the returned result will be in that system.