Loading...
Searching...
No Matches
timeStamp.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_CONCEPT_TIMESTAMP_H
#define BALL_CONCEPT_TIMESTAMP_H
#ifndef BALL_CONFIG_CONFIG_H
# include <BALL/CONFIG/config.h>
#endif
#ifndef BALL_COMMON_CREATE_H
# include <BALL/COMMON/create.h>
#endif
#ifndef BALL_COMMON_DEBUG_H
# include <BALL/COMMON/debug.h>
#endif
#ifndef BALL_CONCEPT_PERSISTENCEMANAGER_H
# include <BALL/CONCEPT/persistenceManager.h>
#endif
#include <iostream>
namespace BALL
{
class BALL_EXPORT PreciseTime
{
public:
BALL_CREATE(PreciseTime)
PreciseTime();
PreciseTime(const PreciseTime& time);
PreciseTime(long secs, long usecs);
virtual ~PreciseTime();
static const PreciseTime ZERO;
void set(long secs, long usecs);
void set(const PreciseTime& time);
const PreciseTime& operator = (const PreciseTime& time);
virtual void clear()
;
bool operator < (const PreciseTime& time) const;
bool operator > (const PreciseTime& time) const;
bool operator == (const PreciseTime& time) const;
long getSeconds() const;
long getMicroSeconds() const;
static PreciseTime now();
void write(PersistenceManager& pm) const;
bool read(PersistenceManager& pm);
protected:
long secs_;
long usecs_;
#ifdef BALL_HAS_WINDOWS_PERFORMANCE_COUNTER
static long ticks_;
#endif
};
class BALL_EXPORT TimeStamp
{
public:
BALL_CREATE(TimeStamp)
TimeStamp();
virtual ~TimeStamp();
bool isNewerThan(const PreciseTime& time) const;
bool isOlderThan(const PreciseTime& time) const;
bool isNewerThan(const TimeStamp& stamp) const;
bool isOlderThan(const TimeStamp& stamp) const;
bool operator == (const TimeStamp& stamp) const;
virtual void stamp(const PreciseTime& time = PreciseTime::ZERO);
const PreciseTime& getTime() const;
const PreciseTime& operator = (const PreciseTime& time);
virtual void clear();
void write(PersistenceManager& pm) const;
bool read(PersistenceManager& pm);
protected:
PreciseTime time_;
};
BALL_EXPORT
std::ostream& operator << (std::ostream& os, const PreciseTime& time);
BALL_EXPORT
std::ostream& operator << (std::ostream& os, const TimeStamp& stamp);
# ifndef BALL_NO_INLINE_FUNCTIONS
# include <BALL/CONCEPT/timeStamp.iC>
# endif
} // namespace BALL
#endif // BALL_CONCEPT_TIMESTAMP_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::PersistenceManager
Definition persistenceManager.h:73
BALL::PreciseTime
Definition timeStamp.h:38
BALL::PreciseTime::clear
virtual void clear()
BALL::PreciseTime::usecs_
long usecs_
Definition timeStamp.h:158
BALL::PreciseTime::getMicroSeconds
long getMicroSeconds() const
BALL::PreciseTime::read
bool read(PersistenceManager &pm)
BALL::PreciseTime::PreciseTime
PreciseTime()
BALL::PreciseTime::ZERO
static const PreciseTime ZERO
Definition timeStamp.h:72
BALL::PreciseTime::now
static PreciseTime now()
BALL::PreciseTime::getSeconds
long getSeconds() const
BALL::PreciseTime::set
void set(long secs, long usecs)
BALL::PreciseTime::secs_
long secs_
Definition timeStamp.h:157
BALL::PreciseTime::write
void write(PersistenceManager &pm) const
BALL::TimeStamp
Definition timeStamp.h:172
BALL::TimeStamp::getTime
const PreciseTime & getTime() const
BALL::TimeStamp::write
void write(PersistenceManager &pm) const
BALL::TimeStamp::clear
virtual void clear()
BALL::TimeStamp::time_
PreciseTime time_
Definition timeStamp.h:272
BALL::TimeStamp::isNewerThan
bool isNewerThan(const PreciseTime &time) const
BALL::TimeStamp::read
bool read(PersistenceManager &pm)
BALL::TimeStamp::stamp
virtual void stamp(const PreciseTime &time=PreciseTime::ZERO)
BALL::TimeStamp::TimeStamp
TimeStamp()
BALL::TimeStamp::isOlderThan
bool isOlderThan(const PreciseTime &time) const
create.h
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
debug.h
BALL
Definition constants.h:13
std
STL namespace.
persistenceManager.h