Image Component Library (ICL)
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Friends | List of all members
icl::utils::Time Class Reference

ICL Time class (taken from the Ice lib) More...

#include <Time.h>

Public Types

typedef int64_t value_type
 internal data type (64Bit integer) More...
 

Public Member Functions

 Time ()
 
 Time (value_type)
 
value_type toSeconds () const
 
value_type toMilliSeconds () const
 
value_type toMicroSeconds () const
 
double toSecondsDouble () const
 
double toMilliSecondsDouble () const
 
double toMicroSecondsDouble () const
 
std::string toString () const
 
std::string toStringFormated (const std::string &pattern, unsigned int bufferSize=32, bool zeropadded=false) const
 allows to create a formated string using strftime system-functions More...
 
Time age () const
 
std::string getAgeString () const
 returns string representation of the times age More...
 
void showAge (const std::string &title="") const
 common function for simple benchmarking More...
 
void printAge (const std::string &title="") const
 alternative function name for showAge More...
 
Time operator- () const
 
Time operator- (const Time &rhs) const
 
Time operator+ (const Time &rhs) const
 
Timeoperator+= (const Time &rhs)
 
Timeoperator-= (const Time &rhs)
 
bool operator< (const Time &rhs) const
 
bool operator<= (const Time &rhs) const
 
bool operator> (const Time &rhs) const
 
bool operator>= (const Time &rhs) const
 
bool operator== (const Time &rhs) const
 
bool operator!= (const Time &rhs) const
 
Timeoperator *= (const Time &rhs)
 
Time operator * (const Time &rhs) const
 
Timeoperator/= (const Time &rhs)
 
Time operator/ (const Time &rhs) const
 
Timeoperator *= (int rhs)
 
Time operator * (int rhs) const
 
Timeoperator/= (int rhs)
 
Time operator/ (int rhs) const
 
Timeoperator *= (value_type rhs)
 
Time operator * (value_type rhs) const
 
Timeoperator/= (value_type rhs)
 
Time operator/ (value_type rhs) const
 
Timeoperator *= (double rhs)
 
Time operator * (double rhs) const
 
Timeoperator/= (double rhs)
 
Time operator/ (double rhs) const
 

Static Public Member Functions

static Time now ()
 
static Time seconds (value_type)
 
static Time milliSeconds (value_type)
 
static Time microSeconds (value_type)
 

Static Public Attributes

static const Time null
 

Private Attributes

value_type m_usec
 

Friends

ICLUtils_API std::ostream & operator<< (std::ostream &, const Time &)
 writes Time instances value type into the stream More...
 
ICLUtils_API std::istream & operator>> (std::istream &, Time &)
 reads Time instances value type from the stream More...
 

Detailed Description

ICL Time class (taken from the Ice lib)

Member Typedef Documentation

◆ value_type

internal data type (64Bit integer)

Constructor & Destructor Documentation

◆ Time() [1/2]

icl::utils::Time::Time ( )

◆ Time() [2/2]

icl::utils::Time::Time ( value_type  )

Member Function Documentation

◆ age()

Time icl::utils::Time::age ( ) const
inline

◆ getAgeString()

std::string icl::utils::Time::getAgeString ( ) const
inline

returns string representation of the times age

◆ microSeconds()

static Time icl::utils::Time::microSeconds ( value_type  )
static

◆ milliSeconds()

static Time icl::utils::Time::milliSeconds ( value_type  )
static

◆ now()

static Time icl::utils::Time::now ( )
static

◆ operator *() [1/4]

Time icl::utils::Time::operator * ( const Time rhs) const
inline

◆ operator *() [2/4]

Time icl::utils::Time::operator * ( int  rhs) const
inline

◆ operator *() [3/4]

Time icl::utils::Time::operator * ( value_type  rhs) const
inline

◆ operator *() [4/4]

Time icl::utils::Time::operator * ( double  rhs) const
inline

◆ operator *=() [1/4]

Time& icl::utils::Time::operator *= ( const Time rhs)
inline

◆ operator *=() [2/4]

Time& icl::utils::Time::operator *= ( int  rhs)
inline

◆ operator *=() [3/4]

