netxsimdg
Loading...
Searching...
No Matches
DynamicsModule.cpp
Go to the documentation of this file.
1
9
11#include "include/Dynamics.hpp"
12
13#include <string>
14
15namespace Module {
16const std::string DUMMYDYNAMICS = "Nextsim::DummyDynamics";
17const std::string DYNAMICS = "Nextsim::Dynamics";
18
19template <>
20Module<Nextsim::IDynamics>::map Module<Nextsim::IDynamics>::functionMap = {
21 { DUMMYDYNAMICS, newImpl<Nextsim::IDynamics, Nextsim::DummyDynamics> },
22 { DYNAMICS, newImpl<Nextsim::IDynamics, Nextsim::Dynamics> },
23};
24
25
26
27
28template <>
29Module<Nextsim::IDynamics>::fn Module<Nextsim::IDynamics>::spf = functionMap.at(DUMMYDYNAMICS);
30template <>
31std::unique_ptr<Nextsim::IDynamics> Module<Nextsim::IDynamics>::staticInstance
32= std::move(newImpl<Nextsim::IDynamics, Nextsim::DummyDynamics>());
33
34template <>
35std::string Module<Nextsim::IDynamics>::moduleName(){ return "Nextsim::IDynamics"; }
36
37template<> HelpMap& getHelpRecursive<Nextsim::IDynamics>(HelpMap& map, bool getAll)
38{
39 const std::string& pfx = Nextsim::ConfiguredModule::MODULE_PREFIX;
40 map[pfx].push_back({ pfx + "." + Module<Nextsim::IDynamics>::moduleName(), ConfigType::MODULE,
41 { DUMMYDYNAMICS }, DUMMYDYNAMICS, "",
42 "MODULE DESCRIPTION HERE" });
43 return map;
44}
45template <>
46Nextsim::IDynamics& getImplementation<Nextsim::IDynamics>()
47{
48 return getImplTemplate<Nextsim::IDynamics, DynamicsModule>();
49}
50template <>
51void setImplementation<Nextsim::IDynamics>(const std::string& implName)
52{
53 setImplTemplate<DynamicsModule>(implName);
54}
55template <>
56std::unique_ptr<Nextsim::IDynamics> getInstance()
57{
58 return getInstTemplate<Nextsim::IDynamics, DynamicsModule>();
59}
60DynamicsModule::Constructor DynamicsModule::ctor;
61DynamicsModule::Constructor::Constructor()
62{
63 addToConfiguredModules<Nextsim::IDynamics, DynamicsModule>();
64}
65
66} /* namespace Module */
static const std::string MODULE_PREFIX
The configuration options section name for modules.