Template Class GenericTimer

Inheritance Relationships

Base Type

Derived Type

Class Documentation

template<typename FunctorT>
class GenericTimer : public agnocast::TimerBase

Timer that fires periodically using a user-provided clock.

The callback signature is detected at compile time: if the functor accepts a TimerBase& argument it receives a reference to this timer, otherwise it is called with no arguments.

Template Parameters:

FunctorT – Callback type; must be invocable as void() or void(TimerBase&).

Subclassed by agnocast::WallTimer< FunctorT >

Public Functions

inline GenericTimer(uint32_t timer_id, std::chrono::nanoseconds period, rclcpp::Clock::SharedPtr clock, FunctorT &&callback)
inline virtual void execute_callback() override
inline virtual AGNOCAST_PUBLIC bool is_steady () const override

Return whether this timer uses a steady clock.

Returns:

True if the clock is steady.

inline virtual AGNOCAST_PUBLIC rclcpp::Clock::SharedPtr get_clock () const override

Get the clock associated with this timer.

Returns:

Shared pointer to the clock.

Protected Attributes

rclcpp::Clock::SharedPtr clock_
FunctorT callback_