Cantera  3.1.0a1
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 
12 namespace 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 //! ```
22 class WallFactory : public Factory<WallBase>
23 {
24 public:
25  static WallFactory* factory();
26 
27  void deleteFactory() override;
28 
29 private:
30  static WallFactory* s_factory;
31  static std::mutex wall_mutex;
32  WallFactory();
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");
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>`
48 shared_ptr<WallBase> newWall(const string& model);
49 
50 //! Create a WallBase object of the specified type
51 //! @since New in %Cantera 3.0.
52 //! @deprecated Transitional method. Use newWall() instead.
53 shared_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.
Definition: WallFactory.cpp:28
shared_ptr< WallBase > newWall(const string &model)
Create a WallBase object of the specified type.
Definition: WallFactory.cpp:34
shared_ptr< WallBase > newWall3(const string &model)
Create a WallBase object of the specified type.
Definition: WallFactory.cpp:39
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:564