IGSTK
|
TimeStamp provides periods of validity for data. More...
#include <igstkTimeStamp.h>
Public Types | |
typedef double | TimePeriodType |
Public Member Functions | |
TimeStamp () | |
Constructor and destructor. | |
virtual | ~TimeStamp () |
const TimeStamp & | operator= (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. |
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.
Definition at line 55 of file igstkTimeStamp.h.
typedef double igstk::TimeStamp::TimePeriodType |
Definition at line 60 of file igstkTimeStamp.h.
igstk::TimeStamp::TimeStamp | ( | ) |
Constructor and destructor.
|
virtual |
|
static |
Define the longest time period on the machine.
|
static |
Get the zero time period on the machine.
Compute the intersection of two time stamps.
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 |
|
protected |
|
protected |
|
protectedvirtual |
Print the object information in a stream.