Cantera  3.1.0b1
Loading...
Searching...
No Matches
WallFactory.h
Go to the documentation of this file.
1//! @file WallFactory.h
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#ifndef WALL_FACTORY_H
7#define WALL_FACTORY_H
8
10#include "cantera/zeroD/Wall.h"
11
12namespace Cantera
13{
14
15//! Factory class to create WallBase objects
16//!
17//! This class is mainly used via the newWall() function, for example:
18//!
19//! ```cpp
20//! shared_ptr<WallBase> piston = newWall("Wall");
21//! ```
22class WallFactory : public Factory<WallBase, const string&>
23{
24public:
25 static WallFactory* factory();
26
27 void deleteFactory() override;
28
29private:
30 static WallFactory* s_factory;
31 static std::mutex wall_mutex;
33};
34
35//! @defgroup wallGroup Walls
36//! Zero-dimensional objects adjacent to reactors.
37//! Wall objects should be instantiated via the newWall function, for
38//! example:
39//!
40//! ```cpp
41//! shared_ptr<WallBase> piston = newWall("Wall", "my_piston");
42//! ```
43//! @ingroup zerodGroup
44//! @{
45
46//! Create a WallBase object of the specified type
47//! @since Starting in %Cantera 3.1, this method returns a `shared_ptr<WallBase>`
48shared_ptr<WallBase> newWall(const string& model, const string& name="(none)");
49
50//! Create a WallBase object of the specified type
51//! @since New in %Cantera 3.0.
52//! @deprecated Replaced by newWall. To be removed after %Cantera 3.1.
53shared_ptr<WallBase> newWall3(const string& model);
54
55//! @}
56
57}
58
59#endif
File contains the FactoryBase class declarations.
Header file for base class WallBase.
Factory class that supports registering functions to create objects.
Definition FactoryBase.h:69
Factory class to create WallBase objects.
Definition WallFactory.h:23
void deleteFactory() override
Virtual abstract function that deletes the factory.
shared_ptr< WallBase > newWall(const string &model, const string &name)
Create a WallBase object of the specified type.
shared_ptr< WallBase > newWall3(const string &model)
Create a WallBase object of the specified type.
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595