code::DataTypeHistory< T > Class Template Reference

List of all members.

Detailed Description

template<class T>
class code::DataTypeHistory< T >

Maintains a queue of the given DataType, expiring old data as new data is added.

The length of the queue is determined by the periodicity of the data and the desired history.

See also:
SparseGrid to minimize memory problems.
Author:
Lakshman
Version:
Id
code_DataTypeHistory.h,v 1.8 2011/01/27 20:44:09 lakshman Exp


Public Member Functions

const std::vector< T > & data () const
std::vector< T > & data ()
const code::TimeIntervalgetHistory () const
void addData (const T &rs)
 will add this DataType to the queue, expiring as many DataType's are required to barely maintain the history.
void setHistory (const TimeInterval &history)
 change the history.
 DataTypeHistory (const TimeInterval &h=TimeInterval::Hours(1))
 Construct with desired history of the queue.


Constructor & Destructor Documentation

template<class T>
code::DataTypeHistory< T >::DataTypeHistory ( const TimeInterval h = TimeInterval::Hours(1)  )  [inline]

Construct with desired history of the queue.


Member Function Documentation

template<class T>
void code::DataTypeHistory< T >::addData ( const T &  rs  )  [inline]

will add this DataType to the queue, expiring as many DataType's are required to barely maintain the history.

template<class T>
std::vector< T >& code::DataTypeHistory< T >::data (  )  [inline]

template<class T>
const std::vector< T >& code::DataTypeHistory< T >::data (  )  const [inline]

template<class T>
const code::TimeInterval& code::DataTypeHistory< T >::getHistory (  )  const [inline]

template<class T>
void code::DataTypeHistory< T >::setHistory ( const TimeInterval history  )  [inline]

change the history.

If you reduce the history, records will be expired, but if you increase the history, expired DataType's do not magically reappear. Once gone, they are gone.


Generated on Fri May 4 13:40:11 2012 for WDSS-IIw2 by  doxygen 1.4.7