|
bipedal locomotion framework
A suite of libraries for achieving bipedal locomotion on humanoid robots
|
IClock is the interface to the clock. More...
#include <System/include/BipedalLocomotion/System/IClock.h>
Public Member Functions | |
| virtual | ~IClock ()=default |
| Destructor. | |
| virtual std::chrono::nanoseconds | now ()=0 |
| Get the current time. More... | |
| virtual void | sleepFor (const std::chrono::nanoseconds &sleepDuration)=0 |
| Blocks the execution of the current thread for at least the specified sleepDuration. More... | |
| virtual void | sleepUntil (const std::chrono::nanoseconds &time)=0 |
| Blocks the execution of the current thread until specified sleepTime has been reached. More... | |
| virtual void | yield ()=0 |
| Provides a hint to the implementation to reschedule the execution of threads, allowing other threads to run. | |
Protected Member Functions | |
| IClock ()=default | |
| The constructor is protected. More... | |
IClock is the interface to the clock.
The Clock is considered as a singleton. Please use the ClockBuilder to create a clock. The default clock is the System::StdClock which uses only the std methods. To get the current time you can simply use the following line of code
|
protecteddefault |
The constructor is protected.
Please create the clock with ClockBulder.
|
pure virtual |
Get the current time.
BipedalLocomotion::clock().now().count() returns a double containing the seconds since epoch. Implemented in BipedalLocomotion::System::YarpClock, BipedalLocomotion::System::RosClock, and BipedalLocomotion::System::StdClock.
|
pure virtual |
Blocks the execution of the current thread for at least the specified sleepDuration.
| time | duration to sleep |
Implemented in BipedalLocomotion::System::YarpClock, BipedalLocomotion::System::RosClock, and BipedalLocomotion::System::StdClock.
|
pure virtual |
Blocks the execution of the current thread until specified sleepTime has been reached.
| time | to block until |
Implemented in BipedalLocomotion::System::YarpClock, BipedalLocomotion::System::RosClock, and BipedalLocomotion::System::StdClock.