Cantera
Loading...
Searching...
No Matches
ReactorFactory Class Reference

Factory class to create reactor objects. More...

#include <ReactorFactory.h>

Inheritance diagram for ReactorFactory:
[legend]

Detailed Description

Factory class to create reactor objects.

This class is mainly used via the newReactor() function, for example:

shared_ptr<ReactorBase> r1 = newReactor("IdealGasReactor");
shared_ptr< Reactor > newReactor(const string &model, shared_ptr< Solution > phase, bool clone, const string &name)
Create a Reactor object of the specified type and contents.

Definition at line 25 of file ReactorFactory.h.

Public Member Functions

void deleteFactory () override
 Virtual abstract function that deletes the factory.
Public Member Functions inherited from Factory< ReactorBase, shared_ptr< Solution >, bool, const string & >
ReactorBasecreate (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< ReactorBase *(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 ReactorFactory * 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

Static Private Attributes

static ReactorFactory * s_factory = 0
static std::mutex reactor_mutex

Additional Inherited Members

Protected Member Functions inherited from Factory< ReactorBase, shared_ptr< Solution >, bool, const string & >
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.

Constructor & Destructor Documentation

◆ ReactorFactory()

ReactorFactory ( )
private

Definition at line 25 of file ReactorFactory.cpp.

Member Function Documentation

◆ factory()

ReactorFactory * factory ( )
static

Definition at line 83 of file ReactorFactory.cpp.

◆ deleteFactory()

void deleteFactory ( )
overridevirtual

Virtual abstract function that deletes the factory.

This must be properly defined in child objects.

Implements FactoryBase.

Definition at line 91 of file ReactorFactory.cpp.

Member Data Documentation

◆ s_factory

ReactorFactory * s_factory = 0
staticprivate

Definition at line 33 of file ReactorFactory.h.

◆ reactor_mutex

std::mutex reactor_mutex
staticprivate

Definition at line 34 of file ReactorFactory.h.


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