#include <play_task_consumer.h>
◆ TaskBufferPtr
◆ ThreadPtr
◆ PlayTaskConsumer()
apollo::cyber::record::PlayTaskConsumer::PlayTaskConsumer |
( |
const TaskBufferPtr & |
task_buffer, |
|
|
double |
play_rate = 1.0 |
|
) |
| |
|
explicit |
在文件 play_task_consumer.cc 第 30 行定义.
32 : play_rate_(play_rate),
33 consume_th_(nullptr),
34 task_buffer_(task_buffer),
35 is_stopped_(true),
36 is_paused_(false),
37 is_playonce_(false),
38 base_msg_play_time_ns_(0),
39 base_msg_real_time_ns_(0),
40 last_played_msg_real_time_ns_(0) {
41 if (play_rate_ <= 0) {
42 AERROR <<
"invalid play rate: " << play_rate_
43 << " , we will use default value(1.0).";
44 play_rate_ = 1.0;
45 }
46}
◆ ~PlayTaskConsumer()
apollo::cyber::record::PlayTaskConsumer::~PlayTaskConsumer |
( |
| ) |
|
|
virtual |
◆ base_msg_play_time_ns()
uint64_t apollo::cyber::record::PlayTaskConsumer::base_msg_play_time_ns |
( |
| ) |
const |
|
inline |
◆ base_msg_real_time_ns()
uint64_t apollo::cyber::record::PlayTaskConsumer::base_msg_real_time_ns |
( |
| ) |
const |
|
inline |
◆ Continue()
void apollo::cyber::record::PlayTaskConsumer::Continue |
( |
| ) |
|
|
inline |
◆ last_played_msg_real_time_ns()
uint64_t apollo::cyber::record::PlayTaskConsumer::last_played_msg_real_time_ns |
( |
| ) |
const |
|
inline |
◆ Pause()
void apollo::cyber::record::PlayTaskConsumer::Pause |
( |
| ) |
|
|
inline |
◆ PlayOnce()
void apollo::cyber::record::PlayTaskConsumer::PlayOnce |
( |
| ) |
|
|
inline |
◆ Start()
void apollo::cyber::record::PlayTaskConsumer::Start |
( |
uint64_t |
begin_time_ns | ) |
|
在文件 play_task_consumer.cc 第 50 行定义.
50 {
51 if (!is_stopped_.exchange(false)) {
52 return;
53 }
54 begin_time_ns_ = begin_time_ns;
55 consume_th_.reset(new std::thread(&PlayTaskConsumer::ThreadFunc, this));
56}
◆ Stop()
void apollo::cyber::record::PlayTaskConsumer::Stop |
( |
| ) |
|
在文件 play_task_consumer.cc 第 58 行定义.
58 {
59 if (is_stopped_.exchange(true)) {
60 return;
61 }
62 if (consume_th_ != nullptr && consume_th_->joinable()) {
63 consume_th_->join();
64 consume_th_ = nullptr;
65 }
66
67 base_msg_play_time_ns_ = 0;
68 base_msg_real_time_ns_ = 0;
69 last_played_msg_real_time_ns_ = 0;
70}
该类的文档由以下文件生成: