cisst-saw
Loading...
Searching...
No Matches
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
void ToStream (std::ostream &outputStream) const override
void ToStreamRaw (std::ostream &outputStream, const char delimiter=' ', bool headerOnly=false, const std::string &headerPrefix="") const override
void SerializeRaw (std::ostream &outputStream) const override
void DeSerializeRaw (std::istream &inputStream) override
Public Member Functions inherited from mtsGenericObject
 mtsGenericObject (void)
 mtsGenericObject (double timestamp, bool automaticTimestamp, bool valid)
 mtsGenericObject (const mtsGenericObject &other)
virtual ~mtsGenericObject (void)
mtsGenericObjectoperator= (const mtsGenericObject &other)
bool SetTimestampIfAutomatic (double timestamp)
virtual bool FromStreamRaw (std::istream &inputStream, const char delimiter=' ')
size_t ScalarNumber (void) const
bool ScalarNumberIsFixed (void) const
Public Member Functions inherited from cmnGenericObject
virtual ~cmnGenericObject (void)
virtual const cmnClassServicesBaseServices (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 CISST_THROW(std
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

◆ BaseType

◆ TimeTicksType

typedef unsigned long long int mtsStateIndex::TimeTicksType

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

Constructor & Destructor Documentation

◆ mtsStateIndex() [1/2]

mtsStateIndex::mtsStateIndex ( )
inline

Default constructor. Does nothing.

◆ mtsStateIndex() [2/2]

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

Default constructor. Does nothing.

◆ ~mtsStateIndex()

mtsStateIndex::~mtsStateIndex ( )
inline

Default destructor. Does nothing.

Member Function Documentation

◆ DeSerializeRaw()

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

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

Reimplemented from mtsGenericObject.

◆ Index()

int mtsStateIndex::Index ( void ) const
inline

◆ Length()

int mtsStateIndex::Length ( void ) const
inline

The length of the circular buffer.

◆ operator!=()

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

Overloaded operator

◆ operator-()

mtsStateIndex mtsStateIndex::operator- ( int number)
inline

Overloaded operator

◆ operator--()

mtsStateIndex & mtsStateIndex::operator-- ( )
inline

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

◆ operator-=()

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

Overloaded operator

◆ operator==()

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

The comparison operators

◆ SerializeRaw()

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

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.

◆ Ticks()

TimeTicksType mtsStateIndex::Ticks ( void ) const
inline

Return the ticks corresponding to the time.

◆ ToStream()

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

Human readable text output

Reimplemented from mtsGenericObject.

◆ ToStreamRaw()

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

Machine reabable text output

Reimplemented from mtsGenericObject.


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