| # Gaudi Framework, version v20r3
Generated: 24 Nov 2008

# TimePoint Class Reference

`#include <GaudiKernel/TimePoint.h>`

Inheritance diagram for TimePoint:

[legend]
Collaboration diagram for TimePoint:

[legend]

List of all members.

## Detailed Description

A very crude and rought implementation of ITime interface.

The internal precision is nanosecond (1.0e-9 seconds)

Definition at line 17 of file TimePoint.h.

## Public Member Functions
| TimePoint ()
| Constructors.
| TimePoint (const ITime::AbsoluteTime &atime)
| TimePoint (const ITime &itime)
| ~TimePoint ()
| Virtual destructor.
ITime::AbsoluteTime | absoluteTime () const
| Accessor to internal representation.
ITime::DimensionedTime | seconds () const
| accessor to representation in seconds
ITime::DimensionedTime | minutes () const
| accessor to representation in minutes
ITime::DimensionedTime | hours () const
| accessor to representation in hours
ITime::DimensionedTime | days () const
| accessor to representation in days
unsigned long | msb () const
| most significant bits
unsigned long | lsb () const
| less significant bits
bool | operator== (const ITime &T) const
| comparison operators
bool | operator!= (const ITime &T) const
bool | operator<= (const ITime &T) const
bool | operator>= (const ITime &T) const
bool | operator< (const ITime &T) const
bool | operator> (const ITime &T) const
ITime & | operator+= (const ITime &T)
| adding
ITime & | operator-= (const ITime &T)
| substract
virtual std::ostream & | printOut (std::ostream &) const
| printout
## Private Attributes
ITime::AbsoluteTime | m_time
## Friends
StreamBuffer & | operator>> (StreamBuffer &s, TimePoint &t)

## Constructor & Destructor Documentation

TimePoint::TimePoint | ( |  | ) | `[inline]`

Constructors.

Definition at line 21 of file TimePoint.h.

    00021 : m_time( time(0) * (longlong)1.0e+9 ) { }

TimePoint::TimePoint | ( | const ITime::AbsoluteTime & | atime | ) | `[inline]`

Definition at line 22 of file TimePoint.h.

    00022 : m_time( atime ) { }

TimePoint::TimePoint | ( | const ITime & | itime | ) | `[inline]`

Definition at line 23 of file TimePoint.h.

    00023 : m_time( itime.absoluteTime() ) { }

TimePoint::~TimePoint | ( |  | ) | `[inline]`

Virtual destructor.

Definition at line 25 of file TimePoint.h.

    00025 { }

## Member Function Documentation

ITime::AbsoluteTime TimePoint::absoluteTime | ( |  | ) | const`[inline, virtual]`

Accessor to internal representation.

Implements ITime.

Definition at line 29 of file TimePoint.h.

    00029 { return m_time; }

ITime::DimensionedTime TimePoint::seconds | ( | void |  | ) | const`[inline, virtual]`

accessor to representation in seconds

Implements ITime.

Definition at line 32 of file TimePoint.h.

    00032 { return (DimensionedTime) ( absoluteTime() / 1.0e+9 ) ; }

ITime::DimensionedTime TimePoint::minutes | ( | void |  | ) | const`[inline, virtual]`

accessor to representation in minutes

Implements ITime.

Definition at line 35 of file TimePoint.h.

    00035 { return seconds() / 60.0 ; }

ITime::DimensionedTime TimePoint::hours | ( | void |  | ) | const`[inline, virtual]`

accessor to representation in hours

Implements ITime.

Definition at line 38 of file TimePoint.h.

    00038 { return minutes() / 60.0 ; }

ITime::DimensionedTime TimePoint::days | ( | void |  | ) | const`[inline, virtual]`

accessor to representation in days

Implements ITime.

Definition at line 41 of file TimePoint.h.

    00041 { return hours  () / 24.0 ; }

unsigned long TimePoint::msb | ( |  | ) | const`[inline]`

most significant bits

Definition at line 44 of file TimePoint.h.

    00044 { return (unsigned long)(m_time >> 32);}

unsigned long TimePoint::lsb | ( |  | ) | const`[inline]`

less significant bits

Definition at line 46 of file TimePoint.h.

    00046 { return (unsigned long)((m_time << 32) >> 32);}

bool TimePoint::operator== | ( | const ITime & | T | ) | const`[inline, virtual]`

comparison operators

Implements ITime.

Definition at line 49 of file TimePoint.h.

    00049 { return absoluteTime()==T.absoluteTime(); }

bool TimePoint::operator!= | ( | const ITime & | T | ) | const`[inline, virtual]`

Implements ITime.

Definition at line 50 of file TimePoint.h.

    00050 { return absoluteTime()!=T.absoluteTime(); }

bool TimePoint::operator<= | ( | const ITime & | T | ) | const`[inline, virtual]`

Implements ITime.

Definition at line 51 of file TimePoint.h.

    00051 { return absoluteTime()<=T.absoluteTime(); }

bool TimePoint::operator>= | ( | const ITime & | T | ) | const`[inline, virtual]`

Implements ITime.

Definition at line 52 of file TimePoint.h.

    00052 { return absoluteTime()>=T.absoluteTime(); }

bool TimePoint::operator< | ( | const ITime & | T | ) | const`[inline, virtual]`

Implements ITime.

Definition at line 53 of file TimePoint.h.

    00053 { return absoluteTime()< T.absoluteTime(); }

bool TimePoint::operator> | ( | const ITime & | T | ) | const`[inline, virtual]`

Implements ITime.

Definition at line 54 of file TimePoint.h.

    00054 { return absoluteTime()> T.absoluteTime(); }

ITime & TimePoint::operator+= | ( | const ITime & | T | ) | `[inline, virtual]`

adding

Implements ITime.

Definition at line 75 of file TimePoint.h.

    00076 {
    00077   m_time +=T.absoluteTime();
    00078   m_time = ( m_time > time_absolutefuture.absoluteTime() )  ? time_absolutefuture.absoluteTime() : m_time ;
    00079   m_time = ( m_time < time_absolutepast  .absoluteTime() )  ? time_absolutepast  .absoluteTime() : m_time ;
    00080   return *this;
    00081 }

ITime & TimePoint::operator-= | ( | const ITime & | T | ) | `[inline, virtual]`

substract

Implements ITime.

Definition at line 84 of file TimePoint.h.

    00085 {
    00086   m_time -= T.absoluteTime();
    00087   m_time  = ( m_time > time_absolutefuture.absoluteTime() )  ? time_absolutefuture.absoluteTime() : m_time ;
    00088   m_time  = ( m_time < time_absolutepast  .absoluteTime() )  ? time_absolutepast  .absoluteTime() : m_time ;
    00089   return *this;
    00090 }

std::ostream & TimePoint::printOut | ( | std::ostream & | os | ) | const`[inline, virtual]`

printout

Implements ITime.

Definition at line 92 of file TimePoint.h.

    00092                                                                {
    00093   return os << "Time is " << seconds() << "[s]";
    00094 }

## Friends And Related Function Documentation

StreamBuffer& operator>> | ( | StreamBuffer & | s,
|  | TimePoint & | t |
| ) |  |  | `[friend]`

Definition at line 106 of file TimePoint.h.

    00106                                                                 {
    00107   return s >> t.m_time;
    00108 }

## Member Data Documentation

ITime::AbsoluteTime TimePoint::m_time`[private]`

Definition at line 67 of file TimePoint.h.

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r3/GaudiKernel/GaudiKernel/TimePoint.h