Apollo  6.0
Open source self driving car software
spliter.h
Go to the documentation of this file.
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_SPLITER_H_
18 #define CYBER_TOOLS_CYBER_RECORDER_SPLITER_H_
19 
20 #include <algorithm>
21 #include <limits>
22 #include <memory>
23 #include <string>
24 #include <vector>
25 
26 #include "cyber/common/log.h"
27 #include "cyber/proto/record.pb.h"
31 
32 using ::apollo::cyber::proto::ChannelCache;
33 using ::apollo::cyber::proto::ChunkBody;
34 using ::apollo::cyber::proto::ChunkHeader;
35 using ::apollo::cyber::proto::Header;
36 
37 namespace apollo {
38 namespace cyber {
39 namespace record {
40 
41 class Spliter {
42  public:
43  Spliter(const std::string& input_file, const std::string& output_file,
44  const std::vector<std::string>& white_channels,
45  const std::vector<std::string>& black_channels,
46  uint64_t begin_time = 0,
47  uint64_t end_time = std::numeric_limits<uint64_t>::max());
48  virtual ~Spliter();
49  bool Proc();
50 
51  private:
52  RecordFileReader reader_;
53  RecordFileWriter writer_;
54  std::string input_file_;
55  std::string output_file_;
56  std::vector<std::string> white_channels_;
57  std::vector<std::string> black_channels_;
58  bool all_channels_;
59  uint64_t begin_time_;
60  uint64_t end_time_;
61 };
62 
63 } // namespace record
64 } // namespace cyber
65 } // namespace apollo
66 
67 #endif // CYBER_TOOLS_CYBER_RECORDER_SPLITER_H_
Definition: spliter.h:41
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: record_file_writer.h:77
Definition: record_file_reader.h:45
Spliter(const std::string &input_file, const std::string &output_file, const std::vector< std::string > &white_channels, const std::vector< std::string > &black_channels, uint64_t begin_time=0, uint64_t end_time=std::numeric_limits< uint64_t >::max())