1 #ifndef ERF_DUST_MODEL_REGISTRY_H
2 #define ERF_DUST_MODEL_REGISTRY_H
56 #define ERF_DUST_MODEL_CONCAT_(a, b) a##b
57 #define ERF_DUST_MODEL_CONCAT(a, b) ERF_DUST_MODEL_CONCAT_(a, b)
63 #define ERF_REGISTER_DUST_MODEL(Class, name) \
65 [[maybe_unused]] const bool ERF_DUST_MODEL_CONCAT(erf_dust_model_registered_, __LINE__) = \
66 register_dust_model((name), []() -> std::unique_ptr<DustModel> { \
67 return std::make_unique<Class>(); \
std::unique_ptr< DustModel > make_dust_model_from_inputs()
The model the inputs select, or nullptr when erf.dust.enable is not true.
Definition: ERF_DustModelRegistry.cpp:63
std::vector< std::string > dust_model_names()
Names erf.dust.model accepts, sorted; empty when no model is compiled in.
Definition: ERF_DustModelRegistry.cpp:46
std::unique_ptr< DustModel > make_dust_model(const std::string &name)
The model registered as name, or nullptr when no model has that name.
Definition: ERF_DustModelRegistry.cpp:54
std::function< std::unique_ptr< DustModel >()> DustModelCreator
Creates a model; the model reads its inputs in initialize().
Definition: ERF_DustModelRegistry.H:30
bool register_dust_model(const std::string &name, DustModelCreator creator)
Add a model to the registry; aborts on an empty name or a name registered twice.
Definition: ERF_DustModelRegistry.cpp:31
The interface between ERF and a dust model.
std::string name
Definition: ERF_Plotfile2DCatalog.cpp:139