Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Friends
icl::utils::Time Class Reference

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

#include <Time.h>

List of all members.

Public Types

typedef int64_t value_type
 internal data type (64Bit integer)

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
Time age () const
std::string getAgeString () const
 returns string representation of the times age
void showAge (const std::string &title="") const
 common function for simple benchmarking
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
ICLUtils_API std::istream & operator>> (std::istream &, Time &)
 reads Time instances value type from the stream

Detailed Description

ICL Time class (taken from the Ice lib)


Member Typedef Documentation

internal data type (64Bit integer)


Constructor & Destructor Documentation


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::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]
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

            Time t = Time::now();
            // some stuff that must be benchmarked
            t.showAge("my stuff");
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

const Time icl::utils::Time::null [static]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines