Cantera 2.6.0

Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
FalloffFactory Class Reference
Chemical Kinetics » Falloff Parameterizations

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

`#include <FalloffFactory.h>`

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

## Public Member Functions
virtual void | deleteFactory ()
| Virtual abstract function that deletes the factory. More...
virtual Falloff * | newFalloff (const std::string &type, const vector_fp &c)
| Return a pointer to a new falloff function calculator. More...
Public Member Functions inherited from Factory< Falloff >
Falloff * | 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< Falloff *(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 FalloffFactory * | 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
| FalloffFactory ()
| default constructor, which is defined as private More...

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

## Additional Inherited Members
Protected Member Functions inherited from Factory< Falloff >
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 falloff function calculators.

The falloff factory is accessed through static method factory:

Falloff* f = FalloffFactory::factory()->newFalloff(type, c)
Cantera::FalloffFactory::newFalloff
virtual Falloff * newFalloff(const std::string &type, const vector_fp &c)
Return a pointer to a new falloff function calculator.
Definition: FalloffFactory.cpp:29
Cantera::FalloffFactory::factory
static FalloffFactory * factory()
Return a pointer to the factory.
Definition: FalloffFactory.h:44
Cantera::FalloffRate
Base class for falloff rate calculators.
Definition: Falloff.h:79

Deprecated:
  Deprecated in Cantera 2.6 and removed thereafter. Replaced by FalloffRate objects managed by MultiRate evaluators.

Definition at line 36 of file FalloffFactory.h.

## Constructor & Destructor Documentation

## ◆ FalloffFactory()

FalloffFactory | ( |  | ) |
| private

default constructor, which is defined as private

Definition at line 20 of file FalloffFactory.cpp.

References Factory< Falloff >::addAlias(), and Factory< Falloff >::reg().

Referenced by FalloffFactory::factory().

## Member Function Documentation

## ◆ factory()

static FalloffFactory * 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 44 of file FalloffFactory.h.

References FalloffFactory::falloff_mutex, FalloffFactory::FalloffFactory(), and FalloffFactory::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 52 of file FalloffFactory.h.

References FalloffFactory::falloff_mutex, and FalloffFactory::s_factory.

## ◆ newFalloff()

Falloff * newFalloff | ( | const std::string & | type,
|  | const vector_fp & | c
| ) |  |
| virtual

Return a pointer to a new falloff function calculator.

Parameters

  type | String identifier specifying the type of falloff function. The standard types match class names defined in Falloff.h. A factory class derived from FalloffFactory may define other types as well.
  c | input vector of doubles which populates the falloff parameterization.

Returns
  a pointer to a new Falloff class.

Definition at line 29 of file FalloffFactory.cpp.

## Member Data Documentation

## ◆ s_factory

FalloffFactory * s_factory = 0
| static private

Pointer to the single instance of the factory.

Definition at line 72 of file FalloffFactory.h.

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

## ◆ falloff_mutex

std::mutex falloff_mutex
| static private

Mutex for use when calling the factory.

Definition at line 78 of file FalloffFactory.h.

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

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

- FalloffFactory.h
- FalloffFactory.cpp