Cantera  2.3.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members

Factory to build instances of classes that manage the standard-state thermodynamic properties of a set of species. More...

#include <VPSSMgrFactory.h>

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

Public Member Functions

void deleteFactory ()
 Delete static instance of this class. More...
 
virtual VPSSMgr_enumType VPSSMgr_StringConversion (const std::string &ssModel) const
 String conversion to an enumType. More...
 
virtual VPSSMgrnewVPSSMgr (VPSSMgr_enumType type, VPStandardStateTP *vp_ptr)
 Create a new species variable pressure standard state calculator. More...
 
virtual VPSSMgrnewVPSSMgr (VPStandardStateTP *vp_ptr, XML_Node *phaseNode_ptr, std::vector< XML_Node *> &spDataNodeList)
 Create a new species property manager for a group of species. More...
 
- Public Member Functions inherited from Factory< VPSSMgr, VPStandardStateTP *, MultiSpeciesThermo *>
VPSSMgrcreate (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< VPSSMgr *(Args...)> f)
 Register a new object construction function. More...
 
- Public Member Functions inherited from FactoryBase
virtual ~FactoryBase ()
 destructor More...
 

Static Public Member Functions

static VPSSMgrFactoryfactory ()
 Static method to return an instance of this class. 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

 VPSSMgrFactory ()
 Constructor. More...
 

Static Private Attributes

static VPSSMgrFactorys_factory = 0
 pointer to the sole instance of this class More...
 
static std::mutex vpss_species_thermo_mutex
 Decl of the static mutex variable that locks the VPSSMgr factory singleton. More...
 

Additional Inherited Members

- Protected Member Functions inherited from FactoryBase
 FactoryBase ()
 Constructor. More...
 
- Protected Attributes inherited from Factory< VPSSMgr, VPStandardStateTP *, MultiSpeciesThermo *>
std::unordered_map< std::string, std::function< VPSSMgr *(Args...)> > m_creators
 

Detailed Description

Factory to build instances of classes that manage the standard-state thermodynamic properties of a set of species.

This class is responsible for making the decision concerning which derivative of VPSSMgr object to use. The VPSSMgr object is used to calculate thermodynamic functions for the standard state. It queries the database of species to understand what the requirements are for the submodels for all of the species in the phase. Then, it picks the derived VPSSMgr object to use and passes it back to the calling routine. It doesn't load any data into the derived VPSSMgr object.

Making the choice of VPSSMgr types is the only thing this class does.

This class is implemented as a singleton – one in which only one instance is needed. The recommended way to access the factory is to call this static method, which instantiates the class if it is the first call, but otherwise simply returns the pointer to the existing instance.

Definition at line 60 of file VPSSMgrFactory.h.

Constructor & Destructor Documentation

◆ VPSSMgrFactory()

VPSSMgrFactory ( )
private

Constructor.

This is made private, so that only the static method factory() can instantiate the class.

Definition at line 184 of file VPSSMgrFactory.cpp.

Referenced by VPSSMgrFactory::factory().

Member Function Documentation

◆ factory()

static VPSSMgrFactory* factory ( )
inlinestatic

Static method to return an instance of this class.

This class is implemented as a singleton – one in which only one instance is needed. The recommended way to access the factory is to call this static method, which instantiates the class if it is the first call, but otherwise simply returns the pointer to the existing instance.

Definition at line 70 of file VPSSMgrFactory.h.

References VPSSMgrFactory::s_factory, VPSSMgrFactory::vpss_species_thermo_mutex, and VPSSMgrFactory::VPSSMgrFactory().

◆ deleteFactory()

void deleteFactory ( )
virtual

Delete static instance of this class.

If it is necessary to explicitly delete the factory before the process terminates (for example, when checking for memory leaks) then this method can be called to delete it.

Implements FactoryBase.

Definition at line 203 of file VPSSMgrFactory.cpp.

◆ VPSSMgr_StringConversion()

VPSSMgr_enumType VPSSMgr_StringConversion ( const std::string &  ssModel) const
virtual

String conversion to an enumType.

This routine is a string conversion. The string is obtained from the standardState model attribute and converted to a VPSSMgr_enumType type.

Parameters
ssModelString representing the VPSSMGr object
Deprecated:
Unused. To be removed after Cantera 2.3.

Definition at line 211 of file VPSSMgrFactory.cpp.

References Cantera::warn_deprecated().

◆ newVPSSMgr() [1/2]

VPSSMgr * newVPSSMgr ( VPSSMgr_enumType  type,
VPStandardStateTP vp_ptr 
)
virtual

Create a new species variable pressure standard state calculator.

Parameters
typeThe enumerated type of the standard state calculator
vp_ptrVariable pressure standard state ThermoPhase object that will be the owner.

Definition at line 302 of file VPSSMgrFactory.cpp.

Referenced by Cantera::newVPSSMgr().

◆ newVPSSMgr() [2/2]

VPSSMgr * newVPSSMgr ( VPStandardStateTP vp_ptr,
XML_Node phaseNode_ptr,
std::vector< XML_Node *> &  spDataNodeList 
)
virtual

Create a new species property manager for a group of species.

This routine will look through species nodes. It will discover what each species needs for its species property managers. Then, it will create and return the proper species property manager to use.

Parameters
vp_ptrVariable pressure standard state ThermoPhase object that will be the owner.
phaseNode_ptrPointer to the ThermoPhase phase XML Node
spDataNodeListVector of XML_Nodes, each of which is a species XML Node. There are m_kk of these.
Returns
a pointer to a newly created species property manager object.

Definition at line 235 of file VPSSMgrFactory.cpp.

References XML_Node::child(), Cantera::getVPSSMgrTypes(), XML_Node::hasChild(), and ThermoPhase::speciesThermo().

Member Data Documentation

◆ s_factory

VPSSMgrFactory * s_factory = 0
staticprivate

pointer to the sole instance of this class

Definition at line 125 of file VPSSMgrFactory.h.

Referenced by VPSSMgrFactory::factory().

◆ vpss_species_thermo_mutex

std::mutex vpss_species_thermo_mutex
staticprivate

Decl of the static mutex variable that locks the VPSSMgr factory singleton.

Definition at line 129 of file VPSSMgrFactory.h.

Referenced by VPSSMgrFactory::factory().


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