igstk::TimeStamp Class Reference

TimeStamp provides periods of validity for data. More...

#include <igstkTimeStamp.h>

List of all members.

Public Types

typedef double TimePeriodType

Public Member Functions

 TimeStamp ()
 Constructor and destructor.
virtual ~TimeStamp ()
const TimeStampoperator= (const TimeStamp &inputTimeStamp)
 Copy one time stamp into another.
void SetStartTimeNowAndExpireAfter (TimePeriodType millisecondsToExpire)
 This method sets both the Start time and the Expiration time of the TimeStamp.
TimePeriodType GetStartTime () const
 Returns the time in milliseconds at which this stamp started to be valid.
TimePeriodType GetExpirationTime () const
 Returns the time in milliseconds at which this stamp will expire.
bool IsValidAtTime (TimePeriodType milliseconds) const
 This method returns 'true' is the current TimeStamp is still valid at the time in milliseconds indicated in the argument.
bool IsValidNow () const
 This method returns 'true' is the current TimeStamp is valid at the time when this method is called.
void Print (std::ostream &os, itk::Indent indent) const

Static Public Member Functions

static TimePeriodType GetLongestPossibleTime ()
 Define the longest time period on the machine.
static TimePeriodType GetZeroValue ()
 Get the zero time period on the machine.
static TimeStamp ComputeOverlap (TimeStamp t1, TimeStamp t2)
 Compute the intersection of two time stamps.

Protected Member Functions

void PrintHeader (std::ostream &os, itk::Indent indent) const
void PrintTrailer (std::ostream &itkNotUsed(os), itk::Indent itkNotUsed(indent)) const
virtual void PrintSelf (std::ostream &os, itk::Indent indent) const
 Print the object information in a stream.


Detailed Description

TimeStamp provides periods of validity for data.

A time stamp consists of two time values. They indicate respectively when a particular data object was acquired and when its data will no longer be valid. The purpose of the time stamp is to make sure that at any given moment the toolkit is only managing information whose validity has not expired. For example, the information of position for a tracked surgical instrument will be valid from the moment it was acquired until a new data is made available. The acquisition rate of a tracker will make possible to define an expiration time for the position information associated with that particular surgical instrument.

Warning:
Clock precision is unfortunately platform-dependent. It is known that Unix systems will provide time resolution of fractions of milliseconds, while Microsoft Windows will only provide milliseconds. Users must be aware of the particular capabilities of the platform they are using for running the software.

TimeStamps are a mechanism for holding relative time periods. They are not reliable as a mechanism for absolute time synchronization. For example, they can not be used for networking synchronization or even multi-machine communications. Times will only be valid inside the current machine, and probably the current process.

Definition at line 55 of file igstkTimeStamp.h.


Member Typedef Documentation

Definition at line 60 of file igstkTimeStamp.h.


Constructor & Destructor Documentation

igstk::TimeStamp::TimeStamp (  ) 

Constructor and destructor.

virtual igstk::TimeStamp::~TimeStamp (  )  [virtual]


Member Function Documentation

static TimePeriodType igstk::TimeStamp::GetLongestPossibleTime (  )  [static]

Define the longest time period on the machine.

static TimePeriodType igstk::TimeStamp::GetZeroValue (  )  [static]

Get the zero time period on the machine.

static TimeStamp igstk::TimeStamp::ComputeOverlap ( TimeStamp  t1,
TimeStamp  t2 
) [static]

Compute the intersection of two time stamps.

const TimeStamp& igstk::TimeStamp::operator= ( const TimeStamp inputTimeStamp  ) 

Copy one time stamp into another.

void igstk::TimeStamp::SetStartTimeNowAndExpireAfter ( TimePeriodType  millisecondsToExpire  ) 

This method sets both the Start time and the Expiration time of the TimeStamp.

The StartTime is set to the current time value as returned by the function clock(). The ExpirationTime is set to the StartTime plus the number of millisecondsToExpire argument provided by the user

TimePeriodType igstk::TimeStamp::GetStartTime (  )  const

Returns the time in milliseconds at which this stamp started to be valid.

This is the time at which the SetStartTimeNowAndExpireAfter() was invoked last time.

TimePeriodType igstk::TimeStamp::GetExpirationTime (  )  const

Returns the time in milliseconds at which this stamp will expire.

This time is computed when the SetStartTimeNowAndExpireAfter() method is invoked. The ExpirationTime is equal to the StartTime plus the value of millisecondsToExpire provided as argument to that method.

bool igstk::TimeStamp::IsValidAtTime ( TimePeriodType  milliseconds  )  const

This method returns 'true' is the current TimeStamp is still valid at the time in milliseconds indicated in the argument.

The purpose of this method is to evaluate what data objects are usable at a particular time snapshot. For example, this method will be used for selecting the display mode of objects that are intended to be presented in a scene rendering at the time specified in the argument.

bool igstk::TimeStamp::IsValidNow (  )  const

This method returns 'true' is the current TimeStamp is valid at the time when this method is called.

void igstk::TimeStamp::Print ( std::ostream &  os,
itk::Indent  indent 
) const

void igstk::TimeStamp::PrintHeader ( std::ostream &  os,
itk::Indent  indent 
) const [protected]

void igstk::TimeStamp::PrintTrailer ( std::ostream &  itkNotUsedos,
itk::Indent   itkNotUsedindent 
) const [protected]

virtual void igstk::TimeStamp::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const [protected, virtual]

Print the object information in a stream.


The documentation for this class was generated from the following file:

Generated on Thu Feb 12 09:45:56 2009 for IGSTK by  doxygen 1.5.8