UI::Util::RealTimeStamp Class Reference

RealTimeStamp class encapsulating "gettimeofday". More...

`#include <Time.hpp>`

Inheritance diagram for UI::Util::RealTimeStamp:
Collaboration diagram for UI::Util::RealTimeStamp:

## Public Types

enum | ErrorCode { NegativeStamp_ =1 }
| Error codes for exceptions.
typedef CodeException< ErrorCode > | Exception
| This classes exceptions.

## Public Member Functions

| RealTimeStamp (long int const &sec=0, long int const &usec=0)
| Standard constructor.
RealTimeStamp & | set (long int const &sec, long int const &usec)
| Set time stamp manually.
RealTimeStamp & | setMax ()
| Set this stamp to maximum.
RealTimeStamp & | setMin ()
| Set this stamp to minimum (Epoch).
RealTimeStamp & | stamp ()
| Set time stamp from current time.
long int | getSec () const
| Get seconds since Epoch.
long int | getUSec () const
| Get micro seconds since Epoch+sec.
long double | getSeconds () const
| Get seconds (since Epoch) as real number (including micro seconds).
bool | operator== (RealTimeStamp const &rt) const
| Standard == operator.
bool | operator< (RealTimeStamp const &rt) const
| Standard < operator.
bool | operator<= (RealTimeStamp const &rt) const
| Standard <= operator.
RealTimeStamp & | operator+= (RealTimeStamp const &rt)
| Standard += operator.
RealTimeStamp | operator+ (RealTimeStamp const &rt) const
| Standard + operator.
RealTimeStamp & | operator-= (RealTimeStamp const &rt)
| Standard -= operator.
RealTimeStamp | operator- (RealTimeStamp const &rt) const
| Standard - operator.

## Detailed Description

RealTimeStamp class encapsulating "gettimeofday".

See also
  time(2) (POSIX), gettimeofday(2) (BSD).

## Constructor & Destructor Documentation

## RealTimeStamp()

UI::Util::RealTimeStamp::RealTimeStamp | ( | long int const & | sec = 0,
|  | long int const & | usec = 0 )

Standard constructor.

Parameters

  sec | Seconds since Epoch.
  usec | Micro (10^-6) seconds since Epoch+sec.

Note
  Values will be "normalised" (make microseconds < 10^6). Altogether, it must not be a negative date (before Epoch).

References set().

Referenced by operator+(), operator+=(), operator-(), operator-=(), operator<(), operator<=(), operator==(), set(), setMax(), setMin(), and stamp().

## Member Function Documentation

## set()

RealTimeStamp & UI::Util::RealTimeStamp::set | ( | long int const & | sec,
|  | long int const & | usec )

Set time stamp manually.

Parameters

  sec | Seconds since Epoch.
  usec | Micro (10^-6) seconds since Epoch+sec.

Returns
  Reference to itself

References RealTimeStamp().

Referenced by RealTimeStamp(), and setMin().

## stamp()

RealTimeStamp & UI::Util::RealTimeStamp::stamp | ( |  | ) |

Set time stamp from current time.

Returns
  Reference to itself

References RealTimeStamp().

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

- Time.hpp
- Time.cpp