Public Member Functions | Static Public Member Functions | List of all members
rs2rosinternal::Time Class Reference

Time representation. May either represent wall clock time or ROS clock time. More...

#include <time.h>

Inheritance diagram for rs2rosinternal::Time:
Inheritance graph
[legend]

Public Member Functions

 Time ()
 
 Time (uint32_t _sec, uint32_t _nsec)
 
 Time (double t)
 
- Public Member Functions inherited from rs2rosinternal::TimeBase< Time, Duration >
TimefromNSec (uint64_t t)
 
TimefromSec (double t)
 
bool is_zero () const
 
bool isZero () const
 
bool operator!= (const Time &rhs) const
 
Time operator+ (const Duration &rhs) const
 
Timeoperator+= (const Duration &rhs)
 
Duration operator- (const Time &rhs) const
 
Time operator- (const Duration &rhs) const
 
Timeoperator-= (const Duration &rhs)
 
bool operator< (const Time &rhs) const
 
bool operator<= (const Time &rhs) const
 
bool operator== (const Time &rhs) const
 
bool operator> (const Time &rhs) const
 
bool operator>= (const Time &rhs) const
 
 TimeBase ()
 
 TimeBase (uint32_t _sec, uint32_t _nsec)
 
 TimeBase (double t)
 
uint64_t toNSec () const
 
double toSec () const
 
 ~TimeBase ()
 

Static Public Member Functions

static void init ()
 
static bool isSimTime ()
 
static bool isSystemTime ()
 
static bool isValid ()
 Returns whether or not the current time is valid. Time is valid if it is non-zero. More...
 
static Time now ()
 Retrieve the current time. If ROS clock time is in use, this returns the time according to the ROS clock. Otherwise returns the current wall clock time. More...
 
static void setNow (const Time &new_now)
 
static void shutdown ()
 
static bool sleepUntil (const Time &end)
 Sleep until a specific time has been reached. More...
 
static bool useSystemTime ()
 
static bool waitForValid ()
 Wait for time to become valid. More...
 
static bool waitForValid (const rs2rosinternal::WallDuration &timeout)
 Wait for time to become valid, with timeout. More...
 

Additional Inherited Members

- Public Attributes inherited from rs2rosinternal::TimeBase< Time, Duration >
uint32_t nsec
 
uint32_t sec
 

Detailed Description

Time representation. May either represent wall clock time or ROS clock time.

rs2rosinternal::TimeBase provides most of its functionality.

Definition at line 177 of file time.h.

Constructor & Destructor Documentation

rs2rosinternal::Time::Time ( )
inline

Definition at line 180 of file time.h.

rs2rosinternal::Time::Time ( uint32_t  _sec,
uint32_t  _nsec 
)
inline

Definition at line 184 of file time.h.

rs2rosinternal::Time::Time ( double  t)
inlineexplicit

Definition at line 188 of file time.h.

Member Function Documentation

void rs2rosinternal::Time::init ( )
static

Definition at line 272 of file time.cpp.

bool rs2rosinternal::Time::isSimTime ( )
static

Definition at line 234 of file time.cpp.

bool rs2rosinternal::Time::isSystemTime ( )
static

Definition at line 239 of file time.cpp.

bool rs2rosinternal::Time::isValid ( )
static

Returns whether or not the current time is valid. Time is valid if it is non-zero.

Definition at line 284 of file time.cpp.

Time rs2rosinternal::Time::now ( )
static

Retrieve the current time. If ROS clock time is in use, this returns the time according to the ROS clock. Otherwise returns the current wall clock time.

Definition at line 244 of file time.cpp.

void rs2rosinternal::Time::setNow ( const Time new_now)
static

Definition at line 264 of file time.cpp.

void rs2rosinternal::Time::shutdown ( )
static

Definition at line 279 of file time.cpp.

bool rs2rosinternal::Time::sleepUntil ( const Time end)
static

Sleep until a specific time has been reached.

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

Definition at line 354 of file time.cpp.

bool rs2rosinternal::Time::useSystemTime ( )
static

Definition at line 229 of file time.cpp.

bool rs2rosinternal::Time::waitForValid ( )
static

Wait for time to become valid.

Definition at line 289 of file time.cpp.

bool rs2rosinternal::Time::waitForValid ( const rs2rosinternal::WallDuration timeout)
static

Wait for time to become valid, with timeout.

Definition at line 294 of file time.cpp.


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


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:41