Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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

internal data type (64Bit integer)

Constructor & Destructor Documentation

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

Member Function Documentation

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

returns string representation of the times age

static Time icl::utils::Time::microSeconds ( value_type  )
static
static Time icl::utils::Time::milliSeconds ( value_type  )
static
static Time icl::utils::Time::now ( )
static
bool icl::utils::Time::operator!= ( const Time rhs) const
inline
Time icl::utils::Time::operator* ( const Time rhs) const
inline
Time icl::utils::Time::operator* ( int  rhs) const
inline
Time icl::utils::Time::operator* ( value_type  rhs) const
inline
Time icl::utils::Time::operator* ( double  rhs) const
inline
Time& icl::utils::Time::operator*= ( const Time rhs)
inline
Time& icl::utils::Time::operator*= ( int  rhs)
inline
Time& icl::utils::Time::operator*= ( value_type  rhs)
inline
Time& icl::utils::Time::operator*= ( double  rhs)
inline
Time icl::utils::Time::operator+ ( const Time rhs) const
inline
Time& icl::utils::Time::operator+= ( const Time rhs)
inline
Time icl::utils::Time::operator- ( ) const
inline
Time icl::utils::Time::operator- ( const Time rhs) const
inline
Time& icl::utils::Time::operator-= ( const Time rhs)
inline
Time icl::utils::Time::operator/ ( const Time rhs) const
inline
Time icl::utils::Time::operator/ ( int  rhs) const
inline
Time icl::utils::Time::operator/ ( value_type  rhs) const
inline
Time icl::utils::Time::operator/ ( double  rhs) const
inline
Time& icl::utils::Time::operator/= ( const Time rhs)
inline
Time& icl::utils::Time::operator/= ( int  rhs)
inline
Time& icl::utils::Time::operator/= ( value_type  rhs)
inline
Time& icl::utils::Time::operator/= ( double  rhs)
inline
bool icl::utils::Time::operator< ( const Time rhs) const
inline
bool icl::utils::Time::operator<= ( const Time rhs) const
inline
bool icl::utils::Time::operator== ( const Time rhs) const
inline
bool icl::utils::Time::operator> ( const Time rhs) const
inline
bool icl::utils::Time::operator>= ( const Time rhs) const
inline
void icl::utils::Time::printAge ( const std::string &  title = "") const
inline

alternative function name for showAge

static Time icl::utils::Time::seconds ( value_type  )
static
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");
value_type icl::utils::Time::toMicroSeconds ( ) const
double icl::utils::Time::toMicroSecondsDouble ( ) const
value_type icl::utils::Time::toMilliSeconds ( ) const
double icl::utils::Time::toMilliSecondsDouble ( ) const
value_type icl::utils::Time::toSeconds ( ) const
double icl::utils::Time::toSecondsDouble ( ) const
std::string icl::utils::Time::toString ( ) const
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

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

writes Time instances value type into the stream

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

reads Time instances value type from the stream

Member Data Documentation

value_type icl::utils::Time::m_usec
private
const Time icl::utils::Time::null
static

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