15 #ifndef RCLCPP__SUBSCRIPTION_BASE_HPP_ 16 #define RCLCPP__SUBSCRIPTION_BASE_HPP_ 38 namespace node_interfaces
40 class NodeBaseInterface;
43 namespace experimental
49 class IntraProcessManager;
70 const rosidl_message_type_support_t & type_support_handle,
73 bool is_serialized =
false);
77 virtual ~SubscriptionBase();
82 get_topic_name()
const;
86 get_subscription_handle();
90 get_subscription_handle()
const;
96 get_event_handlers()
const;
111 get_actual_qos()
const;
118 create_message() = 0;
125 create_serialized_message() = 0;
140 handle_loaned_message(
void * loaned_message,
const rmw_message_info_t & message_info) = 0;
157 const rosidl_message_type_support_t &
158 get_message_type_support_handle()
const;
162 is_serialized()
const;
168 get_publisher_count()
const;
179 can_loan_messages()
const;
188 uint64_t intra_process_subscription_id,
194 get_intra_process_waitable()
const;
197 template<
typename EventCallbackT>
200 const EventCallbackT & callback,
203 auto handler = std::make_shared<QOSEventHandler<EventCallbackT>>(
206 get_subscription_handle().get(),
208 event_handlers_.emplace_back(handler);
213 matches_any_intra_process_publishers(
const rmw_gid_t * sender_gid)
const;
230 rosidl_message_type_support_t type_support_;
236 #endif // RCLCPP__SUBSCRIPTION_BASE_HPP_ std::vector< std::shared_ptr< rclcpp::QOSEventHandlerBase > > event_handlers_
Definition: subscription_base.hpp:221
IntraProcessManagerWeakPtr weak_ipm_
Definition: subscription_base.hpp:224
std::shared_ptr< rcl_subscription_t > subscription_handle_
Definition: subscription_base.hpp:218
rclcpp::node_interfaces::NodeBaseInterface *const node_base_
Definition: subscription_base.hpp:215
#define RCLCPP_DISABLE_COPY(...)
Definition: macros.hpp:26
rcl_ret_t rcl_subscription_event_init(rcl_event_t *event, const rcl_subscription_t *subscription, const rcl_subscription_event_type_t event_type)
Encapsulation of Quality of Service settings.
Definition: qos.hpp:55
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
void add_event_handler(const EventCallbackT &callback, const rcl_subscription_event_type_t event_type)
Definition: subscription_base.hpp:199
std::shared_ptr< rcl_subscription_t > intra_process_subscription_handle_
Definition: subscription_base.hpp:219
uint64_t intra_process_subscription_id_
Definition: subscription_base.hpp:225
bool use_intra_process_
Definition: subscription_base.hpp:223
Pure virtual interface class for the NodeBase part of the Node API.
Definition: node_base_interface.hpp:36
#define RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(...)
Definition: macros.hpp:51
std::shared_ptr< rcl_node_t > node_handle_
Definition: subscription_base.hpp:217
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
Set the data type used in the intra-process buffer as std::shared_ptr<MessageT>
Definition: subscription_base.hpp:54
rcl_subscription_event_type_t