MCPcopy Create free account
hub / github.com/AimRT/AimRT / Initialize

Method Initialize

src/examples/cpp/executor/module/executor_module/executor_module.cc:10–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace aimrt::examples::cpp::executor::executor_module {
9
10bool ExecutorModule::Initialize(aimrt::CoreRef core) {
11 // Save aimrt framework handle
12 core_ = core;
13
14 // Get executor
15 work_executor_ = core_.GetExecutorManager().GetExecutor("work_executor");
16 AIMRT_CHECK_ERROR_THROW(work_executor_, "Can not get work_executor");
17
18 // Get thread safe executor
19 thread_safe_executor_ = core_.GetExecutorManager().GetExecutor("thread_safe_executor");
20 AIMRT_CHECK_ERROR_THROW(thread_safe_executor_ && thread_safe_executor_.ThreadSafe(),
21 "Can not get thread_safe_executor");
22
23 // Get time schedule executor
24 time_schedule_executor_ = core_.GetExecutorManager().GetExecutor("time_schedule_executor");
25 AIMRT_CHECK_ERROR_THROW(time_schedule_executor_ && time_schedule_executor_.SupportTimerSchedule(),
26 "Can not get time_schedule_executor");
27
28 AIMRT_INFO("Init succeeded.");
29
30 return true;
31}
32
33bool ExecutorModule::Start() {
34 // Test simple execute

Callers

nothing calls this directly

Calls 4

GetExecutorManagerMethod · 0.80
GetExecutorMethod · 0.45
ThreadSafeMethod · 0.45
SupportTimerScheduleMethod · 0.45

Tested by

no test coverage detected