Apollo 11.0
自动驾驶开放平台
module_controller.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#ifndef CYBER_MAINBOARD_MODULE_CONTROLLER_H_
17#define CYBER_MAINBOARD_MODULE_CONTROLLER_H_
18
19#include <memory>
20#include <string>
21#include <vector>
22
23#include "cyber/proto/dag_conf.pb.h"
24
28
29namespace apollo {
30namespace cyber {
31namespace mainboard {
32
34
36 public:
37 explicit ModuleController(const ModuleArgument& args);
38 virtual ~ModuleController() = default;
39
40 bool Init();
41 bool LoadAll();
42 void Clear();
43
44 private:
45 bool LoadModule(const std::string& path);
46 bool LoadModule(const DagConfig& dag_config);
47 int GetComponentNum(const std::string& path);
48 int total_component_nums = 0;
49 bool has_timer_component = false;
50
51 ModuleArgument args_;
52 class_loader::ClassLoaderManager class_loader_manager_;
53 std::vector<std::shared_ptr<ComponentBase>> component_list_;
54};
55
57 : args_(args) {}
58
59inline bool ModuleController::Init() { return LoadAll(); }
60
61} // namespace mainboard
62} // namespace cyber
63} // namespace apollo
64
65#endif // CYBER_MAINBOARD_MODULE_CONTROLLER_H_
ModuleController(const ModuleArgument &args)
class register implement
Definition arena_queue.h:37