netxsimdg
Loading...
Searching...
No Matches
IStructure.hpp
Go to the documentation of this file.
1
8#ifndef ISTRUCTURE_HPP
9#define ISTRUCTURE_HPP
10
13
14#include <boost/algorithm/string/predicate.hpp>
15#include <string>
16
17namespace Nextsim {
18
31public:
32 IStructure() { }
33 virtual ~IStructure() = default;
34
40 // virtual void init(const std::string& filePath) = 0;
41
45 virtual ModelState getModelState(const std::string& filePath) = 0;
46
48 virtual const std::string& structureType() const { return processedStructureName; }
55 inline bool structureTypeCheck(const std::string& str) const
56 {
57 return boost::algorithm::iequals(structureType(), str);
58 }
59
61 virtual int nIceLayers() const = 0;
62
68 // virtual void dump(const std::string& filePath) const = 0;
69
76 virtual void dumpModelState(
77 const ModelState& state, const ModelMetadata& metadata, const std::string& filePath, bool isRestart) const = 0;
78
79 // Node names in the default structure
80
82 static const std::string metadataNodeName() { return "metadata"; }
84 static const std::string dataNodeName() { return "data"; }
86 static const std::string structureNodeName() { return "structure"; }
89 static const std::string typeNodeName() { return "type"; }
90
91private:
93 const std::string processedStructureName = "none";
94};
95
96}
97#endif /* ISTRUCTURE_HPP */
Interface class for the model structure.
virtual ModelState getModelState(const std::string &filePath)=0
Dumps the data to a file path.
virtual const std::string & structureType() const
Returns the structure name that this class will process.
static const std::string typeNodeName()
The name of the node holding the name of the structure type processed by this class.
static const std::string dataNodeName()
Returns the name of the data node.
virtual void dumpModelState(const ModelState &state, const ModelMetadata &metadata, const std::string &filePath, bool isRestart) const =0
Dumps the data to a file path.
static const std::string structureNodeName()
The name of the group holding the definitive structure type.
virtual int nIceLayers() const =0
The number of ice layers in this data structure.
static const std::string metadataNodeName()
Returns the name of the metadata node.
bool structureTypeCheck(const std::string &str) const
Checks if the passed string matches (ignoring case) the name of the structure that this class constru...