Apollo 10.0
自动驾驶开放平台
dv_plugin_manager.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2023 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
21#pragma once
22
23#include <map>
24#include <memory>
25#include <string>
26#include <vector>
27
28#include "modules/dreamview_plus/proto/data_handler.pb.h"
29#include "cyber/common/macros.h"
33
34namespace apollo {
35namespace dreamview {
36
43 public:
44 explicit DvPluginManager(CivetServer* server, UpdaterManager* updater_manager)
45 : server_(server), updater_manager_(updater_manager) {}
46
50 void Init();
51
55 void Start();
56
60 void Stop();
61
63
64 private:
65 void GetPluginClassNames();
66 bool AutoLoadPlugins();
67 bool CreatePluginInstances();
68
75 bool CreatePluginInstance(const std::string class_name);
76 void RunInstances();
77 void RegisterWebsocketHandlers(
78 std::map<std::string, WebSocketHandler*>& websocket_handler_map);
79 void RegisterHandlers(std::map<std::string, CivetHandler*>& hander_map);
80 void RegisterUpdaterHandlers(
81 std::map<std::string, UpdaterBase*>& updater_handler_map,
82 const apollo::dreamview::DataHandlerConf& data_hander_info);
83 std::vector<std::string> derived_class_names_;
84 std::map<std::string, std::shared_ptr<DvPluginBase>> plugin_instance_map_;
85 CivetServer* server_ = nullptr;
86 UpdaterManager* updater_manager_ = nullptr;
88};
89
90} // namespace dreamview
91} // namespace apollo
A class that manages dreamview plus plug-ins.
void Start()
Methods to run the plug-in management class.
void Init()
Method to initialize the plug-in management class.
apollo::dreamview::DataHandlerConf data_handler_conf_
void Stop()
Methods to stop the resource of plug-in management class.
DvPluginManager(CivetServer *server, UpdaterManager *updater_manager)
Management for all data updater.
#define DECLARE_SINGLETON(classname)
Definition macros.h:52
class register implement
Definition arena_queue.h:37
UpdaterManager to manage all data updater.