15 #include "cantera/zeroD/IdealGasConstPressureReactor.h"
22 ReactorFactory* ReactorFactory::s_factory = 0;
23 std::mutex ReactorFactory::reactor_mutex;
25 ReactorFactory::ReactorFactory()
27 reg(
"Reservoir", []() {
return new Reservoir(); });
28 reg(
"Reactor", []() {
return new Reactor(); });
29 reg(
"ConstPressureReactor", []() {
return new ConstPressureReactor(); });
30 reg(
"FlowReactor", []() {
return new FlowReactor(); });
31 reg(
"IdealGasReactor", []() {
return new IdealGasReactor(); });
32 reg(
"IdealGasConstPressureReactor", []() {
return new IdealGasConstPressureReactor(); });
33 reg(
"ExtensibleReactor", []() {
return new ReactorDelegator<Reactor>(); });
34 reg(
"ExtensibleIdealGasReactor",
35 []() {
return new ReactorDelegator<IdealGasReactor>(); });
36 reg(
"ExtensibleConstPressureReactor",
37 []() {
return new ReactorDelegator<ConstPressureReactor>(); });
38 reg(
"ExtensibleIdealGasConstPressureReactor",
39 []() {
return new ReactorDelegator<IdealGasConstPressureReactor>(); });
40 reg(
"ExtensibleMoleReactor",
41 []() {
return new ReactorDelegator<MoleReactor>(); });
42 reg(
"ExtensibleConstPressureMoleReactor",
43 []() {
return new ReactorDelegator<ConstPressureMoleReactor>(); });
44 reg(
"ExtensibleIdealGasMoleReactor",
45 []() {
return new ReactorDelegator<IdealGasMoleReactor>(); });
46 reg(
"ExtensibleIdealGasConstPressureMoleReactor",
47 []() {
return new ReactorDelegator<IdealGasConstPressureMoleReactor>(); });
48 reg(
"IdealGasConstPressureMoleReactor", []() {
return new
49 IdealGasConstPressureMoleReactor(); });
50 reg(
"IdealGasMoleReactor", []() {
return new IdealGasMoleReactor(); });
51 reg(
"ConstPressureMoleReactor", []() {
return new ConstPressureMoleReactor(); });
52 reg(
"MoleReactor", []() {
return new MoleReactor(); });
55 ReactorFactory* ReactorFactory::factory() {
56 std::unique_lock<std::mutex> lock(reactor_mutex);
58 s_factory =
new ReactorFactory;
64 std::unique_lock<std::mutex> lock(reactor_mutex);
71 return shared_ptr<ReactorBase>(ReactorFactory::factory()->create(model));
void reg(const string &name, function< ReactorBase *(Args...)> f)
Register a new object construction function.
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.