Apollo 11.0
自动驾驶开放平台
scene_manager.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 <map>
19#include <string>
20
25
26namespace apollo {
27namespace perception {
28namespace lidar {
29
31
33
35 public:
37 static SceneManager manager;
38 return manager;
39 }
40 ~SceneManager() = default;
41 // @brief: initialize scene manager with lock
42 // @param [in]: initialization options
43 // @return: status
44 bool Init();
45 // @brief: get service given name
46 // @param [in]: service name
47 // @return: service pointer
48 SceneServicePtr Service(const std::string& name);
49 // @brief: get name of this class
50 // @return: name
51 std::string Name() const { return "SceneManager"; }
52 // @brief: reset scene manager
53 // @param [in]: initialization options
54 // @return: status
55 bool Reset(
57
58 int GetServiceNum() const { return static_cast<int>(services_.size()); }
59
60 protected:
61 SceneManager() = default;
62 // @brief: initialize scene manager
63 // @param [in]: initialization options
64 // @return: status
65 bool InitInternal(
67
68 protected:
69 std::map<std::string, SceneServicePtr> services_;
70 bool initialized_ = false;
71 std::mutex mutex_;
72};
73
74} // namespace lidar
75} // namespace perception
76} // namespace apollo
SceneServicePtr Service(const std::string &name)
bool InitInternal(const SceneManagerInitOptions &options=SceneManagerInitOptions())
std::map< std::string, SceneServicePtr > services_
bool Reset(const SceneManagerInitOptions &options=SceneManagerInitOptions())
std::shared_ptr< SceneService > SceneServicePtr
class register implement
Definition arena_queue.h:37