Apollo 10.0
自动驾驶开放平台
apollo::cyber::PyTimer类 参考

#include <py_timer.h>

apollo::cyber::PyTimer 的协作图:

Public 成员函数

 PyTimer ()
 
 PyTimer (uint32_t period, void(*func)(), bool oneshot)
 
void start ()
 
void stop ()
 
void set_option (uint32_t period, void(*func)(), bool oneshot)
 

详细描述

在文件 py_timer.h31 行定义.

构造及析构函数说明

◆ PyTimer() [1/2]

apollo::cyber::PyTimer::PyTimer ( )
inline

在文件 py_timer.h33 行定义.

33{ timer_ = std::make_shared<Timer>(); }

◆ PyTimer() [2/2]

apollo::cyber::PyTimer::PyTimer ( uint32_t  period,
void(*)()  func,
bool  oneshot 
)
inline

在文件 py_timer.h35 行定义.

35 {
36 std::function<void()> bound_f = std::bind(func);
37 timer_ = std::make_shared<Timer>(period, bound_f, oneshot);
38 }

成员函数说明

◆ set_option()

void apollo::cyber::PyTimer::set_option ( uint32_t  period,
void(*)()  func,
bool  oneshot 
)
inline

在文件 py_timer.h44 行定义.

44 {
45 std::function<void()> bound_f = std::bind(func);
46 TimerOption time_opt;
47 time_opt.period = period;
48 time_opt.callback = bound_f;
49 time_opt.oneshot = oneshot;
50 timer_->SetTimerOption(time_opt);
51 }

◆ start()

void apollo::cyber::PyTimer::start ( )
inline

在文件 py_timer.h40 行定义.

40{ timer_->Start(); }

◆ stop()

void apollo::cyber::PyTimer::stop ( )
inline

在文件 py_timer.h42 行定义.

42{ timer_->Stop(); }

该类的文档由以下文件生成: