Apollo 10.0
自动驾驶开放平台
record_player_factory.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#pragma once
17
18#include <memory>
19#include <string>
20#include <unordered_map>
21#include <vector>
22#include <boost/thread/locks.hpp>
23#include <boost/thread/shared_mutex.hpp>
24
25#include "cyber/common/macros.h"
26#include "cyber/cyber.h"
27#include "cyber/init.h"
29
30namespace apollo {
31namespace dreamview {
32
34
36 public:
38 Player* GetRecordPlayer(const std::string& record_name);
39 bool RegisterRecordPlayer(const std::string& record_namem,
40 const std::string& record_file_path);
41 void UnregisterRecordPlayer(const std::string& record_name);
42 void Reset();
43 void GetAllRecords(std::vector<std::string>* records);
44 void SetCurrentRecord(const std::string& record_name);
45 void IncreaseRecordPriority(const std::string& record_name);
46 bool RemoveLRURecord(std::string* remove_record_id);
47 std::string GetCurrentRecord();
50 bool EnableContinueLoad();
51
52 private:
53 std::unordered_map<std::string, std::unique_ptr<Player>> s_record_player_map_;
54 std::string current_record_;
55 std::vector<std::string> loaded_record_;
56 mutable boost::shared_mutex mutex_;
57 static const int32_t PRELOAD_RECORD_NUM = 3;
58 static const int32_t LOADED_RECORD_NUM = 15;
59
61};
62
63} // namespace dreamview
64} // namespace apollo
Player * GetRecordPlayer(const std::string &record_name)
void SetCurrentRecord(const std::string &record_name)
bool RemoveLRURecord(std::string *remove_record_id)
void GetAllRecords(std::vector< std::string > *records)
void IncreaseRecordPriority(const std::string &record_name)
bool RegisterRecordPlayer(const std::string &record_namem, const std::string &record_file_path)
void UnregisterRecordPlayer(const std::string &record_name)
#define DECLARE_SINGLETON(classname)
Definition macros.h:52
class register implement
Definition arena_queue.h:37