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