Aikido
ExecutorThread-impl.hpp
Go to the documentation of this file.
2 
3 namespace aikido {
4 namespace common {
5 
6 //==============================================================================
7 template <typename Duration>
9  std::function<void()> callback, const Duration& period)
10  : mCallback{std::move(callback)}
11  , mPeriod{std::chrono::duration_cast<std::chrono::milliseconds>(period)}
12  , mIsRunning{true}
13  , mThread{std::thread{&ExecutorThread::spin, this}}
14 {
15  // Do nothing
16 }
17 
18 } // namespace common
19 } // namespace aikido
aikido
Format of serialized trajectory in YAML.
Definition: algorithm.hpp:4
aikido::common::ExecutorThread::spin
void spin()
The loop function that will be executed by the thread.
aikido::common::ExecutorThread::ExecutorThread
ExecutorThread(std::function< void()> callback, const Duration &period)
Constructs from callback and period.
Definition: ExecutorThread-impl.hpp:8
ExecutorThread.hpp