Cantera 2.6.0

Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
ReactionFactory Class Reference
Reactions and reaction rates

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

`#include <ReactionFactory.h>`

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

## Public Member Functions
virtual void | deleteFactory ()
| Virtual abstract function that deletes the factory. More...
Public Member Functions inherited from Factory< Reaction, const AnyMap &, const Kinetics & >
Reaction * | create (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< Reaction *(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 ReactionFactory * | factory ()
| 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
| ReactionFactory ()
| default constructor, which is defined as private More...

## Static Private Attributes
static ReactionFactory * | s_factory = 0
| Pointer to the single instance of the factory. More...
static std::mutex | reaction_mutex
| Mutex for use when calling the factory. More...

## Additional Inherited Members
Protected Member Functions inherited from Factory< Reaction, const AnyMap &, const Kinetics & >
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...
virtual void | deleteFactory ()=0
| Virtual abstract function that deletes the factory. More...

## Detailed Description

Factory class to construct reaction function calculators.

The reaction factory is accessed through static method factory:

Reaction* f = ReactionFactory::factory()->newReaction(type, c)
Cantera::ReactionFactory::factory
static ReactionFactory * factory()
Return a pointer to the factory.
Definition: ReactionFactory.h:38
Cantera::Reaction
Abstract base class which stores data about a reaction and its rate parameterization so that it can b...
Definition: Reaction.h:33

Definition at line 30 of file ReactionFactory.h.

## Constructor & Destructor Documentation

## ◆ ReactionFactory()

ReactionFactory | ( |  | ) |
| private

default constructor, which is defined as private

Definition at line 23 of file ReactionFactory.cpp.

References Factory< Reaction, const AnyMap &, const Kinetics & >::addAlias(), and Factory< Reaction, const AnyMap &, const Kinetics & >::reg().

Referenced by ReactionFactory::factory().

## Member Function Documentation

## ◆ factory()

static ReactionFactory * factory | ( |  | ) |
| inline static

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 38 of file ReactionFactory.h.

References ReactionFactory::reaction_mutex, ReactionFactory::ReactionFactory(), and ReactionFactory::s_factory.

## ◆ deleteFactory()

virtual void deleteFactory | ( |  | ) |
| inline virtual

Virtual abstract function that deletes the factory.

This must be properly defined in child objects.

Implements FactoryBase.

Definition at line 46 of file ReactionFactory.h.

References ReactionFactory::reaction_mutex, and ReactionFactory::s_factory.

## Member Data Documentation

## ◆ s_factory

ReactionFactory * s_factory = 0
| static private

Pointer to the single instance of the factory.

Definition at line 54 of file ReactionFactory.h.

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

## ◆ reaction_mutex

std::mutex reaction_mutex
| static private

Mutex for use when calling the factory.

Definition at line 60 of file ReactionFactory.h.

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

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

- ReactionFactory.h
- ReactionFactory.cpp