Factory class for creating new instances of classes derived from Transport. More...
#include <TransportFactory.h>
Factory class for creating new instances of classes derived from Transport.
Creates 'transport managers', which are classes derived from class Transport that provide transport properties. TransportFactory handles all initialization required, including evaluation of collision integrals and generating polynomial fits. Transport managers can also be created in other ways.
Definition at line 30 of file TransportFactory.h.
Public Member Functions | |
void | deleteFactory () override |
Deletes the statically allocated factory instance. | |
Transport * | newTransport (const string &model, ThermoPhase *thermo, int log_level=-7) |
Build a new transport manager using a transport manager that may not be the same as in the phase description and return a base class pointer to it. | |
Transport * | newTransport (ThermoPhase *thermo, int log_level=-7) |
Build a new transport manager using the default transport manager in the phase description and return a base class pointer to it. | |
Public Member Functions inherited from Factory< Transport > | |
Transport * | create (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< Transport *(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 TransportFactory * | factory () |
Return a pointer to a TransportFactory instance. | |
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 | |
TransportFactory () | |
The constructor is private; use static method factory() to get a pointer to a factory instance. | |
Private Attributes | |
map< string, bool > | m_CK_mode |
Models included in this map are initialized in CK compatibility mode. | |
Static Private Attributes | |
static TransportFactory * | s_factory = 0 |
Static instance of the factor -> This is the only instance of this object allowed. | |
static std::mutex | transport_mutex |
Static instance of the mutex used to ensure the proper reading of the transport database. | |
Additional Inherited Members | |
Protected Member Functions inherited from Factory< Transport > | |
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. | |
|
private |
The constructor is private; use static method factory() to get a pointer to a factory instance.
The default constructor for this class sets up m_models[], a mapping between the string name for a transport model and the integer name.
Definition at line 27 of file TransportFactory.cpp.
|
static |
Return a pointer to a TransportFactory instance.
TransportFactory is implemented as a 'singleton', which means that at most one instance may be created. The constructor is private. When a TransportFactory instance is required, call static method factory() to return a pointer to the TransportFactory instance.
Definition at line 53 of file TransportFactory.cpp.
|
overridevirtual |
Deletes the statically allocated factory instance.
Implements FactoryBase.
Definition at line 61 of file TransportFactory.cpp.
Transport * newTransport | ( | const string & | model, |
ThermoPhase * | thermo, | ||
int | log_level = -7 |
||
) |
Build a new transport manager using a transport manager that may not be the same as in the phase description and return a base class pointer to it.
model | String name for the transport manager |
thermo | ThermoPhase object |
log_level | log level |
log_level
parameter is deprecated and will be removed after Cantera 3.1. Definition at line 68 of file TransportFactory.cpp.
Transport * newTransport | ( | ThermoPhase * | thermo, |
int | log_level = -7 |
||
) |
Build a new transport manager using the default transport manager in the phase description and return a base class pointer to it.
thermo | ThermoPhase object |
log_level | log level |
log_level
parameter is deprecated and will be removed after Cantera 3.1. Definition at line 103 of file TransportFactory.cpp.
|
staticprivate |
Static instance of the factor -> This is the only instance of this object allowed.
Definition at line 77 of file TransportFactory.h.
|
staticprivate |
Static instance of the mutex used to ensure the proper reading of the transport database.
Definition at line 81 of file TransportFactory.h.
|
private |
Models included in this map are initialized in CK compatibility mode.
Definition at line 92 of file TransportFactory.h.