Uses a variant of the flyweight pattern, the variant being that the number of states is not constant.
Public Types | |
typedef unsigned short | IndexType |
Public Member Functions | |
TimeUpdater () | |
TimeUpdater (size_t a, size_t b, size_t c) | |
The dimensions of the 3D grid each of whose cells is going to be updated at different times. | |
void | setTime (size_t x, size_t y, size_t z, IndexType expiryTime) |
set the time of a grid cell. | |
const time_t & | getTime (size_t x, size_t y, size_t z) |
returns the time of the grid cell. | |
IndexType | getIndex (const time_t &expiryTime) |
The expiryTime passed in should be constantly new . | |
void | removeTimesBefore (time_t earliestTimeAllowed_) |
prunes internally stored times. |
typedef unsigned short vol::TimeUpdater::IndexType |
vol::TimeUpdater::TimeUpdater | ( | ) | [inline] |
vol::TimeUpdater::TimeUpdater | ( | size_t | a, | |
size_t | b, | |||
size_t | c | |||
) |
The dimensions of the 3D grid each of whose cells is going to be updated at different times.
the update times of all of these cells will be set to epoch (1/1/1970).
IndexType vol::TimeUpdater::getIndex | ( | const time_t & | expiryTime | ) |
The expiryTime passed in should be constantly new .
..
const time_t& vol::TimeUpdater::getTime | ( | size_t | x, | |
size_t | y, | |||
size_t | z | |||
) | [inline] |
returns the time of the grid cell.
void vol::TimeUpdater::removeTimesBefore | ( | time_t | earliestTimeAllowed_ | ) | [inline] |
prunes internally stored times.
Needed for sparse grids that don't get aged off appropriately.
void vol::TimeUpdater::setTime | ( | size_t | x, | |
size_t | y, | |||
size_t | z, | |||
IndexType | expiryTime | |||
) | [inline] |
set the time of a grid cell.
Use getIndex() to get IndexType to the expiryTime