OpenStudio:utilities
Loading...
Searching...
No Matches
openstudio::ScaleFactory Class Reference

#include <ScaleFactory.hpp>

Public Member Functions

ScaleConstant createScale (const std::string &abbr) const
 Creates a scale from an abbreviation.
 
ScaleConstant createScale (int exponent) const
 Creates a scale from an exponent.
 
ScaleFactoryoperator= (const ScaleFactory &)=delete
 
ScaleFactoryoperator= (ScaleFactory &&)=delete
 
std::vector< ScaleregisteredScales ()
 Returns a vector of Scale objects, one for each scale registered in the factory.
 
bool registerScale (ScaleConstant scale)
 Store a scale callback function for future lookup using the scale exponent or abbreviation.
 
 ScaleFactory (const ScaleFactory &other)=delete
 
 ScaleFactory (ScaleFactory &&other)=delete
 

Static Public Member Functions

static ScaleFactoryinstance ()
 

Detailed Description

Singleton that creates scales based on std::string or exponent.

Access using ScaleFactory::instance().

Constructor & Destructor Documentation

◆ ScaleFactory() [1/2]

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

◆ ScaleFactory() [2/2]

openstudio::ScaleFactory::ScaleFactory ( ScaleFactory && other)
delete

Member Function Documentation

◆ createScale() [1/2]

ScaleConstant openstudio::ScaleFactory::createScale ( const std::string & abbr) const

Creates a scale from an abbreviation.

Throws if the factory does not have any scales registered. Returns ScaleConstant with ().value == 0.0 if abbr not in factory.

◆ createScale() [2/2]

ScaleConstant openstudio::ScaleFactory::createScale ( int exponent) const

Creates a scale from an exponent.

Throws if the factory does not have any scales registered. Returns ScaleConstant with ().value == 0.0 if exponent not in factory.

◆ instance()

static ScaleFactory & openstudio::ScaleFactory::instance ( )
static

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ registeredScales()

std::vector< Scale > openstudio::ScaleFactory::registeredScales ( )

Returns a vector of Scale objects, one for each scale registered in the factory.

◆ registerScale()

bool openstudio::ScaleFactory::registerScale ( ScaleConstant scale)

Store a scale callback function for future lookup using the scale exponent or abbreviation.

By default, SI scales are registered during factory construction.