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

Factory class to create WallBase objects. More...

#include <WallFactory.h>

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

Public Member Functions

virtual void deleteFactory ()
 Virtual abstract function that deletes the factory. More...
 
virtual WallBasenewWall (const std::string &wallType)
 Create a new wall by type name. More...
 
- Public Member Functions inherited from Factory< WallBase >
WallBasecreate (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< WallBase *(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 WallFactoryfactory ()
 
- 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 WallFactorys_factory = 0
 
static std::mutex wall_mutex
 

Additional Inherited Members

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

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

unique_ptr<WallBase> piston(newWall("Wall"));
virtual WallBase * newWall(const std::string &wallType)
Create a new wall by type name.
Definition: WallFactory.cpp:21

Definition at line 24 of file WallFactory.h.

Constructor & Destructor Documentation

◆ WallFactory()

WallFactory ( )
private

Definition at line 16 of file WallFactory.cpp.

Member Function Documentation

◆ factory()

static WallFactory * factory ( )
inlinestatic

Definition at line 27 of file WallFactory.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 WallFactory.h.

◆ newWall()

WallBase * newWall ( const std::string &  wallType)
virtual

Create a new wall by type name.

Parameters
wallTypethe type to be created.

Definition at line 21 of file WallFactory.cpp.

References Factory< WallBase >::create().

Member Data Documentation

◆ s_factory

WallFactory * s_factory = 0
staticprivate

Definition at line 48 of file WallFactory.h.

◆ wall_mutex

std::mutex wall_mutex
staticprivate

Definition at line 49 of file WallFactory.h.


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