Apollo
11.0
自动驾驶开放平台
frame_manager.h
浏览该文件的文档.
1
/******************************************************************************
2
* Copyright 2019 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
#pragma once
18
19
#include <memory>
20
#include <string>
21
22
#include "
cyber/common/macros.h
"
23
#include "
modules/common/monitor_log/monitor_log_buffer.h
"
24
25
namespace
apollo
{
26
namespace
storytelling {
27
28
class
FrameManager
{
29
public
:
30
FrameManager
() =
delete
;
31
explicit
FrameManager
(
const
std::shared_ptr<cyber::Node>& node);
32
33
void
StartFrame
();
34
void
EndFrame
();
35
36
// Getters.
37
apollo::common::monitor::MonitorLogBuffer
&
LogBuffer
() {
return
log_buffer_; }
38
39
// Cyber reader / writer creator.
40
template
<
class
T>
41
std::shared_ptr<cyber::Reader<T>>
CreateOrGetReader
(
42
const
std::string& channel) {
43
auto
reader = node_->GetReader<T>(channel);
44
return
reader !=
nullptr
? reader : node_->CreateReader<T>(channel);
45
}
46
47
template
<
class
T>
48
std::shared_ptr<cyber::Writer<T>>
CreateWriter
(
const
std::string& channel) {
49
return
node_->CreateWriter<T>(channel);
50
}
51
52
private
:
53
apollo::common::monitor::MonitorLogBuffer
log_buffer_;
54
std::shared_ptr<cyber::Node> node_;
55
};
56
57
}
// namespace storytelling
58
}
// namespace apollo
apollo::common::monitor::MonitorLogBuffer
class MonitorLogBuffer
Definition
monitor_log_buffer.h:60
apollo::storytelling::FrameManager
Definition
frame_manager.h:28
apollo::storytelling::FrameManager::LogBuffer
apollo::common::monitor::MonitorLogBuffer & LogBuffer()
Definition
frame_manager.h:37
apollo::storytelling::FrameManager::EndFrame
void EndFrame()
Definition
frame_manager.cc:28
apollo::storytelling::FrameManager::CreateWriter
std::shared_ptr< cyber::Writer< T > > CreateWriter(const std::string &channel)
Definition
frame_manager.h:48
apollo::storytelling::FrameManager::StartFrame
void StartFrame()
Definition
frame_manager.cc:26
apollo::storytelling::FrameManager::CreateOrGetReader
std::shared_ptr< cyber::Reader< T > > CreateOrGetReader(const std::string &channel)
Definition
frame_manager.h:41
apollo::storytelling::FrameManager::FrameManager
FrameManager()=delete
macros.h
monitor_log_buffer.h
The class of MonitorLogBuffer
apollo
class register implement
Definition
arena_queue.h:37
modules
storytelling
frame_manager.h