B2BITS FIX Antenna HFT  1.0.13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
System::StatTime Class Reference

Represents a time representation, specific for statistics calculation. More...

#include <FE_SYS_Time.h>

Public Member Functions

int calcDiff (const StatTime &rval, bool inMs=true) const
 Calculates difference between two times. More...
 
void fromLong (u64 time)
 Converts time value to internal representation from u64. More...
 
bool fromString (const std::string &time)
 Converts time value to internal representation from std::string. More...
 
bool isEmpty () const
 Returns true if object is not initialized. More...
 
 StatTime ()
 Constructor. More...
 
 StatTime (const StatTime &)
 Copy constructor. More...
 
 StatTime (u64 time)
 Constructor. More...
 
 StatTime (const std::string &time)
 Constructor. More...
 
u64 toLong (bool inMs=true) const
 Converts internal representation of time to u64 value. More...
 
std::string toString (bool withMs=true, bool timeOnly=false) const
 Converts internal representation of time to std::string value. More...
 
void trimMs ()
 Trims milliseconds and keeps value rounded to nearest lover seconds value. More...
 

Detailed Description

Represents a time representation, specific for statistics calculation.

Constructor & Destructor Documentation

System::StatTime::StatTime ( )

Constructor.

Constructs an empty object.

System::StatTime::StatTime ( const StatTime )

Copy constructor.

System::StatTime::StatTime ( u64  time)

Constructor.

Constructs objects and initializes it from u64.

System::StatTime::StatTime ( const std::string &  time)

Constructor.

Constructs objects and initializes it from std::string.

Note
std::string has format: "YYYYMMDD-HH:MM:SS.sss", milliseconds value is optional.

Member Function Documentation

int System::StatTime::calcDiff ( const StatTime rval,
bool  inMs = true 
) const

Calculates difference between two times.

Parameters
rvalit is subtrahend.
inMsif false it indicates that rtesult is expected in seconds, otherwise result in milliseconds.
void System::StatTime::fromLong ( u64  time)

Converts time value to internal representation from u64.

bool System::StatTime::fromString ( const std::string &  time)

Converts time value to internal representation from std::string.

Note
std::string must have format "YYYYMMDD-HH:MM:SS.sss", milliseconds value is optional.
bool System::StatTime::isEmpty ( ) const

Returns true if object is not initialized.

u64 System::StatTime::toLong ( bool  inMs = true) const

Converts internal representation of time to u64 value.

Parameters
inMsif it true, the return value is in milliseconds, otherwise return value in seconds.
std::string System::StatTime::toString ( bool  withMs = true,
bool  timeOnly = false 
) const

Converts internal representation of time to std::string value.

Parameters
inMsif it true, the return value contains milliseconds, otherwise return value is rounded to seconds.
timeOnlyif it true, the return value does not contain "YYYYMMDD", otherwise return value has format "YYYYMMDD-HH:MM:SS.sss".
void System::StatTime::trimMs ( )

Trims milliseconds and keeps value rounded to nearest lover seconds value.