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

Function CreateTimer

src/interface/aimrt_module_cpp_interface/executor/timer.h:122–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120
121template <typename TaskType>
122std::shared_ptr<TimerBase> CreateTimer(ExecutorRef executor, std::chrono::nanoseconds period,
123 TaskType&& task, bool auto_start = true) {
124 AIMRT_ASSERT(executor, "Executor is null.");
125 AIMRT_ASSERT(executor.SupportTimerSchedule(), "Executor does not support timer scheduling.");
126 AIMRT_ASSERT(period >= std::chrono::nanoseconds::zero(), "Timer period must not be negative.");
127 auto timer = std::make_shared<Timer<TaskType>>(executor, period, std::forward<TaskType>(task));
128 if (auto_start) {
129 timer->Reset();
130 }
131 return timer;
132}
133
134} // namespace aimrt::executor

Callers 4

InitializeMethod · 0.85
InitExecutorMethod · 0.85
InitializeMethod · 0.85
StartMethod · 0.85

Calls 2

SupportTimerScheduleMethod · 0.45
ResetMethod · 0.45

Tested by

no test coverage detected