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 }
virtual bool sleep(const ::ros::Duration &duration) const
Sleep for the given duration or until ok() returns false.
::std::unique_ptr< InterruptibleSleepInterfacePrivate > data
PIMPL data container.
Definition: any.hpp:15
::ros::WallDuration pollDuration
How long to wait between querying the ok() status and other conditions.
virtual bool ok() const
Whether it is OK to continue sleeping. If false, a pending sleep() should stop as soon as possible...
Interface to an object whose sleep() calls can be interrupted externally. Multiple sleep() calls can ...
virtual ~InterruptibleSleepInterface()
Destroy the object waiting for a pending sleep() call to finish.


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Sat Jun 17 2023 02:32:53