Cantera  3.0.0
Loading...
Searching...
No Matches
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
12namespace Cantera
13{
14
15//! Factory class to create FlowDevice objects.
16//!
17//! This class is mainly used via the newFlowDevice3() function, for example:
18//!
19//! ```cpp
20//! shared_ptr<FlowDevice> mfc = newFlowDevice3("MassFlowController");
21//! ```
22class FlowDeviceFactory : public Factory<FlowDevice>
23{
24public:
25 static FlowDeviceFactory* factory();
26
27 void deleteFactory() override;
28
29 //! Create a new flow device by type name.
30 /*!
31 * @param flowDeviceType the type to be created.
32 * @deprecated To be removed after %Cantera 3.0; replaceable by newFlowDevice3.
33 */
34 FlowDevice* newFlowDevice(const string& flowDeviceType);
35
36private:
37 static FlowDeviceFactory* s_factory;
38 static std::mutex flowDevice_mutex;
40};
41
42//! @defgroup flowDeviceGroup Flow Devices
43//! Flow device objects connect zero-dimensional reactors.
44//! FlowDevice objects should be instantiated via the newFlowDevice3() function, for
45//! example:
46//!
47//! ```cpp
48//! shared_ptr<FlowDevice> mfc = newFlowDevice3("MassFlowController");
49//! ```
50//! @ingroup zerodGroup
51//! @{
52
53//! Create a FlowDevice object of the specified type
54//! @deprecated To be changed after %Cantera 3.0; for new behavior, see
55//! newFlowDevice3().
56FlowDevice* newFlowDevice(const string& model);
57
58//! Create a FlowDevice object of the specified type
59//! @since New in %Cantera 3.0.
60//! @todo Transition back to newFlowDevice() after %Cantera 3.0
61shared_ptr<FlowDevice> newFlowDevice3(const string& model);
62
63//! @}
64}
65
66#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.
FlowDevice * newFlowDevice(const string &flowDeviceType)
Create a new flow device by type name.
void deleteFactory() override
Virtual abstract function that deletes the factory.
Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors.
Definition FlowDevice.h:24
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