BALL 1.5.0
Loading...
Searching...
No Matches
BALL::PreciseTime Class Reference

#include <BALL/CONCEPT/timeStamp.h>

Public Member Functions

Constructors and Destructors.
 PreciseTime ()
 
 PreciseTime (const PreciseTime &time)
 
 PreciseTime (long secs, long usecs)
 
virtual ~PreciseTime ()
 
Assignment
void set (long secs, long usecs)
 
void set (const PreciseTime &time)
 
const PreciseTimeoperator= (const PreciseTime &time)
 
virtual void clear ()
 
Predicates
bool operator< (const PreciseTime &time) const
 
bool operator> (const PreciseTime &time) const
 
bool operator== (const PreciseTime &time) const
 

Static Public Attributes

Constants.
static const PreciseTime ZERO
 

Storable interface.

long secs_
 
long usecs_
 
void write (PersistenceManager &pm) const
 
bool read (PersistenceManager &pm)
 

Accessors

long getSeconds () const
 
long getMicroSeconds () const
 
static PreciseTime now ()
 

Detailed Description

Time class. Used to store a point of time. This class provides a higher precision than Time (below seconds).

Interface: Storable

Definition at line 37 of file timeStamp.h.

Constructor & Destructor Documentation

◆ PreciseTime() [1/3]

BALL::PreciseTime::PreciseTime ( )

Default constructor. Initialize with zero.

◆ PreciseTime() [2/3]

BALL::PreciseTime::PreciseTime ( const PreciseTime & time)

Copy constructor

◆ PreciseTime() [3/3]

BALL::PreciseTime::PreciseTime ( long secs,
long usecs )

Detailed constructor

◆ ~PreciseTime()

virtual BALL::PreciseTime::~PreciseTime ( )
virtual

Destructor

Member Function Documentation

◆ clear()

virtual void BALL::PreciseTime::clear ( )
virtual

Clear method

◆ getMicroSeconds()

long BALL::PreciseTime::getMicroSeconds ( ) const

Return the microseconds.

◆ getSeconds()

long BALL::PreciseTime::getSeconds ( ) const

Return the seconds since Jan. 1, 1970.

◆ now()

static PreciseTime BALL::PreciseTime::now ( )
static

Return the current time.

Returns
PreciseTime the current time in seconds since Jan. 1, 1970

◆ operator<()

bool BALL::PreciseTime::operator< ( const PreciseTime & time) const

Greater than operator.

◆ operator=()

const PreciseTime & BALL::PreciseTime::operator= ( const PreciseTime & time)

Assignment operator

◆ operator==()

bool BALL::PreciseTime::operator== ( const PreciseTime & time) const

Equality operator.

◆ operator>()

bool BALL::PreciseTime::operator> ( const PreciseTime & time) const

Lesser than operator.

◆ read()

bool BALL::PreciseTime::read ( PersistenceManager & pm)

Persistent stream reading. This method reads the contents of a PreciseTime object from the persistent stream using the readPrimitive method of the PersistenceManager.

Parameters
pmthe persistence manager

◆ set() [1/2]

void BALL::PreciseTime::set ( const PreciseTime & time)

Assignment method

◆ set() [2/2]

void BALL::PreciseTime::set ( long secs,
long usecs )

Assignment method

◆ write()

void BALL::PreciseTime::write ( PersistenceManager & pm) const

Persistent stream writing. This method writes the contents of the PreciseTime objects to the persistent stream using the writePrimitive method of the PersistenceManager.

Parameters
pmthe persistence manager

Member Data Documentation

◆ secs_

long BALL::PreciseTime::secs_
protected

Definition at line 157 of file timeStamp.h.

◆ usecs_

long BALL::PreciseTime::usecs_
protected

Definition at line 158 of file timeStamp.h.

◆ ZERO

const PreciseTime BALL::PreciseTime::ZERO
static

Zero object.

Definition at line 72 of file timeStamp.h.