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