Loading [MathJax]/extensions/tex2jax.js
Cantera  3.2.0a1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ConnectorFactory Class Reference

Factory class to create ConnectorNode objects. More...

#include <ConnectorFactory.h>

Inheritance diagram for ConnectorFactory:
[legend]

Detailed Description

Factory class to create ConnectorNode objects.

This class is mainly used via the newConnectorNode() function, for example:

shared_ptr<ConnectorNode> valve = newConnectorNode("Valve", r0, r1, "my_valve");
shared_ptr< ConnectorNode > newConnectorNode(const string &model, shared_ptr< ReactorBase > r0, shared_ptr< ReactorBase > r1, const string &name)
Create a ConnectorNode object of the specified type.

where r0 and r1 are reactor objects.

Definition at line 27 of file ConnectorFactory.h.

Public Member Functions

void deleteFactory () override
 Virtual abstract function that deletes the factory.
 
- Public Member Functions inherited from Factory< ConnectorNode, shared_ptr< ReactorBase >, shared_ptr< ReactorBase >, const string & >
ConnectorNodecreate (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< ConnectorNode *(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 ConnectorFactoryfactory ()
 
- 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
 

Static Private Attributes

static ConnectorFactorys_factory = 0
 
static std::mutex connector_mutex
 

Additional Inherited Members

- Protected Member Functions inherited from Factory< ConnectorNode, shared_ptr< ReactorBase >, shared_ptr< ReactorBase >, const string & >
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.
 
virtual void deleteFactory ()=0
 Virtual abstract function that deletes the factory.
 

Constructor & Destructor Documentation

◆ ConnectorFactory()

ConnectorFactory ( )
private

Definition at line 17 of file ConnectorFactory.cpp.

Member Function Documentation

◆ factory()

ConnectorFactory * factory ( )
static

Definition at line 33 of file ConnectorFactory.cpp.

◆ deleteFactory()

void deleteFactory ( )
overridevirtual

Virtual abstract function that deletes the factory.

This must be properly defined in child objects.

Implements FactoryBase.

Definition at line 41 of file ConnectorFactory.cpp.

Member Data Documentation

◆ s_factory

ConnectorFactory * s_factory = 0
staticprivate

Definition at line 37 of file ConnectorFactory.h.

◆ connector_mutex

std::mutex connector_mutex
staticprivate

Definition at line 38 of file ConnectorFactory.h.


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