19 TYPE
value()
const {
return value_; }
29 old_value_ = new_value;
34 void set_value(TYPE new_value) { old_value_ = std::exchange(value_, new_value); }
Top-level namespace for Health-GPS C++ API.
Definition: analysis_definition.h:8
Defines a two step value data type.
Definition: two_step_value.h:9
void operator=(TYPE new_value)
Sets the current value.
Definition: two_step_value.h:42
TwoStepValue< TYPE > clone()
Creates a new instance from this contents.
Definition: two_step_value.h:46
TYPE value() const
Gets the current value.
Definition: two_step_value.h:19
TwoStepValue(TYPE value)
Initialise a new instance of the TwoStepValue type.
Definition: two_step_value.h:15
void set_value(TYPE new_value)
Sets the current value.
Definition: two_step_value.h:34
TwoStepValue()=default
Initialise a new instance of the TwoStepValue type.
TYPE old_value() const
Gets the previous value.
Definition: two_step_value.h:23
TYPE operator()() const
Gets the current value.
Definition: two_step_value.h:38
void set_both_values(TYPE new_value)
Sets both current and previous values to the same value.
Definition: two_step_value.h:27