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

#include <mtsIntervalStatistics.h>

Inheritance diagram for mtsIntervalStatistics:
mtsGenericObject cmnGenericObject

Public Types

typedef unsigned long long int TimeTicksType
 
typedef mtsGenericObject BaseType
 

Public Member Functions

double GetAvg (void) const
 
double GetStdDev (void) const
 
double GetMax (void) const
 
double GetMin (void) const
 
double MinComputeTime (void) const
 
double MaxComputeTime (void) const
 
void SetStatisticsUpdatePeriod (const double &time)
 
double GetStatisticsUpdatePeriod (void) const
 
void AddSample (const double sample)
 
void AddComputeTime (const double computeTime)
 
 mtsIntervalStatistics ()
 
 ~mtsIntervalStatistics ()
 
void ToStream (std::ostream &outputStream) const
 
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

Calculate the statistics (avg,std,min,max) on the vector of data that is added one sample at time. AddSample checks if the statistics need to be recalculated after a given period elapses (eg 1sec).

Member Typedef Documentation

Base type

typedef unsigned long long int mtsIntervalStatistics::TimeTicksType

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

Constructor & Destructor Documentation

mtsIntervalStatistics::mtsIntervalStatistics ( )
mtsIntervalStatistics::~mtsIntervalStatistics ( )
inline

Member Function Documentation

void mtsIntervalStatistics::AddComputeTime ( const double  computeTime)
void mtsIntervalStatistics::AddSample ( const double  sample)

Add one sample to compute statistics

virtual void mtsIntervalStatistics::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.

double mtsIntervalStatistics::GetAvg ( void  ) const
inline

The measured sample average.

double mtsIntervalStatistics::GetMax ( void  ) const
inline

The measured maximum period of the task

double mtsIntervalStatistics::GetMin ( void  ) const
inline

The measured task period (difference between current Tic and previous Tic).

double mtsIntervalStatistics::GetStatisticsUpdatePeriod ( void  ) const
inline

Get time period between period statistics calculations

double mtsIntervalStatistics::GetStdDev ( void  ) const
inline

The measured minimum period of the task

double mtsIntervalStatistics::MaxComputeTime ( void  ) const
inline

Get maximum compute time.

double mtsIntervalStatistics::MinComputeTime ( void  ) const
inline

Get minimum compute time.

void mtsIntervalStatistics::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.

void mtsIntervalStatistics::SetStatisticsUpdatePeriod ( const double &  time)
inline

Time period between period statistics calculations

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

Human readable text output

Reimplemented from mtsGenericObject.

void mtsIntervalStatistics::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: