| Cantera 3.0.0

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
Math1FactoryA Class Reference

Factory class to create Func1 compound objects - version A. More...

`#include <Func1Factory.h>`

Inheritance diagram for Math1FactoryA:
[legend]

## Detailed Description

Factory class to create Func1 compound objects - version A.

This class is mainly used via the newFunc1(const string&, const shared_ptr<Func1>, const shared_ptr<Func1>) function, for example:

shared_ptr<Func1> d1 = newFunc1("sum", f1, f2);
Cantera::newFunc1
shared_ptr< Func1 > newFunc1(const string &func1Type, double coeff)
Create a new simple functor object (see Simple Functors).
Definition Func1Factory.cpp:145

Since
  New in Cantera 3.0

Definition at line 56 of file Func1Factory.h.

## Public Member Functions
void | deleteFactory () override
| Virtual abstract function that deletes the factory.
Public Member Functions inherited from Factory< Func1, const shared_ptr< Func1 >, const shared_ptr< Func1 > >
Func1 * | create (const string &name, Args... args)
| Create an object using the object construction function corresponding to "name" and the provided constructor arguments.
void | reg (const string &name, function< Func1 *(Args...)> f)
| Register a new object construction function.
void | addAlias (const string &original, const string &alias)
| Add an alias for an existing registered type.
string | canonicalize (const string &name)
| Get the canonical name registered for a type.
bool | exists (const string &name) const
| Returns true if `name` is registered with this factory.
Public Member Functions inherited from FactoryBase
virtual | ~FactoryBase ()
| destructor

## Static Public Member Functions
static Math1FactoryA * | factory ()
| Return a pointer to the factory.
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

## Private Member Functions
| Math1FactoryA ()
| default constructor, which is defined as private

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

## Additional Inherited Members
Protected Member Functions inherited from Factory< Func1, const shared_ptr< Func1 >, const shared_ptr< Func1 > >
void | addDeprecatedAlias (const string &original, const string &alias)
| Add a deprecated alias for an existing registered type.
Protected Member Functions inherited from FactoryBase
| FactoryBase ()
| Constructor.

## Constructor & Destructor Documentation

## ◆ Math1FactoryA()

Math1FactoryA | ( |  | ) |
| private

default constructor, which is defined as private

Definition at line 78 of file Func1Factory.cpp.

## Member Function Documentation

## ◆ factory()

Math1FactoryA * factory | ( |  | ) |
| 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 97 of file Func1Factory.cpp.

## ◆ deleteFactory()

void deleteFactory | ( |  | ) |
| override virtual

Virtual abstract function that deletes the factory.

This must be properly defined in child objects.

Implements FactoryBase.

Definition at line 106 of file Func1Factory.cpp.

## Member Data Documentation

## ◆ s_factory

Math1FactoryA * s_factory = 0
| static private

Pointer to the single instance of the factory.

Definition at line 71 of file Func1Factory.h.

## ◆ s_mutex

std::mutex s_mutex
| static private

Mutex for use when calling the factory.

Definition at line 77 of file Func1Factory.h.

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

- Func1Factory.h
- Func1Factory.cpp