13 FlowDeviceFactory* FlowDeviceFactory::s_factory = 0;
14 std::mutex FlowDeviceFactory::flowDevice_mutex;
16 FlowDeviceFactory::FlowDeviceFactory()
18 reg(
"MassFlowController", []() {
return new MassFlowController(); });
19 reg(
"PressureController", []() {
return new PressureController(); });
20 reg(
"Valve", []() {
return new Valve(); });
23 reg_type(
"MassFlowController",
MFC_Type);
24 reg_type(
"PressureController", PressureController_Type);
25 reg_type(
"Valve", Valve_Type);
30 return create(flowDeviceType);
36 return create(m_types.at(ir));
37 }
catch (out_of_range&) {
38 throw CanteraError(
"FlowDeviceFactory::newFlowDevice",
39 "unknown flowDevice type!");
Some flow devices derived from class FlowDevice.
Namespace for the Cantera kernel.
FlowDevice * newFlowDevice(const std::string &model)
Create a FlowDevice object of the specified type.
const int MFC_Type
Magic numbers.