|
My Project
|
a class for tracking the history of values. More...
#include <ValueTracker.h>
Public Member Functions | |
| void | Reset () |
| make the tracker empty | |
| int | GetSize () |
| Get how many items to be kept in the tracker. | |
| void | SetSize (int nSize) |
| set how many items to be kept in the tracker | |
| void | Push (int time, const T &value) |
| push a new item to the tracker. More... | |
| void | Update (int time, const T &value) |
| update the current (latest) value More... | |
| int | GetTime (int nPos=0) |
| get the time in history. More... | |
| const T & | GetValue (int nPos=0) |
| get the value in history. More... | |
| bool | GetValue (T &value, int nPos) |
| get the value in history. More... | |
| BOOL | CompareWith (const T &right) |
| return true if the last value. More... | |
| bool | IsConstant () |
| return whether all values in the tracker are the same. More... | |
a class for tracking the history of values.
It is used for network values such as player positions, etc. It keeps a history of most recent (time, value) pairs.
|
inline |
return true if the last value.
i.e. GetValue(0) is the same as the passed value if the last value is empty, it will always return false.
| right | with which to compare |
|
inline |
get the time in history.
| nPos | 0 means current one, -1 means last one. 1 means first one |
|
inline |
get the value in history.
| nPos | 0 means current one, -1 means last one. 1 means first one |
|
inline |
get the value in history.
| value | [out] if there is a value at the time, it will be returned in this struct. |
| nPos | 0 means current one, -1 means last one. 1 means first one |
|
inline |
return whether all values in the tracker are the same.
|
inline |
push a new item to the tracker.
| time | |
| value |
|
inline |
update the current (latest) value
| time | |
| value |
1.8.12