OpenStudio:utilities
Loading...
Searching...
No Matches
openstudio::QuantityFactory 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.
 
boost::optional< QuantitycreateQuantity (const std::string &quantityString, UnitSystem system) const
 Parses quantity string to separate the value from the unit.
 
boost::optional< QuantitycreateQuantity (double value, const std::string &unitString) const
 Creates a quantity from value and unitString, which is passed to UnitFactory.
 
boost::optional< QuantitycreateQuantity (double value, const std::string &unitString, UnitSystem system) const
 Creates a quantity from value and unitString, which is passed to UnitFactory.
 
QuantityFactoryoperator= (const QuantityFactory &)=delete
 
QuantityFactoryoperator= (QuantityFactory &&)=delete
 
 QuantityFactory (const QuantityFactory &other)=delete
 
 QuantityFactory (QuantityFactory &&other)=delete
 

Static Public Member Functions

static QuantityFactoryinstance ()
 

Constructor & Destructor Documentation

◆ QuantityFactory() [1/2]

openstudio::QuantityFactory::QuantityFactory ( const QuantityFactory & other)
delete

◆ QuantityFactory() [2/2]

openstudio::QuantityFactory::QuantityFactory ( QuantityFactory && other)
delete

Member Function Documentation

◆ createQuantity() [1/4]

boost::optional< Quantity > openstudio::QuantityFactory::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.

◆ createQuantity() [2/4]

boost::optional< Quantity > openstudio::QuantityFactory::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.

◆ createQuantity() [3/4]

boost::optional< Quantity > openstudio::QuantityFactory::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.

◆ createQuantity() [4/4]

boost::optional< Quantity > openstudio::QuantityFactory::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.

◆ instance()

static QuantityFactory & openstudio::QuantityFactory::instance ( )
static

◆ operator=() [1/2]

QuantityFactory & openstudio::QuantityFactory::operator= ( const QuantityFactory & )
delete

◆ operator=() [2/2]

QuantityFactory & openstudio::QuantityFactory::operator= ( QuantityFactory && )
delete