Cantera  3.1.0a1
ReactorFactory.h
Go to the documentation of this file.
1 //! @file ReactorFactory.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 REACTOR_FACTORY_H
7 #define REACTOR_FACTORY_H
8 
11 
12 namespace Cantera
13 {
14 
15 //! Factory class to create reactor objects
16 //!
17 //! This class is mainly used via the newReactor() function, for example:
18 //!
19 //! ```cpp
20 //! shared_ptr<ReactorBase> r1 = newReactor("IdealGasReactor");
21 //! ```
22 class ReactorFactory : public Factory<ReactorBase>
23 {
24 public:
25  static ReactorFactory* factory();
26 
27  void deleteFactory() override;
28 
29 private:
30  static ReactorFactory* s_factory;
31  static std::mutex reactor_mutex;
33 };
34 
35 //! @defgroup reactorGroup Reactors
36 //! Zero-dimensional objects representing stirred reactors.
37 //! Reactors simulate time-dependent behavior considering gas-phase chemistry.
38 //! Reactor objects should be instantiated via the newReactor() function, for example:
39 //!
40 //! ```cpp
41 //! shared_ptr<ReactorBase> r1 = newReactor("IdealGasReactor");
42 //! ```
43 //! @ingroup zerodGroup
44 //! @{
45 
46 //! Create a Reactor object of the specified type
47 //! @since Starting in Cantera 3.1, this method returns a `shared_ptr<ReactorBase>`
48 shared_ptr<ReactorBase> newReactor(const string& model);
49 
50 //! Create a Reactor object of the specified type
51 //! @since New in %Cantera 3.0.
52 //! @deprecated Transitional method. Use newReactor() instead.
53 shared_ptr<ReactorBase> newReactor3(const string& model);
54 
55 //! @}
56 
57 }
58 
59 #endif
File contains the FactoryBase class declarations.
Factory class that supports registering functions to create objects.
Definition: FactoryBase.h:69
Factory class to create reactor objects.
void deleteFactory() override
Virtual abstract function that deletes the factory.
shared_ptr< ReactorBase > newReactor3(const string &model)
Create a Reactor object of the specified type.
shared_ptr< ReactorBase > newReactor(const string &model)
Create a Reactor object of the specified type.
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:564