Apollo
10.0
自动驾驶开放平台
play_task.h
浏览该文件的文档.
1
/******************************************************************************
2
* Copyright 2018 The Apollo Authors. All Rights Reserved.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*****************************************************************************/
16
17
#ifndef CYBER_TOOLS_CYBER_RECORDER_PLAYER_PLAY_TASK_H_
18
#define CYBER_TOOLS_CYBER_RECORDER_PLAYER_PLAY_TASK_H_
19
20
#include <atomic>
21
#include <cstdint>
22
#include <memory>
23
24
#include "
cyber/message/raw_message.h
"
25
#include "
cyber/node/writer.h
"
26
27
namespace
apollo
{
28
namespace
cyber {
29
namespace
record {
30
31
class
PlayTask
{
32
public
:
33
using
MessagePtr
= std::shared_ptr<message::RawMessage>;
34
using
WriterPtr
= std::shared_ptr<Writer<message::RawMessage>>;
35
36
PlayTask
(
const
MessagePtr
& msg,
const
WriterPtr
& writer,
37
uint64_t
msg_real_time_ns
, uint64_t
msg_play_time_ns
);
38
virtual
~PlayTask
() {}
39
40
void
Play
();
41
42
uint64_t
msg_real_time_ns
()
const
{
return
msg_real_time_ns_; }
43
uint64_t
msg_play_time_ns
()
const
{
return
msg_play_time_ns_; }
44
static
uint64_t
played_msg_num
() {
return
played_msg_num_.load(); }
45
46
private
:
47
MessagePtr
msg_;
48
WriterPtr
writer_;
49
uint64_t msg_real_time_ns_;
50
uint64_t msg_play_time_ns_;
51
52
static
std::atomic<uint64_t> played_msg_num_;
53
};
54
55
}
// namespace record
56
}
// namespace cyber
57
}
// namespace apollo
58
59
#endif
// CYBER_TOOLS_CYBER_RECORDER_PLAYER_PLAY_TASK_H_
apollo::cyber::record::PlayTask
Definition
play_task.h:31
apollo::cyber::record::PlayTask::msg_real_time_ns
uint64_t msg_real_time_ns() const
Definition
play_task.h:42
apollo::cyber::record::PlayTask::WriterPtr
std::shared_ptr< Writer< message::RawMessage > > WriterPtr
Definition
play_task.h:34
apollo::cyber::record::PlayTask::~PlayTask
virtual ~PlayTask()
Definition
play_task.h:38
apollo::cyber::record::PlayTask::MessagePtr
std::shared_ptr< message::RawMessage > MessagePtr
Definition
play_task.h:33
apollo::cyber::record::PlayTask::Play
void Play()
Definition
play_task.cc:34
apollo::cyber::record::PlayTask::msg_play_time_ns
uint64_t msg_play_time_ns() const
Definition
play_task.h:43
apollo::cyber::record::PlayTask::played_msg_num
static uint64_t played_msg_num()
Definition
play_task.h:44
apollo
class register implement
Definition
arena_queue.h:37
raw_message.h
writer.h
cyber
tools
cyber_recorder
player
play_task.h