Apollo 11.0
自动驾驶开放平台
apollo::cyber::mainboard::ModuleController类 参考

#include <module_controller.h>

apollo::cyber::mainboard::ModuleController 的协作图:

Public 成员函数

 ModuleController (const ModuleArgument &args)
 
virtual ~ModuleController ()=default
 
bool Init ()
 
bool LoadAll ()
 
void Clear ()
 

详细描述

在文件 module_controller.h 第 35 行定义.

构造及析构函数说明

◆ ModuleController()

apollo::cyber::mainboard::ModuleController::ModuleController ( const ModuleArgument &  args)
inlineexplicit

在文件 module_controller.h 第 56 行定义.

57 : args_(args) {}

◆ ~ModuleController()

virtual apollo::cyber::mainboard::ModuleController::~ModuleController ( )
virtualdefault

成员函数说明

◆ Clear()

void apollo::cyber::mainboard::ModuleController::Clear ( )

在文件 module_controller.cc 第 30 行定义.

30 {
31 for (auto& component : component_list_) {
32 component->Shutdown();
33 }
34 component_list_.clear(); // keep alive
35 class_loader_manager_.UnloadAllLibrary();
36}

◆ Init()

bool apollo::cyber::mainboard::ModuleController::Init ( )
inline

在文件 module_controller.h 第 59 行定义.

◆ LoadAll()

bool apollo::cyber::mainboard::ModuleController::LoadAll ( )

在文件 module_controller.cc 第 38 行定义.

38 {
39 const std::string work_root = common::WorkRoot();
40 const std::string current_path = common::GetCurrentPath();
41 const std::string dag_root_path = common::GetAbsolutePath(work_root, "dag");
42 std::vector<std::string> paths;
43 for (auto& plugin_description : args_.GetPluginDescriptionList()) {
45 plugin_description);
46 }
47 if (!args_.GetDisablePluginsAutoLoad()) {
50 }
51 for (auto& dag_conf : args_.GetDAGConfList()) {
52 std::string module_path = dag_conf;
53 if (!common::GetFilePathWithEnv(dag_conf, "APOLLO_DAG_PATH",
54 &module_path)) {
55 AERROR << "no dag conf [" << dag_conf << "] found!";
56 return false;
57 }
58 AINFO << "mainboard: use dag conf " << module_path;
59 total_component_nums += GetComponentNum(module_path);
60 paths.emplace_back(std::move(module_path));
61 }
62 if (has_timer_component) {
63 total_component_nums += scheduler::Instance()->TaskPoolSize();
64 }
65 common::GlobalData::Instance()->SetComponentNums(total_component_nums);
66 for (auto module_path : paths) {
67 AINFO << "Start initialize dag: " << module_path;
68 if (!LoadModule(module_path)) {
69 AERROR << "Failed to load module: " << module_path;
70 return false;
71 }
72 }
73 return true;
74}
static PluginManager * Instance()
get singleton instance of PluginManager
bool LoadInstalledPlugins()
load plugins from installed path
bool LoadPlugin(const std::string &plugin_description_file_path)
load plugin clases from file
#define AERROR
Definition log.h:44
#define AINFO
Definition log.h:42
std::string GetCurrentPath()
Definition file.cc:474
bool GetFilePathWithEnv(const std::string &path, const std::string &env_var, std::string *file_path)
get file path, judgement priority:
Definition file.cc:422
std::string GetAbsolutePath(const std::string &prefix, const std::string &relative_path)
Get absolute path by concatenating prefix and relative_path.
Definition file.cc:179
const std::string WorkRoot()
Definition environment.h:40

该类的文档由以下文件生成: