Apollo 10.0
自动驾驶开放平台
record_base.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_RECORD_RECORD_BASE_H_
18#define CYBER_RECORD_RECORD_BASE_H_
19
20#include <cstdint>
21#include <set>
22#include <string>
23
24#include "cyber/proto/record.pb.h"
25
26namespace apollo {
27namespace cyber {
28namespace record {
29
30static const std::string& kEmptyString = "";
31
36 public:
40 virtual ~RecordBase() = default;
41
49 virtual uint64_t GetMessageNumber(const std::string& channel_name) const = 0;
50
58 virtual const std::string& GetMessageType(
59 const std::string& channel_name) const = 0;
60
68 virtual const std::string& GetProtoDesc(
69 const std::string& channel_name) const = 0;
70
76 virtual std::set<std::string> GetChannelList() const = 0;
77
83 const proto::Header& GetHeader() const { return header_; }
84
90 const std::string GetFile() const { return file_; }
91
92 protected:
93 std::string file_;
95 bool is_opened_ = false;
96};
97
98} // namespace record
99} // namespace cyber
100} // namespace apollo
101
102#endif // CYBER_RECORD_RECORD_BASE_H_
Base class for record reader and writer.
Definition record_base.h:35
const std::string GetFile() const
Get record file path.
Definition record_base.h:90
const proto::Header & GetHeader() const
Get record header.
Definition record_base.h:83
virtual const std::string & GetProtoDesc(const std::string &channel_name) const =0
Get proto descriptor string by channel name.
virtual uint64_t GetMessageNumber(const std::string &channel_name) const =0
Get message number by channel name.
virtual std::set< std::string > GetChannelList() const =0
Get channel list.
virtual ~RecordBase()=default
Destructor.
virtual const std::string & GetMessageType(const std::string &channel_name) const =0
Get message type by channel name.
class register implement
Definition arena_queue.h:37