Interface to an object whose sleep()
calls can be interrupted externally. Multiple sleep()
calls can be happening at a time. The object waits for the last sleep()
call to finish on destruction. No more sleep()
calls can be made once destruction of the object started (sleep()
will return false in such case). Make sure that ok()
returns false when this object is about to be destroyed.
More...
#include <interruptible_sleep_interface.h>
|
::std::unique_ptr< InterruptibleSleepInterfacePrivate > | data |
| PIMPL data container. More...
|
|
Interface to an object whose sleep()
calls can be interrupted externally. Multiple sleep()
calls can be happening at a time. The object waits for the last sleep()
call to finish on destruction. No more sleep()
calls can be made once destruction of the object started (sleep()
will return false in such case). Make sure that ok()
returns false when this object is about to be destroyed.
Definition at line 26 of file interruptible_sleep_interface.h.
◆ InterruptibleSleepInterface()
cras::InterruptibleSleepInterface::InterruptibleSleepInterface |
( |
| ) |
|
◆ ~InterruptibleSleepInterface()
virtual cras::InterruptibleSleepInterface::~InterruptibleSleepInterface |
( |
| ) |
|
|
virtual |
Destroy the object waiting for a pending sleep()
call to finish.
◆ ok()
virtual bool cras::InterruptibleSleepInterface::ok |
( |
| ) |
const |
|
virtual |
◆ sleep()
virtual bool cras::InterruptibleSleepInterface::sleep |
( |
const ::ros::Duration & |
duration | ) |
const |
|
virtual |
Sleep for the given duration or until ok()
returns false.
- Parameters
-
[in] | duration | The duration to sleep for. |
- Returns
- Whether the requested duration has elapsed.
◆ data
::std::unique_ptr<InterruptibleSleepInterfacePrivate> cras::InterruptibleSleepInterface::data |
|
private |
◆ pollDuration
The documentation for this struct was generated from the following file: