Cantera 2.6.0
Public Member Functions | Static Public Member Functions | Static Private Attributes | List of all members
ReactorFactory Class Reference

Factory class to create reactor objects. More...

#include <ReactorFactory.h>

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

Public Member Functions

virtual void deleteFactory ()
 Virtual abstract function that deletes the factory. More...
 
virtual ReactorBasenewReactor (const std::string &reactorType)
 Create a new reactor by type name. More...
 
- Public Member Functions inherited from Factory< ReactorBase >
ReactorBasecreate (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< ReactorBase *(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 ReactorFactoryfactory ()
 
- 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...
 

Static Private Attributes

static ReactorFactorys_factory = 0
 
static std::mutex reactor_mutex
 

Additional Inherited Members

- Protected Member Functions inherited from Factory< ReactorBase >
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...
 

Detailed Description

Factory class to create reactor objects.

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

unique_ptr<ReactorBase> r1(newReactor("IdealGasReactor"));
virtual ReactorBase * newReactor(const std::string &reactorType)
Create a new reactor by type name.

Definition at line 24 of file ReactorFactory.h.

Constructor & Destructor Documentation

◆ ReactorFactory()

ReactorFactory ( )
private

Definition at line 24 of file ReactorFactory.cpp.

Member Function Documentation

◆ factory()

static ReactorFactory * factory ( )
inlinestatic

Definition at line 27 of file ReactorFactory.h.

◆ deleteFactory()

virtual void deleteFactory ( )
inlinevirtual

Virtual abstract function that deletes the factory.

This must be properly defined in child objects.

Implements FactoryBase.

Definition at line 35 of file ReactorFactory.h.

◆ newReactor()

ReactorBase * newReactor ( const std::string &  reactorType)
virtual

Create a new reactor by type name.

Parameters
reactorTypethe type to be created.

Definition at line 41 of file ReactorFactory.cpp.

References Factory< ReactorBase >::create().

Member Data Documentation

◆ s_factory

ReactorFactory * s_factory = 0
staticprivate

Definition at line 48 of file ReactorFactory.h.

◆ reactor_mutex

std::mutex reactor_mutex
staticprivate

Definition at line 49 of file ReactorFactory.h.


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