35 #ifndef ROS_DURATION_H 36 #define ROS_DURATION_H 45 #pragma warning(disable: 4244) 46 #pragma warning(disable: 4661) 57 namespace posix_time {
80 T operator+(
const T &rhs)
const;
81 T operator-(
const T &rhs)
const;
83 T operator*(
double scale)
const;
84 T& operator+=(
const T &rhs);
85 T& operator-=(
const T &rhs);
86 T& operator*=(
double scale);
87 bool operator==(
const T &rhs)
const;
88 inline bool operator!=(
const T &rhs)
const {
return !(*
static_cast<const T*
>(
this) == rhs); }
89 bool operator>(
const T &rhs)
const;
90 bool operator<(
const T &rhs)
const;
91 bool operator>=(
const T &rhs)
const;
92 bool operator<=(
const T &rhs)
const;
93 double toSec()
const {
return static_cast<double>(sec) + 1e-9*static_cast<double>(nsec); };
94 int64_t
toNSec()
const {
return static_cast<int64_t
>(sec)*1000000000ll + static_cast<int64_t>(nsec); };
96 T& fromNSec(int64_t t);
98 boost::posix_time::time_duration toBoost()
const;
161 #endif // ROS_DURATION_H
Duration(int32_t _sec, int32_t _nsec)
ROSTIME_DECL std::ostream & operator<<(std::ostream &os, const WallDuration &rhs)
Class to help run loops at a desired frequency.
Duration representation for use with the WallTime class.
ROSTIME_DECL void normalizeSecNSecSigned(int32_t &sec, int32_t &nsec)
bool operator!=(const T &rhs) const
WallDuration(int32_t _sec, int32_t _nsec)
Base class for Duration implementations. Provides storage, common functions and operator overloads...
Duration representation for use with the Time class.
ROSTIME_DECL const Duration DURATION_MIN
ROSTIME_DECL const Duration DURATION_MAX