Cantera 2.6.0

WallFactory.cpp
Go to the documentation of this file.
1//! @file WallFactory.cpp
2
3// This file is part of Cantera. See License.txt in the top-level directory or
4// at https://cantera.org/license.txt for license and copyright information.
5
6#include "cantera/zeroD/WallFactory.h"
7#include "cantera/zeroD/Wall.h"
8
9 using namespace std;
10 namespace Cantera
11{
12
13WallFactory* WallFactory::s_factory = 0;
14std::mutex WallFactory::wall_mutex;
15
16WallFactory::WallFactory()
17{
18 reg("Wall", []() { return new Wall(); });
19}
20
21 WallBase* WallFactory::newWall(const std::string& wallType)
22{
23 return create(wallType);
24}
25
26}
WallFactory.h
Wall.h
Header file for base class WallBase.
Cantera::Factory< WallBase >::create
WallBase * create(const std::string &name, Args... args)
Create an object using the object construction function corresponding to "name" and the provided cons...
Definition: FactoryBase.h:76
Cantera::Factory< WallBase >::reg
void reg(const std::string &name, std::function< WallBase *(Args...)> f)
Register a new object construction function.
Definition: FactoryBase.h:81
Cantera::WallBase
Base class for 'walls' (walls, pistons, etc.) connecting reactors.
Definition: Wall.h:25
Cantera::WallFactory::newWall
virtual WallBase * newWall(const std::string &wallType)
Create a new wall by type name.
Definition: WallFactory.cpp:21
Cantera
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:557