51 #ifndef INCLUDE_OKVIS_DURATION_HPP_
52 #define INCLUDE_OKVIS_DURATION_HPP_
61 #pragma warning(disable: 4244)
62 #pragma warning(disable: 4661)
105 return !(*
static_cast<const T*
>(
this) == rhs);
112 return (
double)
sec + 1e-9 * (double)
nsec;
116 return (int64_t)
sec * 1000000000ll + (int64_t)
nsec;
179 std::ostream &
operator <<(std::ostream &os,
const Duration &rhs);
180 std::ostream &
operator <<(std::ostream &os,
const WallDuration &rhs);
184 #endif // INCLUDE_OKVIS_DURATION_HPP_
DurationBase()
Definition: Duration.hpp:85
bool operator==(const T &rhs) const
Definition: Duration.hpp:169
bool isZero()
Definition: Duration.hpp:174
bool sleep() const
sleep for the amount of time specified by this Duration. If a signal interrupts the sleep...
Definition: Time.cpp:366
DurationBase(double t)
Definition: Duration.hpp:90
Base class for Duration implementations. Provides storage, common functions and operator overloads...
Definition: Duration.hpp:82
int64_t toNSec() const
Definition: Duration.hpp:115
bool operator<(const T &rhs) const
Definition: Duration.hpp:133
Duration(int32_t _sec, int32_t _nsec)
Definition: Duration.hpp:137
bool operator<=(const T &rhs) const
Definition: Duration.hpp:151
const Duration DURATION_MAX
std::ostream & operator<<(std::ostream &os, const Duration &rhs)
Definition: Time.cpp:284
bool operator>(const T &rhs) const
Definition: Duration.hpp:142
Duration()
Definition: Duration.hpp:133
T & fromNSec(int64_t t)
Definition: Duration.hpp:85
bool sleep() const
sleep for the amount of time specified by this Duration. If a signal interrupts the sleep...
Definition: Time.cpp:319
bool operator>=(const T &rhs) const
Definition: Duration.hpp:160
~DurationBase()
Definition: Duration.hpp:94
T & operator-=(const T &rhs)
Definition: Duration.hpp:121
double toSec() const
Definition: Duration.hpp:111
bool operator!=(const T &rhs) const
Definition: Duration.hpp:104
Duration(double t)
Definition: Duration.hpp:141
Duration representation for use with the Time class.
Definition: Duration.hpp:131
WallDuration(int32_t _sec, int32_t _nsec)
Definition: Duration.hpp:165
T operator+(const T &rhs) const
Definition: Duration.hpp:95
void normalizeSecNSecSigned(int64_t &sec, int64_t &nsec)
Definition: Duration.cpp:55
int32_t nsec
Definition: Duration.hpp:84
Duration representation for use with the WallTime class.
Definition: Duration.hpp:159
T operator-() const
Definition: Duration.hpp:110
T & fromSec(double t)
Definition: Duration.hpp:69
T operator*(double scale) const
Definition: Duration.hpp:100
T & operator*=(double scale)
Definition: Duration.hpp:127
WallDuration(double t)
Definition: Duration.hpp:169
const Duration DURATION_MIN
int32_t sec
Definition: Duration.hpp:84
WallDuration()
Definition: Duration.hpp:161
T & operator+=(const T &rhs)
Definition: Duration.hpp:115