ROS 2 rclcpp + rcl - humble  humble
ROS 2 C++ Client Library with ROS Client Library
Public Member Functions | List of all members
rclcpp::QOSEventHandler< EventCallbackT, ParentHandleT > Class Template Reference
Inheritance diagram for rclcpp::QOSEventHandler< EventCallbackT, ParentHandleT >:
Inheritance graph
[legend]
Collaboration diagram for rclcpp::QOSEventHandler< EventCallbackT, ParentHandleT >:
Collaboration graph
[legend]

Public Member Functions

template<typename InitFuncT , typename EventTypeEnum >
 QOSEventHandler (const EventCallbackT &callback, InitFuncT init_func, ParentHandleT parent_handle, EventTypeEnum event_type)
 
std::shared_ptr< void > take_data () override
 Take data so that the callback cannot be scheduled again.
 
std::shared_ptr< void > take_data_by_entity_id (size_t id) override
 Take the data so that it can be consumed with execute. More...
 
void execute (std::shared_ptr< void > &data) override
 Execute any entities of the Waitable that are ready.
 
- Public Member Functions inherited from rclcpp::QOSEventHandlerBase
RCLCPP_PUBLIC size_t get_number_of_ready_events () override
 Get the number of ready events.
 
RCLCPP_PUBLIC void add_to_wait_set (rcl_wait_set_t *wait_set) override
 Add the Waitable to a wait set.
 
RCLCPP_PUBLIC bool is_ready (rcl_wait_set_t *wait_set) override
 Check if the Waitable is ready.
 
void set_on_ready_callback (std::function< void(size_t, int)> callback) override
 Set a callback to be called when each new event instance occurs. More...
 
void clear_on_ready_callback () override
 Unset the callback registered for new events, if any.
 
- Public Member Functions inherited from rclcpp::Waitable
virtual RCLCPP_PUBLIC size_t get_number_of_ready_subscriptions ()
 Get the number of ready subscriptions. More...
 
virtual RCLCPP_PUBLIC size_t get_number_of_ready_timers ()
 Get the number of ready timers. More...
 
virtual RCLCPP_PUBLIC size_t get_number_of_ready_clients ()
 Get the number of ready clients. More...
 
virtual RCLCPP_PUBLIC size_t get_number_of_ready_services ()
 Get the number of ready services. More...
 
virtual RCLCPP_PUBLIC size_t get_number_of_ready_guard_conditions ()
 Get the number of ready guard_conditions. More...
 
RCLCPP_PUBLIC bool exchange_in_use_by_wait_set_state (bool in_use_state)
 Exchange the "in use by wait set" state for this timer. More...
 

Additional Inherited Members

- Public Types inherited from rclcpp::QOSEventHandlerBase
enum class  EntityType : std::size_t { Event }
 
- Protected Member Functions inherited from rclcpp::QOSEventHandlerBase
RCLCPP_PUBLIC void set_on_new_event_callback (rcl_event_callback_t callback, const void *user_data)
 
- Protected Attributes inherited from rclcpp::QOSEventHandlerBase
rcl_event_t event_handle_
 
size_t wait_set_event_index_
 
std::recursive_mutex callback_mutex_
 
std::function< void(size_t)> on_new_event_callback_ {nullptr}
 

Detailed Description

template<typename EventCallbackT, typename ParentHandleT>
class rclcpp::QOSEventHandler< EventCallbackT, ParentHandleT >

Definition at line 223 of file qos_event.hpp.

Member Function Documentation

◆ take_data_by_entity_id()

template<typename EventCallbackT , typename ParentHandleT >
std::shared_ptr<void> rclcpp::QOSEventHandler< EventCallbackT, ParentHandleT >::take_data_by_entity_id ( size_t  id)
inlineoverridevirtual

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
[in]idthe id of the entity from which to take
Returns
the type-erased data taken from entity specified
See also
rclcpp::Waitable::take_data
rclcpp::Waitable::set_on_ready_callback

Reimplemented from rclcpp::Waitable.

Definition at line 263 of file qos_event.hpp.

References rclcpp::QOSEventHandler< EventCallbackT, ParentHandleT >::take_data().

Here is the call graph for this function:

The documentation for this class was generated from the following file: