netxsimdg
Loading...
Searching...
No Matches
IStructureModule.cpp
Go to the documentation of this file.
1
9
10#include "include/DevGrid.hpp"
13
14namespace Module {
15
16const std::string DEV_GRID = "DevGrid";
17const std::string RECT_GRID = "RectangularGrid";
18const std::string PARAMETRICGRID = "ParametricGrid";
19
20template <>
21Module<Nextsim::IStructure>::map Module<Nextsim::IStructure>::functionMap = {
22 { DEV_GRID, newImpl<Nextsim::IStructure, Nextsim::DevGrid> },
23 { RECT_GRID, newImpl<Nextsim::IStructure, Nextsim::RectangularGrid> },
24 { PARAMETRICGRID, newImpl<Nextsim::IStructure, Nextsim::ParametricGrid> },
25};
26template <>
27Module<Nextsim::IStructure>::fn Module<Nextsim::IStructure>::spf = functionMap.at(DEV_GRID);
28template <>
29std::unique_ptr<Nextsim::IStructure> Module<Nextsim::IStructure>::staticInstance
30 = std::move(newImpl<Nextsim::IStructure, Nextsim::DevGrid>());
31
32template <> std::string Module<Nextsim::IStructure>::moduleName() { return "IStructure"; }
33
34template <> Nextsim::IStructure& getImplementation<Nextsim::IStructure>()
35{
36 return getImplTemplate<Nextsim::IStructure, IStructureModule>();
37}
38
39template <> void setImplementation<Nextsim::IStructure>(const std::string& implName)
40{
41 setImplTemplate<IStructureModule>(implName);
42}
43
44template <> std::unique_ptr<Nextsim::IStructure> getInstance()
45{
46 return getInstTemplate<Nextsim::IStructure, IStructureModule>();
47}
48} /* namespace Module */
Interface class for the model structure.