GaStatValue template class stores single statistical value and keeps track of changes of that value between generations.
More...
#include <source/Statistics.h>
Public Member Functions | |
| GaStatValue (T current, T previous) | |
| Initialize statistical values with user defined values for current and previous generations. | |
| GaStatValue () | |
| Initializes statistical values with zero values. | |
| T GACALL | GetCurrent () const |
| This method is not thread-safe. | |
| void GACALL | SetCurrent (T value) |
SetCurrent method sets value for the current generation. | |
| T GACALL | GetPrevious () const |
| This method is not thread-safe. | |
| void GACALL | SetPrevious (T value) |
SetPrevious method sets value for the previous generation. | |
| bool GACALL | Changed () const |
Changed method checks for changes of value between generations. | |
| GaStatValue< T > GACALL | operator+ (const GaStatValue< T > &rhs) |
operator + makes new object by summing corresponding values of this object and rhs object. | |
| GaStatValue< T > &GACALL | operator+= (const GaStatValue< T > &rhs) |
operator += adds corresponding values of rhs object and this object. | |
Private Attributes | |
| T | _current |
| Stores statistical value of current generation. | |
| T | _previous |
| Stores statistical value from previous generation. | |
GaStatValue template class stores single statistical value and keeps track of changes of that value between generations.
This class has no built-in synchronizator, so LOCK_OBJECT and LOCK_THIS_OBJECT macros cannot be used with instances of this class. No public or private methods are thread-safe.
| T | type of statistical value. |
| Common::GaStatValue< T >::GaStatValue | ( | T | current, | |
| T | previous | |||
| ) | [inline] |
Initialize statistical values with user defined values for current and previous generations.
| current | value for the current generation. | |
| previous | value for the previous generation. |
| Common::GaStatValue< T >::GaStatValue | ( | ) | [inline] |
Initializes statistical values with zero values.
| T GACALL Common::GaStatValue< T >::GetCurrent | ( | ) | const [inline] |
This method is not thread-safe.
| void GACALL Common::GaStatValue< T >::SetCurrent | ( | T | value | ) | [inline] |
SetCurrent method sets value for the current generation.
This method is not thread safe.
| value | new value for the current generation. |
| T GACALL Common::GaStatValue< T >::GetPrevious | ( | ) | const [inline] |
This method is not thread-safe.
| void GACALL Common::GaStatValue< T >::SetPrevious | ( | T | value | ) | [inline] |
SetPrevious method sets value for the previous generation.
This method is not thread safe.
| value | new value for the previous generation. |
| bool GACALL Common::GaStatValue< T >::Changed | ( | ) | const [inline] |
Changed method checks for changes of value between generations.
This method is not thread-safe.
true if value from previous generation has changed, otherwise it returns false.| GaStatValue<T> GACALL Common::GaStatValue< T >::operator+ | ( | const GaStatValue< T > & | rhs | ) | [inline] |
operator + makes new object by summing corresponding values of this object and rhs object.
This method is not thread-safe.
| rhs | reference to the second object which is used for summing, the first object is this object. |
| GaStatValue<T>& GACALL Common::GaStatValue< T >::operator+= | ( | const GaStatValue< T > & | rhs | ) | [inline] |
operator += adds corresponding values of rhs object and this object.
This operator is not thread-safe.
| rhs | reference to the second object which is used for summing, the first object is this object. |
this object.
T Common::GaStatValue< T >::_current [private] |
Stores statistical value of current generation.
T Common::GaStatValue< T >::_previous [private] |
Stores statistical value from previous generation.