1 #ifndef ERF_FIRE_ENGINE_REGISTRY_H
2 #define ERF_FIRE_ENGINE_REGISTRY_H
11 #include <type_traits>
52 #define ERF_FIRE_ENGINE_CONCAT_(a, b) a##b
53 #define ERF_FIRE_ENGINE_CONCAT(a, b) ERF_FIRE_ENGINE_CONCAT_(a, b)
61 #define ERF_REGISTER_FIRE_ENGINE(Class, name) \
63 [[maybe_unused]] const bool ERF_FIRE_ENGINE_CONCAT(erf_fire_engine_registered_, __LINE__) = \
64 register_fire_engine((name), [](const FireCouplingParams& p) -> std::unique_ptr<FireEngine> { \
65 if constexpr (std::is_constructible_v<Class, const FireCouplingParams&>) { \
66 return std::make_unique<Class>(p); \
68 amrex::ignore_unused(p); \
69 return std::make_unique<Class>(); \
The inputs of the atmosphere side of the fire coupling.
bool register_fire_engine(const std::string &name, FireEngineCreator creator)
Add an engine to the registry; aborts on a name registered twice.
Definition: ERF_FireEngineRegistry.cpp:19
std::unique_ptr< FireEngine > make_fire_engine(const std::string &name, const FireCouplingParams ¶ms)
The engine erf.fire.engine names, or nullptr when no engine has that name.
Definition: ERF_FireEngineRegistry.cpp:42
std::vector< std::string > fire_engine_names()
Names erf.fire.engine accepts, sorted; empty when no engine is compiled in.
Definition: ERF_FireEngineRegistry.cpp:34
std::function< std::unique_ptr< FireEngine >(const FireCouplingParams &)> FireEngineCreator
Creates an engine from the coupling inputs.
Definition: ERF_FireEngineRegistry.H:36
The interface between the fire coupling and a fire engine.
std::string name
Definition: ERF_Plotfile2DCatalog.cpp:116
Definition: ERF_FireCouplingParams.H:18