Apollo 10.0
自动驾驶开放平台
header_builder.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_HEADER_BUILDER_H_
18#define CYBER_RECORD_HEADER_BUILDER_H_
19
20#include "cyber/proto/record.pb.h"
21
22namespace apollo {
23namespace cyber {
24namespace record {
25
30 public:
41 const uint64_t segment_interval, const uint64_t segment_raw_size);
42
52 static proto::Header GetHeaderWithChunkParams(const uint64_t chunk_interval,
53 const uint64_t chunk_raw_size);
54
60 static proto::Header GetHeader();
61
62 private:
63 static const uint32_t MAJOR_VERSION_ = 1;
64 static const uint32_t MINOR_VERSION_ = 0;
65 static const proto::CompressType COMPRESS_TYPE_ =
67 static const uint64_t CHUNK_INTERVAL_ = 20 * 1000 * 1000 * 1000ULL; // 20s
68 static const uint64_t SEGMENT_INTERVAL_ = 60 * 1000 * 1000 * 1000ULL; // 60s
69 static const uint64_t CHUNK_RAW_SIZE_ = 16 * 1024 * 1024ULL; // 16MB
70 static const uint64_t SEGMENT_RAW_SIZE_ = 2048 * 1024 * 1024ULL; // 2GB
71};
72
73} // namespace record
74} // namespace cyber
75} // namespace apollo
76
77#endif // CYBER_RECORD_HEADER_BUILDER_H_
The builder of record header.
static proto::Header GetHeader()
Build a default record header.
static proto::Header GetHeaderWithChunkParams(const uint64_t chunk_interval, const uint64_t chunk_raw_size)
Build a record header with customized max interval time (ns) and max raw size (byte) for chunk.
static proto::Header GetHeaderWithSegmentParams(const uint64_t segment_interval, const uint64_t segment_raw_size)
Build a record header with customized max interval time (ns) and max raw size (byte) for segment.
class register implement
Definition arena_queue.h:37