interruptible_sleep_interface.h
Go to the documentation of this file.
1 #pragma once
2 
11 #include <memory>
12 
13 #include <ros/duration.h>
14 
15 namespace cras
16 {
17 
18 struct InterruptibleSleepInterfacePrivate;
19 
27 {
28 public:
30 
35 
41  virtual bool sleep(const ::ros::Duration& duration) const;
42 
49  virtual bool ok() const;
50 
51 protected:
54 
55 private:
57  ::std::unique_ptr<InterruptibleSleepInterfacePrivate> data;
58 };
59 
60 }
cras::InterruptibleSleepInterface::data
::std::unique_ptr< InterruptibleSleepInterfacePrivate > data
PIMPL data container.
Definition: interruptible_sleep_interface.h:57
cras
Definition: any.hpp:15
cras::InterruptibleSleepInterface::sleep
virtual bool sleep(const ::ros::Duration &duration) const
Sleep for the given duration or until ok() returns false.
cras::InterruptibleSleepInterface::pollDuration
::ros::WallDuration pollDuration
How long to wait between querying the ok() status and other conditions.
Definition: interruptible_sleep_interface.h:53
duration.h
cras::InterruptibleSleepInterface
Interface to an object whose sleep() calls can be interrupted externally. Multiple sleep() calls can ...
Definition: interruptible_sleep_interface.h:26
cras::InterruptibleSleepInterface::ok
virtual bool ok() const
Whether it is OK to continue sleeping. If false, a pending sleep() should stop as soon as possible.
ros::WallDuration
cras::InterruptibleSleepInterface::~InterruptibleSleepInterface
virtual ~InterruptibleSleepInterface()
Destroy the object waiting for a pending sleep() call to finish.
cras::InterruptibleSleepInterface::InterruptibleSleepInterface
InterruptibleSleepInterface()


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Tue Nov 26 2024 03:49:04