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

Factory class to construct reaction rate calculators. More...

#include <ReactionRateFactory.h>

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

Public Member Functions

virtual void deleteFactory ()
 Virtual abstract function that deletes the factory. More...
 
- Public Member Functions inherited from Factory< ReactionRate, const AnyMap &, const UnitStack & >
ReactionRatecreate (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< ReactionRate *(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 ReactionRateFactoryfactory ()
 Return a pointer to the factory. 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

 ReactionRateFactory ()
 default constructor, which is defined as private More...
 

Static Private Attributes

static ReactionRateFactorys_factory = 0
 Pointer to the single instance of the factory. More...
 
static std::mutex rate_mutex
 Mutex for use when calling the factory. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Factory< ReactionRate, const AnyMap &, const UnitStack & >
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 construct reaction rate calculators.

The reaction factory is accessed through the static method factory:

Rate* f = ReactionRateFactory::factory()->newReactionRate(type, c)
static ReactionRateFactory * factory()
Return a pointer to the factory.

Definition at line 32 of file ReactionRateFactory.h.

Constructor & Destructor Documentation

◆ ReactionRateFactory()

ReactionRateFactory ( )
private

Member Function Documentation

◆ factory()

static ReactionRateFactory * factory ( )
inlinestatic

Return a pointer to the factory.

On the first call, a new instance is created. Since there is no need to instantiate more than one factory, on all subsequent calls, a pointer to the existing factory is returned.

Definition at line 41 of file ReactionRateFactory.h.

References ReactionRateFactory::rate_mutex, ReactionRateFactory::ReactionRateFactory(), and ReactionRateFactory::s_factory.

◆ 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 49 of file ReactionRateFactory.h.

References ReactionRateFactory::rate_mutex, and ReactionRateFactory::s_factory.

Member Data Documentation

◆ s_factory

ReactionRateFactory * s_factory = 0
staticprivate

Pointer to the single instance of the factory.

Definition at line 57 of file ReactionRateFactory.h.

Referenced by ReactionRateFactory::deleteFactory(), and ReactionRateFactory::factory().

◆ rate_mutex

std::mutex rate_mutex
staticprivate

Mutex for use when calling the factory.

Definition at line 63 of file ReactionRateFactory.h.

Referenced by ReactionRateFactory::deleteFactory(), and ReactionRateFactory::factory().


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