HydroCouple  2.0.0
HydroCouple Interface Definitions
Loading...
Searching...
No Matches
hydrocoupletemporal.h
Go to the documentation of this file.
1
21#ifndef HYDROCOUPLETEMPORAL_H
22#define HYDROCOUPLETEMPORAL_H
23
24#include "hydrocouple.h"
25
26
27namespace HydroCouple
28{
30 namespace Temporal
31 {
36 {
37 public:
41 virtual ~IDateTime() = default;
42
46 [[nodiscard]] virtual double julianDay() const = 0;
47
51 [[nodiscard]] virtual double modifiedJulianDay() const = 0;
52
56 [[nodiscard]] virtual double serialDate() const = 0;
57 };
58
62 class ITimeSpan : public virtual IDateTime
63 {
64
65 public:
69 virtual ~ITimeSpan() = default;
70
75 [[nodiscard]] virtual double duration() const = 0;
76 };
77
83 {
84 public:
88 virtual ~ITimeModelComponent() = default;
89
94 [[nodiscard]] virtual IDateTime *currentDateTime() const = 0;
95
100 [[nodiscard]] virtual ITimeSpan *simulationPeriod() const = 0;
101 };
102
112 {
113
114 public:
119
123 virtual ~ITimeSeriesComponentDataItem() = default;
124
130 [[nodiscard]] virtual const IDateTime *time(int timeIndex) const = 0;
131
136 [[nodiscard]] virtual int timeCount() const = 0;
137
142 [[nodiscard]] virtual ITimeSpan *timeSpan() const = 0;
143
148 [[nodiscard]] virtual IDimension *timeDimension() const = 0;
149
156 virtual void getValue(
158 int timeDimensionIndex,
159 std::span<const int> dimensionIndexes = {}) const = 0;
160
170 virtual void getValues(
172 int timeDimensionIndex,
173 std::span<const int>dimensionIndexes = {},
174 int timeDimensionIndexLength = 1,
175 std::span<const int>dimensionLengths = {}) const = 0;
176
183 virtual void setValue(
184 const hydrocouple_variant &data,
185 int timeDimensionIndex,
186 std::span<const int>dimensionIndexes = {}) = 0;
187
197 virtual void setValues(
198 const hydrocouple_variant *data,
199 int timeDimensionIndex,
200 std::span<const int>dimensionIndexes = {},
201 int timeDimensionIndexLength = 1,
202 std::span<const int>dimensionLengths = {}) = 0;
203
204 };
205
211 public virtual ITimeSeriesComponentDataItem
212 {
213
214
215
216 public:
217
226
231
236 [[nodiscard]] virtual std::vector<std::string> identifiers() const = 0;
237
242 [[nodiscard]] virtual IDimension *identifierDimension() const = 0;
243
250 virtual void getValue(
252 int timeIndex,
253 int idIndex,
254 std::span<const int>dimensionIndexes = {}) const = 0;
255
266 virtual void getValues(
268 int timeIndex,
269 int idIndex,
270 std::span<const int>dimensionIndexes = {},
271 int timeIndexLength = 1,
272 int idIndexLength = 1,
273 std::span<const int>dimensionLengths = {}) const = 0;
274
282 virtual void setValue(
283 const hydrocouple_variant &data,
284 int timeIndex,
285 int idIndex,
286 std::span<const int>dimensionIndexes = {}) = 0;
287
299 virtual void setValues(
300 const hydrocouple_variant *data,
301 int timeIndex,
302 int idIndex,
303 std::span<const int>dimensionIndexes = {},
304 int timeIndexLength = 1,
305 int idIndexLength = 1,
306 std::span<const int>dimensionLengths = {}) = 0;
307 };
308 }
309}
310
311#endif // HYDROCOUPLETEMPORAL_H
IComponentDataItem is a fundamental unit of data for a component.
Definition hydrocouple.h:1347
virtual void setValues(const hydrocouple_variant *data, std::span< const int >dimensionIndexes, std::span< const int >dimensionLengths={})=0
Sets a multi-dimensional array of values for given dimension indexes and strides along each dimension...
virtual void getValue(hydrocouple_variant &data, std::span< const int >dimensionIndexes) const =0
Gets a multi-dimensional array of values for given dimension indexes and strides along each dimension...
virtual void setValue(const hydrocouple_variant &data, std::span< const int >dimensionIndexes)=0
Sets a multi-dimensional array of values for given dimension indexes.
virtual void getValues(hydrocouple_variant *data, std::span< const int >dimensionIndexes, std::span< const int >dimensionLengths={}) const =0
Gets a multi-dimensional array of values for given dimension indexes and strides along each dimension...
IDimension provides the properties of the dimensions of a variable.
Definition hydrocouple.h:981
IModelComponent interface is the core interface in the HydroCouple standard defining a model componen...
Definition hydrocouple.h:425
IPropertyChanged interface is used to emit signal/event when a property of an object changes.
Definition hydrocouple.h:202
IDateTime interface based on a Julian day.
Definition hydrocoupletemporal.h:36
virtual double julianDay() const =0
Date and time as a julian day value.
virtual double modifiedJulianDay() const =0
Modified Julian day value.
virtual double serialDate() const =0
Serial date number.
virtual ~IDateTime()=default
~IDateTime destructor.
ITimeIdBasedComponentDataItem is an IComponentDataItem with both temporal and identifier-based dimens...
Definition hydrocoupletemporal.h:212
virtual IDimension * identifierDimension() const =0
idDimensions associated with this dimension.
virtual ~ITimeIdBasedComponentDataItem()=default
~ITimeIdBasedComponentDataItem destructor.
virtual void getValue(hydrocouple_variant &data, int timeIndex, int idIndex, std::span< const int >dimensionIndexes={}) const =0
Gets a single value for given id dimension index.
virtual void getValues(hydrocouple_variant *data, int timeIndex, int idIndex, std::span< const int >dimensionIndexes={}, int timeIndexLength=1, int idIndexLength=1, std::span< const int >dimensionLengths={}) const =0
Gets a multi-dimensional array of values for given id dimension index and size for a hyperslab.
virtual std::vector< std::string > identifiers() const =0
identifiers associated with this dimension.
virtual void setValue(const hydrocouple_variant &data, int timeIndex, int idIndex, std::span< const int >dimensionIndexes={})=0
Sets a single value for given id dimension index.
virtual void setValues(const hydrocouple_variant *data, int timeIndex, int idIndex, std::span< const int >dimensionIndexes={}, int timeIndexLength=1, int idIndexLength=1, std::span< const int >dimensionLengths={})=0
Sets a multi-dimensional array of values for given id dimension index and size for a hyperslab.
ITimeModelComponent is an IModelComponent that advances through time during simulation and provides a...
Definition hydrocoupletemporal.h:83
virtual ITimeSpan * simulationPeriod() const =0
simulationPeriod of the model.
virtual IDateTime * currentDateTime() const =0
Gets the current date and time of the model simulation.
virtual ~ITimeModelComponent()=default
ITimeModelComponent destructor.
ITimeSeriesComponentDataItem is an IComponentItem with a temporal attribute.
Definition hydrocoupletemporal.h:112
virtual ~ITimeSeriesComponentDataItem()=default
~ITimeSeriesComponentDataItem destructor.
virtual void setValue(const hydrocouple_variant &data, int timeDimensionIndex, std::span< const int >dimensionIndexes={})=0
Sets a single value for given time dimension index.
virtual void getValue(hydrocouple_variant &data, int timeDimensionIndex, std::span< const int > dimensionIndexes={}) const =0
Gets a single value for given time dimension index.
virtual void setValues(const hydrocouple_variant *data, int timeDimensionIndex, std::span< const int >dimensionIndexes={}, int timeDimensionIndexLength=1, std::span< const int >dimensionLengths={})=0
Sets a multi-dimensional array of values for given time dimension index and size for a hyperslab.
virtual const IDateTime * time(int timeIndex) const =0
Gets the IDateTime for the given time index.
virtual void getValues(hydrocouple_variant *data, int timeDimensionIndex, std::span< const int >dimensionIndexes={}, int timeDimensionIndexLength=1, std::span< const int >dimensionLengths={}) const =0
Gets a multi-dimensional array of values for given time dimension index and size for a hyperslab.
virtual IDimension * timeDimension() const =0
Gets the IDimension of the times.
virtual int timeCount() const =0
Gets the number of times.
virtual ITimeSpan * timeSpan() const =0
Gets the ITimeSpan associated with this data item.
ITimeSpan specifies a time duration.
Definition hydrocoupletemporal.h:63
virtual double duration() const =0
Duration of the timespan in days.
virtual ~ITimeSpan()=default
~ITimeSpan destructor.
Core interface definitions for the HydroCouple component-based modeling framework.
HydroCouple namespace contains the core interface specifications for the HydroCouple component-based ...
Definition hydrocouple.h:61
std::variant< std::monostate, bool, char, int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, float, double, long double, std::string, std::any > hydrocouple_variant
hydrocouple_variant is a variant type that can be used to store the core value types values of differ...
Definition hydrocouple.h:104