Cantera  2.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
FalloffFactory Class Reference

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.
 
virtual ~FalloffFactory ()
 Destructor doesn't do anything.
 
virtual FalloffnewFalloff (int type, const vector_fp &c)
 Return a pointer to a new falloff function calculator.
 

Static Public Member Functions

static FalloffFactoryfactory ()
 Return a pointer to the factory.
 
static void deleteFactories ()
 static function that deletes all factories in the internal registry maintained in a static variable
 

Private Member Functions

 FalloffFactory ()
 default constructor, which is defined as private
 

Static Private Attributes

static FalloffFactorys_factory = 0
 Pointer to the single instance of the factory.
 
static mutex_t falloff_mutex
 Mutex for use when calling the factory.
 

Detailed Description

Factory class to construct falloff function calculators.

The falloff factory is accessed through static method factory:

Definition at line 107 of file FalloffFactory.h.

Constructor & Destructor Documentation

virtual ~FalloffFactory ( )
inlinevirtual

Destructor doesn't do anything.

We do not delete statically created single instance of this class here, because it would create an infinite loop if destructor is called for that single instance. Instead, to delete single instance, we call delete[] from FalloffMng's destructor.

Definition at line 140 of file FalloffFactory.h.

FalloffFactory ( )
inlineprivate

default constructor, which is defined as private

Definition at line 163 of file FalloffFactory.h.

Referenced by FalloffFactory::factory().

Member Function Documentation

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

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

Referenced by FalloffMgr::FalloffMgr().

virtual void deleteFactory ( )
inlinevirtual

Virtual abstract function that deletes the factory.

This must be properly defined in child objects.

Implements FactoryBase.

Definition at line 125 of file FalloffFactory.h.

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

Falloff * newFalloff ( int  type,
const vector_fp c 
)
virtual

Return a pointer to a new falloff function calculator.

Parameters
typeInteger flag specifying the type of falloff function. The standard types are defined in file reaction_defs.h. A factory class derived from FalloffFactory may define other types as well.
cinput vector of doubles which populates the falloff parameterization.
Returns
Returns a pointer to a new Falloff class.

Definition at line 730 of file FalloffFactory.cpp.

References Falloff::init().

Referenced by FalloffMgr::install().

static void deleteFactories ( )
inlinestaticinherited

static function that deletes all factories in the internal registry maintained in a static variable

Definition at line 28 of file FactoryBase.h.

References FactoryBase::s_vFactoryRegistry.

Member Data Documentation

FalloffFactory * s_factory = 0
staticprivate

Pointer to the single instance of the factory.

Definition at line 160 of file FalloffFactory.h.

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

mutex_t falloff_mutex
staticprivate

Mutex for use when calling the factory.

Definition at line 166 of file FalloffFactory.h.

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


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