17 #ifndef CYBER_PYTHON_INTERNAL_PY_TIMER_H_ 18 #define CYBER_PYTHON_INTERNAL_PY_TIMER_H_ 33 PyTimer() { timer_ = std::make_shared<Timer>(); }
36 std::function<void()> bound_f = std::bind(
func);
37 timer_ = std::make_shared<Timer>(period, bound_f, oneshot);
40 void start() { timer_->Start(); }
42 void stop() { timer_->Stop(); }
45 std::function<void()> bound_f = std::bind(
func);
50 timer_->SetTimerOption(time_opt);
54 std::shared_ptr<Timer> timer_ =
nullptr;
60 #endif // CYBER_PYTHON_INTERNAL_PY_TIMER_H_ void(* func)(void *)
Definition: routine_context.h:41
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
std::function< void()> callback
Definition: timer.h:57
bool oneshot
Definition: timer.h:63
void start()
Definition: py_timer.h:40
void set_option(uint32_t period, void(*func)(), bool oneshot)
Definition: py_timer.h:44
void stop()
Definition: py_timer.h:42
PyTimer()
Definition: py_timer.h:33
uint32_t period
The period of the timer, unit is ms max: 512 * 64 min: 1.
Definition: timer.h:54
PyTimer(uint32_t period, void(*func)(), bool oneshot)
Definition: py_timer.h:35
Definition: py_timer.h:31
The options of timer.
Definition: timer.h:32