Public Member Functions | List of all members
ros::Duration Class Reference

Duration representation for use with the Time class. More...

#include <duration.h>

Inheritance diagram for ros::Duration:
Inheritance graph
[legend]

Public Member Functions

 Duration ()
 
 Duration (const Rate &)
 
 Duration (double t)
 
 Duration (int32_t _sec, int32_t _nsec)
 
bool sleep () const
 sleep for the amount of time specified by this Duration. If a signal interrupts the sleep, resleeps for the time remaining. More...
 
- Public Member Functions inherited from ros::DurationBase< Duration >
const Duration DAY
 
const WallDuration DAY
 
const Duration DAY
 
const WallDuration DAY
 
 DurationBase ()
 
 DurationBase (double t)
 
 DurationBase (int32_t _sec, int32_t _nsec)
 
DurationfromNSec (int64_t t)
 
DurationfromSec (double t)
 
const Duration HOUR
 
const WallDuration HOUR
 
const Duration HOUR
 
const WallDuration HOUR
 
bool isZero () const
 
const Duration MAX
 
const WallDuration MAX
 
const Duration MAX
 
const WallDuration MAX
 
const Duration MICROSECOND
 
const WallDuration MICROSECOND
 
const Duration MICROSECOND
 
const WallDuration MICROSECOND
 
const Duration MILLISECOND
 
const WallDuration MILLISECOND
 
const Duration MILLISECOND
 
const WallDuration MILLISECOND
 
const Duration MIN
 
const WallDuration MIN
 
const Duration MIN
 
const WallDuration MIN
 
const Duration MINUTE
 
const WallDuration MINUTE
 
const Duration MINUTE
 
const WallDuration MINUTE
 
const Duration NANOSECOND
 
const WallDuration NANOSECOND
 
const Duration NANOSECOND
 
const WallDuration NANOSECOND
 
bool operator!= (const Duration &rhs) const
 
Duration operator* (double scale) const
 
Durationoperator*= (double scale)
 
Duration operator+ (const Duration &rhs) const
 
Durationoperator+= (const Duration &rhs)
 
Duration operator- () const
 
Duration operator- (const Duration &rhs) const
 
Durationoperator-= (const Duration &rhs)
 
bool operator< (const Duration &rhs) const
 
bool operator<= (const Duration &rhs) const
 
bool operator== (const Duration &rhs) const
 
bool operator> (const Duration &rhs) const
 
bool operator>= (const Duration &rhs) const
 
const Duration SECOND
 
const WallDuration SECOND
 
const Duration SECOND
 
const WallDuration SECOND
 
boost::posix_time::time_duration toBoost () const
 
int64_t toNSec () const
 
double toSec () const
 
const Duration ZERO
 
const WallDuration ZERO
 
const Duration ZERO
 
const WallDuration ZERO
 

Additional Inherited Members

- Public Attributes inherited from ros::DurationBase< Duration >
int32_t nsec
 
int32_t sec
 
- Static Public Attributes inherited from ros::DurationBase< Duration >
static const Duration DAY
 One day duration. More...
 
static const Duration HOUR
 One hour duration. More...
 
static const Duration MAX
 Maximum representable duration. More...
 
static const Duration MICROSECOND
 One microsecond duration. More...
 
static const Duration MILLISECOND
 One millisecond duration. More...
 
static const Duration MIN
 Minimum representable duration (negative) More...
 
static const Duration MINUTE
 One minute duration. More...
 
static const Duration NANOSECOND
 One nanosecond duration. More...
 
static const Duration SECOND
 One second duration. More...
 
static const Duration ZERO
 Zero duration. More...
 

Detailed Description

Duration representation for use with the Time class.

ros::DurationBase provides most of its functionality.

Definition at line 117 of file duration.h.

Constructor & Destructor Documentation

◆ Duration() [1/4]

ros::Duration::Duration ( )
inline

Definition at line 120 of file duration.h.

◆ Duration() [2/4]

ros::Duration::Duration ( int32_t  _sec,
int32_t  _nsec 
)
inline

Definition at line 124 of file duration.h.

◆ Duration() [3/4]

ros::Duration::Duration ( double  t)
inlineexplicit

Definition at line 128 of file duration.h.

◆ Duration() [4/4]

ros::Duration::Duration ( const Rate rate)
explicit

Definition at line 71 of file src/duration.cpp.

Member Function Documentation

◆ sleep()

bool ros::Duration::sleep ( ) const

sleep for the amount of time specified by this Duration. If a signal interrupts the sleep, resleeps for the time remaining.

Returns
True if the desired sleep duration was met, false otherwise.

Definition at line 423 of file src/time.cpp.


The documentation for this class was generated from the following files:


rostime
Author(s): Josh Faust, Dirk Thomas
autogenerated on Sat Jun 17 2023 02:32:37