Time& icl::utils::Time::operator *= ( value_type  rhs)
inline

◆ operator *=() [4/4]

Time& icl::utils::Time::operator *= ( double  rhs)
inline

◆ operator!=()

bool icl::utils::Time::operator!= ( const Time rhs) const
inline

◆ operator+()

Time icl::utils::Time::operator+ ( const Time rhs) const
inline

◆ operator+=()

Time& icl::utils::Time::operator+= ( const Time rhs)
inline

◆ operator-() [1/2]

Time icl::utils::Time::operator- ( ) const
inline

◆ operator-() [2/2]

Time icl::utils::Time::operator- ( const Time rhs) const
inline

◆ operator-=()

Time& icl::utils::Time::operator-= ( const Time rhs)
inline

◆ operator/() [1/4]

Time icl::utils::Time::operator/ ( const Time rhs) const
inline

◆ operator/() [2/4]

Time icl::utils::Time::operator/ ( int  rhs) const
inline

◆ operator/() [3/4]

Time icl::utils::Time::operator/ ( value_type  rhs) const
inline

◆ operator/() [4/4]

Time icl::utils::Time::operator/ ( double  rhs) const
inline

◆ operator/=() [1/4]

Time& icl::utils::Time::operator/= ( const Time rhs)
inline

◆ operator/=() [2/4]

Time& icl::utils::Time::operator/= ( int  rhs)
inline

◆ operator/=() [3/4]

Time& icl::utils::Time::operator/= ( value_type  rhs)
inline

◆ operator/=() [4/4]

Time& icl::utils::Time::operator/= ( double  rhs)
inline

◆ operator<()

bool icl::utils::Time::operator< ( const Time rhs) const
inline

◆ operator<=()

bool icl::utils::Time::operator<= ( const Time rhs) const
inline

◆ operator==()

bool icl::utils::Time::operator== ( const Time rhs) const
inline

◆ operator>()

bool icl::utils::Time::operator> ( const Time rhs) const
inline

◆ operator>=()

bool icl::utils::Time::operator>= ( const Time rhs) const
inline

◆ printAge()

void icl::utils::Time::printAge ( const std::string &  title = "") const
inline

alternative function name for showAge

◆ seconds()

static Time icl::utils::Time::seconds ( value_type  )
static

◆ showAge()

void icl::utils::Time::showAge ( const std::string &  title = "") const
inline

common function for simple benchmarking

// some stuff that must be benchmarked
t.showAge("my stuff");

◆ toMicroSeconds()

value_type icl::utils::Time::toMicroSeconds ( ) const

◆ toMicroSecondsDouble()

double icl::utils::Time::toMicroSecondsDouble ( ) const

◆ toMilliSeconds()

value_type icl::utils::Time::toMilliSeconds ( ) const

◆ toMilliSecondsDouble()

double icl::utils::Time::toMilliSecondsDouble ( ) const

◆ toSeconds()

value_type icl::utils::Time::toSeconds ( ) const

◆ toSecondsDouble()

double icl::utils::Time::toSecondsDouble ( ) const

◆ toString()

std::string icl::utils::Time::toString ( ) const

◆ toStringFormated()

std::string icl::utils::Time::toStringFormated ( const std::string &  pattern,
unsigned int  bufferSize = 32,
bool  zeropadded = false 
) const

allows to create a formated string using strftime system-functions

Please refer to your system dependent strftime reference: please note, that strftime is does not support milli and micro-second accuracy, . So this feature is implemented here. Please use

  • %* for the remaining usecs less then the last second
  • %# for the remaining milliseconds less then the last second
  • %- for the remaining usecs less then the last millisecond

For example, the default toString() functions uses this time patterns: "%x %H:%M:%S:%#"

Friends And Related Function Documentation

◆ operator<<

ICLUtils_API std::ostream& operator<< ( std::ostream &  ,
const Time  
)
friend

writes Time instances value type into the stream

◆ operator>>

ICLUtils_API std::istream& operator>> ( std::istream &  ,
Time  
)
friend

reads Time instances value type from the stream

Member Data Documentation

◆ m_usec

value_type icl::utils::Time::m_usec
private

◆ null

const Time icl::utils::Time::null
static

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