15 #ifndef RCLCPP__TIMER_HPP_ 16 #define RCLCPP__TIMER_HPP_ 23 #include <type_traits> 116 :
TimerBase(period), callback_(
std::forward<FunctorT>(callback))
140 execute_callback_delegate<>();
145 typename CallbackT = FunctorT,
157 typename CallbackT = FunctorT,
171 return Clock::is_steady;
180 template<typename CallbackType>
185 #endif // RCLCPP__TIMER_HPP_
Generic timer templated on the clock type. Periodically executes a user-specified callback...
Definition: timer.hpp:105
#define RCLCPP_DISABLE_COPY(...)
Definition: macros.hpp:26
virtual bool is_steady()
Is the clock steady (i.e. is the time between ticks constant?)
Definition: timer.hpp:169
#define RCL_RET_TIMER_CANCELED
rcl_timer_t timer_handle_
Definition: timer.hpp:88
const rcl_timer_t * get_timer_handle()
Definition: allocator_common.hpp:24
rcl_ret_t rcl_timer_fini(rcl_timer_t *timer)
rcl_timer_t rcl_get_zero_initialized_timer(void)
rcl_ret_t rcl_timer_call(rcl_timer_t *timer)
std::chrono::nanoseconds time_until_trigger()
Check how long the timer has until its next scheduled callback.
void execute_callback()
Definition: timer.hpp:131
virtual bool is_steady()=0
Is the clock steady (i.e. is the time between ticks constant?)
#define RCLCPP_SMART_PTR_DEFINITIONS(...)
Definition: macros.hpp:36
void execute_callback_delegate()
Definition: timer.hpp:151
Definition: function_traits.hpp:143
TimerBase(std::chrono::nanoseconds period)
bool is_ready()
Check if the timer is ready to trigger the callback.
#define rcl_get_error_string_safe
#define RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(...)
Definition: macros.hpp:51
virtual ~GenericTimer()
Default destructor.
Definition: timer.hpp:121
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
virtual void execute_callback()=0