OpenStudio:utilities
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
openstudio::QuantityFactorySingleton Class Reference

#include <QuantityFactory.hpp>

Public Member Functions

boost::optional< QuantitycreateQuantity (const std::string &quantityString) const
 Parses quantity string to separate the value from the unit. More...
 
boost::optional< QuantitycreateQuantity (const std::string &quantityString, UnitSystem system) const
 Parses quantity string to separate the value from the unit. More...
 
boost::optional< QuantitycreateQuantity (double value, const std::string &unitString) const
 Creates a quantity from value and unitString, which is passed to UnitFactory. More...
 
boost::optional< QuantitycreateQuantity (double value, const std::string &unitString, UnitSystem system) const
 Creates a quantity from value and unitString, which is passed to UnitFactory. More...
 

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.