13FlowDeviceFactory* FlowDeviceFactory::s_factory = 0;
14std::mutex FlowDeviceFactory::flowDevice_mutex;
16FlowDeviceFactory::FlowDeviceFactory()
18 reg(
"MassFlowController", []() {
return new MassFlowController(); });
19 reg(
"PressureController", []() {
return new PressureController(); });
20 reg(
"Valve", []() {
return new Valve(); });
25 return create(flowDeviceType);
FlowDevice * create(const std::string &name, Args... args)
Create an object using the object construction function corresponding to "name" and the provided cons...
void reg(const std::string &name, std::function< FlowDevice *(Args...)> f)
Register a new object construction function.
virtual FlowDevice * newFlowDevice(const std::string &flowDeviceType)
Create a new flow device by type name.
Base class for 'flow devices' (valves, pressure regulators, etc.) connecting reactors.
Some flow devices derived from class FlowDevice.
Namespace for the Cantera kernel.