Template Class EventHandler

Inheritance Relationships

Base Type

Class Documentation

template<typename EventCallbackT, typename ParentHandleT>
class EventHandler : public rclcpp::EventHandlerBase

Public Functions

template<typename InitFuncT, typename EventTypeEnum>
inline EventHandler(const EventCallbackT &callback, InitFuncT init_func, ParentHandleT parent_handle, EventTypeEnum event_type)
inline ~EventHandler()
inline virtual std::shared_ptr<void> take_data() override

Take data so that the callback cannot be scheduled again.

inline virtual std::shared_ptr<void> take_data_by_entity_id(size_t id) override

Take the data so that it can be consumed with execute.

This function allows to specify an entity ID to take the data from. Entity IDs are identifiers that can be defined by waitable-derived classes that are composed of several distinct entities. The main use-case is in conjunction with the listener APIs.

Parameters:

id[in] the id of the entity from which to take

Returns:

the type-erased data taken from entity specified

inline virtual void execute(const std::shared_ptr<void> &data) override

Execute any entities of the Waitable that are ready.