#include <ERF_SurfaceEngineRegistry.H>
|
| using | Creator = std::function< std::unique_ptr< Engine >(const Params &)> |
| | Creates an engine from the coupling inputs. More...
|
| |
|
| static bool | add (const SurfaceCouplingNames &names, const std::string &name, Creator creator) |
| | Add an engine; aborts on an empty name or a name registered twice. More...
|
| |
| static std::vector< std::string > | names () |
| | The registered names, sorted. More...
|
| |
| static std::unique_ptr< Engine > | make (const std::string &name, const Params ¶ms) |
| | The engine registered under name, or nullptr. More...
|
| |
◆ Creator
template<class Engine , class Params >
Creates an engine from the coupling inputs.
◆ add()
template<class Engine , class Params >
Add an engine; aborts on an empty name or a name registered twice.
35 auto& registry =
map();
36 const std::string macro = std::string(
"ERF_REGISTER_") +
names.upper +
"_ENGINE";
38 amrex::Abort(
names.tag() +
" " + macro +
": an engine registered an empty name");
40 if (registry.count(
name) > 0) {
41 amrex::Abort(
names.tag() +
" " + macro +
": two engines registered the name \"" +
name
42 +
"\"; each engine directory in the build must use its own name");
44 registry.emplace(
name, std::move(creator));
std::string name
Definition: ERF_Plotfile2DCatalog.cpp:139
static std::map< std::string, Creator > & map()
Definition: ERF_SurfaceEngineRegistry.H:68
static std::vector< std::string > names()
The registered names, sorted.
Definition: ERF_SurfaceEngineRegistry.H:49
Referenced by register_fire_engine(), and register_flood_engine().
◆ make()
template<class Engine , class Params >
| static std::unique_ptr<Engine> SurfaceEngineRegistry< Engine, Params >::make |
( |
const std::string & |
name, |
|
|
const Params & |
params |
|
) |
| |
|
inlinestatic |
The engine registered under name, or nullptr.
59 const auto& registry =
map();
60 const auto it = registry.find(
name);
61 if (it == registry.end()) {
return nullptr; }
62 return it->second(params);
Referenced by make_fire_engine(), and make_flood_engine().
◆ map()
template<class Engine , class Params >
◆ names()
template<class Engine , class Params >
The documentation for this class was generated from the following file: