timespan.h File Reference
#include <stdint.h>
#include <iosfwd>
#include <cxxtools/config.h>
#include <tntdb/statement.h>
#include <tntdb/value.h>
#include <cxxtools/timespan.h>

Go to the source code of this file.

Classes

class  cxxtools::Timespan
 Represents time spans up to microsecond resolution. More...
class  cxxtools::WeakTimespan< Resolution >
 A WeakTimespan extends a Timespan with a implicit conversion to and from number. More...
class  cxxtools::WeakTimespan< 1 >
 A WeakTimespan<1> specializes a WeakTimespan for microseconds. More...

Namespaces

namespace  cxxtools
namespace  tntdb

Typedefs

typedef WeakTimespan< 1 > cxxtools::Microseconds
 The typedefs makes specifying a timespan easy and readable.
typedef WeakTimespan< int64_t(1000)> cxxtools::Milliseconds
typedef WeakTimespan< int64_t(1000)*1000 > cxxtools::Seconds
typedef WeakTimespan< int64_t(1000)*1000 *60 > cxxtools::Minutes
typedef WeakTimespan< int64_t(1000)*1000 *60 *60 > cxxtools::Hours
typedef WeakTimespan< int64_t(1000)*1000 *60 *60 *24 > cxxtools::Days

Functions

Timespan cxxtools::operator* (const Timespan &d, double fac)
Timespan cxxtools::operator* (double fac, const Timespan &d)
Timespan cxxtools::operator/ (const Timespan &d, double fac)
std::ostream & cxxtools::operator<< (std::ostream &out, const Timespan &ts)
 outputs timespan as number of seconds with the suffix 's'
std::ostream & cxxtools::operator<< (std::ostream &out, const Microseconds &ts)
 outputs timespan as number of microseconds with the suffix 'us'
std::ostream & cxxtools::operator<< (std::ostream &out, const Milliseconds &ts)
 outputs timespan as number of milliseconds with the suffix 'ms'
std::istream & cxxtools::operator>> (std::istream &in, Timespan &ts)
 reads a whole number from stream and creates a timespan with the number of microseconds
std::istream & cxxtools::operator>> (std::istream &in, Microseconds &ts)
 reads a whole number from stream and creates a timespan with the number of microseconds
std::istream & cxxtools::operator>> (std::istream &in, Milliseconds &ts)
 reads a decimal number from stream and creates a timespan with the number of milliseconds
void cxxtools::operator>>= (const SerializationInfo &si, Timespan &timespan)
void cxxtools::operator>>= (const SerializationInfo &si, Milliseconds &timespan)
void cxxtools::operator<<= (SerializationInfo &si, const Timespan &timespan)
void cxxtools::operator<<= (SerializationInfo &si, const Microseconds &timespan)
void cxxtools::operator<<= (SerializationInfo &si, const Milliseconds &timespan)
template<int64_t Resolution>
void tntdb::operator<< (Hostvar &hostvar, const cxxtools::WeakTimespan< Resolution > &ts)
 This operator can be used to pass a timespan object to the database.
template<int64_t Resolution>
bool tntdb::operator>> (const Value &value, cxxtools::WeakTimespan< Resolution > &out)
 This operator can be used to retrieve a timespan object from the database.