Cantera 2.6.0

Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
ThermoFactory Class Reference

Factory class for thermodynamic property managers. More...

`#include <ThermoFactory.h>`

Inheritance diagram for ThermoFactory:
[legend]
Collaboration diagram for ThermoFactory:
[legend]

## Public Member Functions
virtual void | deleteFactory ()
| delete the static instance of this factory More...
virtual ThermoPhase * | newThermoPhase (const std::string &model)
| Create a new thermodynamic property manager. More...
Public Member Functions inherited from Factory< ThermoPhase >
ThermoPhase * | create (const std::string &name, Args... args)
| Create an object using the object construction function corresponding to "name" and the provided constructor arguments. More...
void | reg (const std::string &name, std::function< ThermoPhase *(Args...)> f)
| Register a new object construction function. More...
void | addAlias (const std::string &original, const std::string &alias)
| Add an alias for an existing registered type. More...
std::string | canonicalize (const std::string &name)
| Get the canonical name registered for a type. More...
bool | exists (const std::string &name) const
| Returns true if `name` is registered with this factory. More...
Public Member Functions inherited from FactoryBase
virtual | ~FactoryBase ()
| destructor More...

## Static Public Member Functions
static ThermoFactory * | factory ()
| Static function that creates a static instance of the factory. More...
Static Public Member Functions inherited from FactoryBase
static void | deleteFactories ()
| static function that deletes all factories in the internal registry maintained in a static variable More...

## Private Member Functions
| ThermoFactory ()
| Private constructors prevents usage. More...

## Static Private Attributes
static ThermoFactory * | s_factory = 0
| static member of a single instance More...
static std::mutex | thermo_mutex
| Decl for locking mutex for thermo factory singleton. More...

## Additional Inherited Members
Protected Member Functions inherited from Factory< ThermoPhase >
void | addDeprecatedAlias (const std::string &original, const std::string &alias)
| Add a deprecated alias for an existing registered type. More...
Protected Member Functions inherited from FactoryBase
| FactoryBase ()
| Constructor. More...
virtual void | deleteFactory ()=0
| Virtual abstract function that deletes the factory. More...

## Detailed Description

Factory class for thermodynamic property managers.

This class keeps a list of the known ThermoPhase classes, and is used to create new instances of these classes.

Definition at line 59 of file ThermoFactory.h.

## Constructor & Destructor Documentation

## ◆ ThermoFactory()

ThermoFactory | ( |  | ) |
| private

Private constructors prevents usage.

Definition at line 50 of file ThermoFactory.cpp.

References Factory< ThermoPhase >::addAlias(), and Factory< ThermoPhase >::reg().

Referenced by ThermoFactory::factory().

## Member Function Documentation

## ◆ factory()

static ThermoFactory * factory | ( |  | ) |
| inline static

Static function that creates a static instance of the factory.

Definition at line 63 of file ThermoFactory.h.

References ThermoFactory::s_factory, ThermoFactory::thermo_mutex, and ThermoFactory::ThermoFactory().

Referenced by ThermoPhase::getParameters(), Cantera::newThermo(), and Cantera::newThermoPhase().

## ◆ deleteFactory()

virtual void deleteFactory | ( |  | ) |
| inline virtual

delete the static instance of this factory

Implements FactoryBase.

Definition at line 72 of file ThermoFactory.h.

References ThermoFactory::s_factory, and ThermoFactory::thermo_mutex.

## ◆ newThermoPhase()

ThermoPhase * newThermoPhase | ( | const std::string & | model | ) |
| virtual

Create a new thermodynamic property manager.

Parameters

  model | The name of the thermo model

Returns
  a pointer to a new ThermoPhase object of the type specified. Throws a CanteraError if the named model isn't registered with ThermoFactory.

Definition at line 109 of file ThermoFactory.cpp.

References Factory< ThermoPhase >::create().

## Member Data Documentation

## ◆ s_factory

ThermoFactory * s_factory = 0
| static private

static member of a single instance

Definition at line 88 of file ThermoFactory.h.

Referenced by ThermoFactory::deleteFactory(), and ThermoFactory::factory().

## ◆ thermo_mutex

std::mutex thermo_mutex
| static private

Decl for locking mutex for thermo factory singleton.

Definition at line 94 of file ThermoFactory.h.

Referenced by ThermoFactory::deleteFactory(), and ThermoFactory::factory().

The documentation for this class was generated from the following files:

- ThermoFactory.h
- ThermoFactory.cpp