netxsimdg
Loading...
Searching...
No Matches
ModelState.hpp
Go to the documentation of this file.
1
8#ifndef MODELSTATE_HPP
9#define MODELSTATE_HPP
10
11#include "ModelArray.hpp"
12
13#include "include/ConfigMap.hpp"
14
15#include <map>
16#include <string>
17
18namespace Nextsim {
19
20struct ModelState {
21private:
22public:
23 typedef std::map<std::string, ModelArray> DataMap;
24
25 DataMap data;
26 ConfigMap config;
27
28 inline ModelState& merge(ModelState& source)
29 {
30 data.merge(source.data);
31 config.merge(source.config);
32 return *this;
33 }
34
35 inline ModelState& merge(ModelState&& source)
36 {
37 data.merge(source.data);
38 config.merge(source.config);
39 return *this;
40 }
41
42 inline ModelState& merge(ConfigMap& configSrc)
43 {
44 config.merge(configSrc);
45 return *this;
46 }
47
48 inline ModelState& merge(ConfigMap&& configSrc)
49 {
50 config.merge(configSrc);
51 return *this;
52 }
53
54 inline ModelState& merge(DataMap& dataSrc)
55 {
56 data.merge(dataSrc);
57 return *this;
58 }
59
60 inline ModelState& merge(DataMap&& dataSrc)
61 {
62 data.merge(dataSrc);
63 return *this;
64 }
65};
66
67} /* namespace Nextsim */
68
69#endif /* MODELSTATE_HPP */