Apollo
6.0
Open source self driving car software
cyber
mainboard
module_controller.h
Go to the documentation of this file.
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
25
#include "
cyber/class_loader/class_loader_manager.h
"
26
#include "
cyber/component/component.h
"
27
#include "
cyber/mainboard/module_argument.h
"
28
29
namespace
apollo
{
30
namespace
cyber
{
31
namespace
mainboard {
32
33
using
apollo::cyber::proto::DagConfig;
34
35
class
ModuleController
{
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
56
inline
ModuleController::ModuleController
(
const
ModuleArgument
& args)
57
: args_(args) {}
58
59
inline
bool
ModuleController::Init
() {
return
LoadAll
(); }
60
61
}
// namespace mainboard
62
}
// namespace cyber
63
}
// namespace apollo
64
65
#endif // CYBER_MAINBOARD_MODULE_CONTROLLER_H_
apollo
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition:
atomic_hash_map.h:25
apollo::cyber::mainboard::ModuleController::ModuleController
ModuleController(const ModuleArgument &args)
Definition:
module_controller.h:56
class_loader_manager.h
apollo::cyber::class_loader::ClassLoaderManager
Definition:
class_loader_manager.h:32
apollo::cyber::mainboard::ModuleController::LoadAll
bool LoadAll()
apollo::cyber::mainboard::ModuleController::~ModuleController
virtual ~ModuleController()=default
apollo::cyber::mainboard::ModuleArgument
Definition:
module_argument.h:34
module_argument.h
apollo::cyber::mainboard::ModuleController::Clear
void Clear()
component.h
apollo::cyber::mainboard::ModuleController
Definition:
module_controller.h:35
apollo::cyber::mainboard::ModuleController::Init
bool Init()
Definition:
module_controller.h:59
cyber
Generated by
1.8.13