cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
mtsStateIndex Class Reference

#include <mtsStateIndex.h>

Inheritance diagram for mtsStateIndex:
mtsGenericObject cmnGenericObject

Public Types

typedef unsigned long long int TimeTicksType
 
typedef mtsGenericObject BaseType
 

Public Member Functions

 mtsStateIndex ()
 
 mtsStateIndex (double timestamp, int index, TimeTicksType ticks, int Length)
 
 ~mtsStateIndex ()
 
int Length (void) const
 
int Index (void) const
 
TimeTicksType Ticks (void) const
 
mtsStateIndexoperator-- ()
 
mtsStateIndexoperator-= (int number)
 
mtsStateIndex operator- (int number)
 
bool operator== (const mtsStateIndex &that) const
 
bool operator!= (const mtsStateIndex &that) const
 
virtual void ToStream (std::ostream &outputStream) const
 
virtual void ToStreamRaw (std::ostream &outputStream, const char delimiter= ' ', bool headerOnly=false, const std::string &headerPrefix="") const
 
void SerializeRaw (std::ostream &outputStream) const
 
virtual void DeSerializeRaw (std::istream &inputStream)
 
- Public Member Functions inherited from mtsGenericObject
 mtsGenericObject (void)
 
 mtsGenericObject (double timestamp, bool automaticTimestamp, bool valid)
 
 mtsGenericObject (const mtsGenericObject &other)
 
virtual ~mtsGenericObject (void)
 
bool SetTimestampIfAutomatic (double timestamp)
 
virtual bool FromStreamRaw (std::istream &inputStream, const char delimiter= ' ')
 
size_t ScalarNumber (void) const
 
bool ScalarNumberIsFixed (void) const
 
double Scalar (const size_t index) const throw (std::out_of_range)
 
std::string ScalarDescription (const size_t index, const std::string &userDescription="") const throw (std::out_of_range)
 
- Public Member Functions inherited from cmnGenericObject
virtual ~cmnGenericObject (void)
 
virtual const
cmnClassServicesBase
Services (void) const =0
 
bool ReconstructFrom (const cmnGenericObject &other)
 
std::string ToString (void) const
 
virtual cmnLogger::StreamBufTypeGetLogMultiplexer (void) const
 
virtual double Scalar (const size_t CMN_UNUSED(index)) const throw (std::out_of_range)
 
virtual std::string ScalarDescription (const size_t CMN_UNUSED(index), const std::string &CMN_UNUSED(userDescription)) const
 

Detailed Description

The time indexing of state data is provided by the mtsStateIndex class.

Each iteration of the Task Loop increments a tick counter, which is stored as an unsigned long. (mtsTimeTicks). A mtsStateIndex object contains the following information: The tick value is stored in the mtsStateIndex class to act as a data validity check. This is used to ensure that the circular buffer has not wrapped around and overwritten the index entry between the time that the mtsStateIndex object was created and the time it was used.

Member Typedef Documentation

Base type

typedef unsigned long long int mtsStateIndex::TimeTicksType

TimeTicks are typedef'ed as unsigned long long (64 bits)

Constructor & Destructor Documentation

mtsStateIndex::mtsStateIndex ( )
inline

Default constructor. Does nothing.

mtsStateIndex::mtsStateIndex ( double  timestamp,
int  index,
TimeTicksType  ticks,
int  Length 
)
inline

Default constructor. Does nothing.

mtsStateIndex::~mtsStateIndex ( )
inline

Default destructor. Does nothing.

Member Function Documentation

virtual void mtsStateIndex::DeSerializeRaw ( std::istream &  inputStream)
virtual

De-serialize the content of the object without any extra information, i.e. no class type nor format version.

Reimplemented from mtsGenericObject.

int mtsStateIndex::Index ( void  ) const
inline
int mtsStateIndex::Length ( void  ) const
inline

The length of the circular buffer.

bool mtsStateIndex::operator!= ( const mtsStateIndex that) const
inline

Overloaded operator

mtsStateIndex mtsStateIndex::operator- ( int  number)
inline

Overloaded operator

mtsStateIndex& mtsStateIndex::operator-- ( void  )
inline

Note that the increment operators are not defined for this class, since we dont want future times.

mtsStateIndex& mtsStateIndex::operator-= ( int  number)
inline

Overloaded operator

bool mtsStateIndex::operator== ( const mtsStateIndex that) const
inline

The comparison operators

void mtsStateIndex::SerializeRaw ( std::ostream &  outputStream) const
virtual

Serialize the content of the object without any extra information, i.e. no class type nor format version. The "receiver" is supposed to already know what to expect.

Reimplemented from mtsGenericObject.

TimeTicksType mtsStateIndex::Ticks ( void  ) const
inline

Return the ticks corresponding to the time.

virtual void mtsStateIndex::ToStream ( std::ostream &  outputStream) const
virtual

Human readable text output

Reimplemented from mtsGenericObject.

virtual void mtsStateIndex::ToStreamRaw ( std::ostream &  outputStream,
const char  delimiter = ' ',
bool  headerOnly = false,
const std::string &  headerPrefix = "" 
) const
virtual

Machine reabable text output

Reimplemented from mtsGenericObject.


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