15 #ifndef RCLCPP__SUBSCRIPTION_BASE_HPP_ 16 #define RCLCPP__SUBSCRIPTION_BASE_HPP_ 24 #include "rcl_interfaces/msg/intra_process_message.hpp" 37 namespace node_interfaces
39 class NodeTopicsInterface;
42 namespace intra_process_manager
48 class IntraProcessManager;
69 const rosidl_message_type_support_t & type_support_handle,
72 bool is_serialized =
false);
76 virtual ~SubscriptionBase();
81 get_topic_name()
const;
85 get_subscription_handle();
89 get_subscription_handle()
const;
93 get_intra_process_subscription_handle()
const;
99 get_event_handlers()
const;
104 create_message() = 0;
109 create_serialized_message() = 0;
130 handle_intra_process_message(
131 rcl_interfaces::msg::IntraProcessMessage & ipm,
134 const rosidl_message_type_support_t &
135 get_message_type_support_handle()
const;
138 is_serialized()
const;
144 get_publisher_count()
const;
150 void setup_intra_process(
151 uint64_t intra_process_subscription_id,
156 template<
typename EventCallbackT>
159 const EventCallbackT & callback,
162 auto handler = std::make_shared<QOSEventHandler<EventCallbackT>>(
165 get_subscription_handle().get(),
167 event_handlers_.emplace_back(handler);
183 rosidl_message_type_support_t type_support_;
189 #endif // RCLCPP__SUBSCRIPTION_BASE_HPP_ std::vector< std::shared_ptr< rclcpp::QOSEventHandlerBase > > event_handlers_
Definition: subscription_base.hpp:174
IntraProcessManagerWeakPtr weak_ipm_
Definition: subscription_base.hpp:177
std::shared_ptr< rcl_subscription_t > subscription_handle_
Definition: subscription_base.hpp:171
#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)
This header provides the get_node_topics_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:158
std::shared_ptr< rcl_subscription_t > intra_process_subscription_handle_
Definition: subscription_base.hpp:172
uint64_t intra_process_subscription_id_
Definition: subscription_base.hpp:178
bool use_intra_process_
Definition: subscription_base.hpp:176
#define RCLCPP_SMART_PTR_DEFINITIONS_NOT_COPYABLE(...)
Definition: macros.hpp:51
std::shared_ptr< rcl_node_t > node_handle_
Definition: subscription_base.hpp:170
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
Definition: subscription_base.hpp:53
rcl_subscription_event_type_t