15 #ifndef RCLCPP__TIMER_HPP_ 16 #define RCLCPP__TIMER_HPP_ 23 #include <type_traits> 116 :
TimerBase(period), callback_(
std::forward<FunctorT>(callback))
137 execute_callback_delegate<>();
142 typename CallbackT = FunctorT,
154 typename CallbackT = FunctorT,
168 return Clock::is_steady;
177 template<typename CallbackType>
182 #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:166
#define RCL_RET_TIMER_CANCELED
Definition: allocator_common.hpp:24
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.
std::shared_ptr< const rcl_timer_t > get_timer_handle()
void execute_callback()
Definition: timer.hpp:128
virtual bool is_steady()=0
Is the clock steady (i.e. is the time between ticks constant?)
std::shared_ptr< rcl_timer_t > timer_handle_
Definition: timer.hpp:88
#define RCLCPP_SMART_PTR_DEFINITIONS(...)
Definition: macros.hpp:36
void execute_callback_delegate()
Definition: timer.hpp:148
Definition: function_traits.hpp:143
TimerBase(std::chrono::nanoseconds period)
bool is_ready()
Check if the timer is ready to trigger the callback.
#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