Cantera  3.0.0
Loading...
Searching...
No Matches
ThermoFactory Class Reference

Factory class for thermodynamic property managers. More...

#include <ThermoFactory.h>

Inheritance diagram for ThermoFactory:
[legend]

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 30 of file ThermoFactory.h.

Public Member Functions

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

Static Public Member Functions

static ThermoFactoryfactory ()
 Static function that creates a static instance of the factory.
 
- 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
 

Private Member Functions

 ThermoFactory ()
 Private constructors prevents usage.
 

Static Private Attributes

static ThermoFactorys_factory = 0
 static member of a single instance
 
static std::mutex thermo_mutex
 Decl for locking mutex for thermo factory singleton.
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ ThermoFactory()

ThermoFactory ( )
private

Private constructors prevents usage.

Definition at line 51 of file ThermoFactory.cpp.

Member Function Documentation

◆ factory()

ThermoFactory * factory ( )
static

Static function that creates a static instance of the factory.

Definition at line 111 of file ThermoFactory.cpp.

◆ deleteFactory()

void deleteFactory ( )
overridevirtual

delete the static instance of this factory

Implements FactoryBase.

Definition at line 120 of file ThermoFactory.cpp.

◆ newThermoPhase()

ThermoPhase * newThermoPhase ( const string &  model)

Create a new thermodynamic property manager.

Parameters
modelThe 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.
Deprecated:
To be removed after Cantera 3.0; superseded by newThermo()

Definition at line 127 of file ThermoFactory.cpp.

Member Data Documentation

◆ s_factory

ThermoFactory * s_factory = 0
staticprivate

static member of a single instance

Definition at line 50 of file ThermoFactory.h.

◆ thermo_mutex

std::mutex thermo_mutex
staticprivate

Decl for locking mutex for thermo factory singleton.

Definition at line 56 of file ThermoFactory.h.


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