hydrobricks
Loading...
Searching...
No Matches
Forcing.h
1#ifndef HYDROBRICKS_FORCING_H
2#define HYDROBRICKS_FORCING_H
3
4#include "Includes.h"
5#include "TimeSeriesData.h"
6
7class Forcing {
8 public:
9 explicit Forcing(VariableType type);
10
11 virtual ~Forcing() = default;
12
18 void AttachTimeSeriesData(TimeSeriesData* timeSeriesData);
19
25 VariableType GetType() const {
26 return _type;
27 }
28
40 [[nodiscard]] bool IsCumulative() const {
41 return _type == VariableType::Precipitation || _type == VariableType::PET;
42 }
43
50 double GetValue() const;
51
59 void UpdateValue(double value);
60
65 void ResetUpdate();
66
73 [[nodiscard]] bool IsValid() const;
74
81 void Validate() const;
82
83 protected:
84 VariableType _type;
85 TimeSeriesData* _timeSeriesData; // non-owning reference
86 double _updatedValue{0.0};
87 bool _hasUpdatedValue{false};
88};
89
90#endif // HYDROBRICKS_FORCING_H
Definition Forcing.h:7
void Validate() const
Definition Forcing.cpp:43
VariableType GetType() const
Definition Forcing.h:25
bool IsValid() const
Definition Forcing.cpp:27
double GetValue() const
Definition Forcing.cpp:12
void UpdateValue(double value)
Definition Forcing.cpp:18
bool IsCumulative() const
Definition Forcing.h:40
void AttachTimeSeriesData(TimeSeriesData *timeSeriesData)
Definition Forcing.cpp:7
void ResetUpdate()
Definition Forcing.cpp:23
Definition TimeSeriesData.h:6