Cantera 2.6.0
Public Member Functions | Static Public Member Functions | Static Private Attributes | List of all members
FlowDeviceFactory Class Reference

Factory class to create FlowDevice objects. More...

#include <FlowDeviceFactory.h>

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

Public Member Functions

virtual void deleteFactory ()
 Virtual abstract function that deletes the factory. More...
 
virtual FlowDevicenewFlowDevice (const std::string &flowDeviceType)
 Create a new flow device by type name. More...
 
- Public Member Functions inherited from Factory< FlowDevice >
FlowDevicecreate (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< FlowDevice *(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 FlowDeviceFactoryfactory ()
 
- 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...
 

Static Private Attributes

static FlowDeviceFactorys_factory = 0
 
static std::mutex flowDevice_mutex
 

Additional Inherited Members

- Protected Member Functions inherited from Factory< FlowDevice >
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...
 

Detailed Description

Factory class to create FlowDevice objects.

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

unique_ptr<FlowDevice> mfc(newFlowDevice("MassFlowController"));
virtual FlowDevice * newFlowDevice(const std::string &flowDeviceType)
Create a new flow device by type name.

Definition at line 24 of file FlowDeviceFactory.h.

Constructor & Destructor Documentation

◆ FlowDeviceFactory()

FlowDeviceFactory ( )
private

Definition at line 16 of file FlowDeviceFactory.cpp.

Member Function Documentation

◆ factory()

static FlowDeviceFactory * factory ( )
inlinestatic

Definition at line 27 of file FlowDeviceFactory.h.

◆ deleteFactory()

virtual void deleteFactory ( )
inlinevirtual

Virtual abstract function that deletes the factory.

This must be properly defined in child objects.

Implements FactoryBase.

Definition at line 35 of file FlowDeviceFactory.h.

◆ newFlowDevice()

FlowDevice * newFlowDevice ( const std::string &  flowDeviceType)
virtual

Create a new flow device by type name.

Parameters
flowDeviceTypethe type to be created.

Definition at line 23 of file FlowDeviceFactory.cpp.

References Factory< FlowDevice >::create().

Member Data Documentation

◆ s_factory

FlowDeviceFactory * s_factory = 0
staticprivate

Definition at line 48 of file FlowDeviceFactory.h.

◆ flowDevice_mutex

std::mutex flowDevice_mutex
staticprivate

Definition at line 49 of file FlowDeviceFactory.h.


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