vol::TimeUpdater Class Reference

List of all members.

Detailed Description

A memory-efficient way of keeping track of time of large grids.

Uses a variant of the flyweight pattern, the variant being that the number of states is not constant.

Author:
Lakshman
Version:
Id
vol_TimeUpdater.h,v 1.8 2010/05/04 18:04:01 lakshman Exp


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.


Member Typedef Documentation

typedef unsigned short vol::TimeUpdater::IndexType


Constructor & Destructor Documentation

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).


Member Function Documentation

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


Generated on Fri May 4 13:40:23 2012 for WDSS-IIw2algs by  doxygen 1.4.7