Health-GPS  1.2.2.0
Global Health Policy Simulation model (Health-GPS)
hgps::TwoStepValue< TYPE > Struct Template Reference

Defines a two step value data type. More...

#include <two_step_value.h>

Public Member Functions

 TwoStepValue ()=default
 Initialise a new instance of the TwoStepValue type. More...
 
 TwoStepValue (TYPE value)
 Initialise a new instance of the TwoStepValue type. More...
 
TYPE value () const
 Gets the current value. More...
 
TYPE old_value () const
 Gets the previous value. More...
 
void set_both_values (TYPE new_value)
 Sets both current and previous values to the same value. More...
 
void set_value (TYPE new_value)
 Sets the current value. More...
 
TYPE operator() () const
 Gets the current value. More...
 
void operator= (TYPE new_value)
 Sets the current value. More...
 
TwoStepValue< TYPE > clone ()
 Creates a new instance from this contents. More...
 

Detailed Description

template<typename TYPE>
struct hgps::TwoStepValue< TYPE >

Defines a two step value data type.

Holds the current and previous value for algorithms requiring both values.

Template Parameters
TYPEThe value type

Constructor & Destructor Documentation

◆ TwoStepValue() [1/2]

template<typename TYPE >
hgps::TwoStepValue< TYPE >::TwoStepValue ( )
default

Initialise a new instance of the TwoStepValue type.

◆ TwoStepValue() [2/2]

template<typename TYPE >
hgps::TwoStepValue< TYPE >::TwoStepValue ( TYPE  value)
inline

Initialise a new instance of the TwoStepValue type.

Parameters
valueCurrent value

Member Function Documentation

◆ clone()

template<typename TYPE >
TwoStepValue<TYPE> hgps::TwoStepValue< TYPE >::clone ( )
inline

Creates a new instance from this contents.

Returns
The cloned instance
Here is the call graph for this function:

◆ old_value()

template<typename TYPE >
TYPE hgps::TwoStepValue< TYPE >::old_value ( ) const
inline

Gets the previous value.

Returns
Previous value
Here is the caller graph for this function:

◆ operator()()

template<typename TYPE >
TYPE hgps::TwoStepValue< TYPE >::operator() ( ) const
inline

Gets the current value.

Returns
Current value

◆ operator=()

template<typename TYPE >
void hgps::TwoStepValue< TYPE >::operator= ( TYPE  new_value)
inline

Sets the current value.

Parameters
new_valueThe new value
Here is the call graph for this function:

◆ set_both_values()

template<typename TYPE >
void hgps::TwoStepValue< TYPE >::set_both_values ( TYPE  new_value)
inline

Sets both current and previous values to the same value.

Parameters
new_valueThe new value

◆ set_value()

template<typename TYPE >
void hgps::TwoStepValue< TYPE >::set_value ( TYPE  new_value)
inline

Sets the current value.

Parameters
new_valueThe new value
Here is the caller graph for this function:

◆ value()

template<typename TYPE >
TYPE hgps::TwoStepValue< TYPE >::value ( ) const
inline

Gets the current value.

Returns
Current value
Here is the caller graph for this function:

The documentation for this struct was generated from the following file: