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