DUtils::TimeManager::iterator Class Reference

Iterator of managed data (these data are copied). More...

#include <TimeManager.h>

List of all members.

Public Member Functions

bool good () const
void operator++ ()
void operator-- ()
void operator+= (int n)
void step (double secs)
void setFrequency (float frequency)

Public Attributes

int index
Timestamp timestamp
 Current timestamp (if the iterator is valid).

Protected Member Functions

void set (const Timestamp &desired_time, bool moving_backwards=false)

Protected Attributes

float m_frequency
 Frequency at which the iterator moves.
const TimeManagerm_tm
 TimeManager associated to this iterator.

Friends

class TimeManager

Detailed Description

Iterator of managed data (these data are copied).


Member Function Documentation

bool DUtils::TimeManager::iterator::good (  )  const [inline]

Returns whether this iterator is valid (if not, the sequences has been iterated until the end)

Returns:
true if the iterator is valid
void TimeManager::iterator::operator++ (  ) 

Moves the iterator to the next timestamp according to the frequency The timestamp of the returned iterator is the smallest one that is greater or equal to the current time + frequency^-1 (or to the next timestamps if frequency is -1)

void TimeManager::iterator::operator+= ( int  n  ) 

Sum n steps of "frequency" size to the current iterator

Parameters:
n 
void TimeManager::iterator::operator-- (  ) 

Moves the iterator to the previous timestamp according to the frequency The timestamp of the returned iterator is the smallest one that is greater or equal to the current time - frequency^-1 (or to the previous timestamps if frequency is -1)

void TimeManager::iterator::set ( const Timestamp desired_time,
bool  moving_backwards = false 
) [protected]

Tries to set the iterator pointing to the desired time (other than the current one)

Parameters:
desired_time 
moving_backwards says iif the time is moving backwards
void DUtils::TimeManager::iterator::setFrequency ( float  frequency  )  [inline]

Sets a new frequency for this iterator

Parameters:
frequency 
void TimeManager::iterator::step ( double  secs  ) 

Moves the iterator secs seconds forward

Parameters:
secs 

Friends And Related Function Documentation

friend class TimeManager [friend]

Tries to set the iterator pointing to the desired time

Parameters:
desired_time 
geq_order if true, the timestamp set is the first one that is >= desired_time. If false, the timestamp set is the last one that is < desired_time

Member Data Documentation

Index of the current timestamp as it was inserted into the TimeManager or -1 if the index is not valid (all the timestamp collection was traversed)


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Enumerations Friends
Generated on Thu Feb 7 19:16:00 2013 by  doxygen 1.6.3