rclcpp
master
C++ ROS Client Library API
|
Go to the documentation of this file.
16 #ifndef RCLCPP__GENERIC_SUBSCRIPTION_HPP_
17 #define RCLCPP__GENERIC_SUBSCRIPTION_HPP_
23 #include "rcpputils/shared_library.hpp"
70 template<
typename AllocatorT = std::allocator<
void>>
94 RCL_SUBSCRIPTION_REQUESTED_DEADLINE_MISSED);
99 RCL_SUBSCRIPTION_LIVELINESS_CHANGED);
104 RCL_SUBSCRIPTION_REQUESTED_INCOMPATIBLE_QOS);
112 RCL_SUBSCRIPTION_REQUESTED_INCOMPATIBLE_QOS);
120 RCL_SUBSCRIPTION_MESSAGE_LOST);
161 #endif // RCLCPP__GENERIC_SUBSCRIPTION_HPP_
#define RCLCPP_DISABLE_COPY(...)
Definition: macros.hpp:26
std::shared_ptr< rclcpp::SerializedMessage > create_serialized_message() override
Borrow a new serialized message.
Subscription for serialized messages whose type is not known at compile time.
Definition: generic_subscription.hpp:45
Structure containing optional configuration for Subscriptions.
Definition: subscription_options.hpp:87
Definition: subscription_base.hpp:60
void default_incompatible_qos_callback(QOSRequestedIncompatibleQoSInfo &info) const
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
SubscriptionEventCallbacks event_callbacks
Callbacks for events related to this subscription.
Definition: subscription_options.hpp:40
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
bool use_default_callbacks
Whether or not to use default callbacks when user doesn't supply any in event_callbacks.
Definition: subscription_options.hpp:43
const rosidl_message_type_support_t * get_typesupport_handle(const std::string &type, const std::string &typesupport_identifier, rcpputils::SharedLibrary &library)
Extract the type support handle from the library.
Pure virtual interface class for the NodeBase part of the Node API.
Definition: node_base_interface.hpp:36
Encapsulation of Quality of Service settings.
Definition: qos.hpp:110
std::shared_ptr< void > create_message() override
Borrow a new message.
#define RCLCPP_SMART_PTR_DEFINITIONS(...)
Definition: macros.hpp:36
void return_message(std::shared_ptr< void > &message) override
Return the message borrowed in create_message.
Definition: qos_event.hpp:69
GenericSubscription(rclcpp::node_interfaces::NodeBaseInterface *node_base, const std::shared_ptr< rcpputils::SharedLibrary > ts_lib, const std::string &topic_name, const std::string &topic_type, const rclcpp::QoS &qos, std::function< void(std::shared_ptr< rclcpp::SerializedMessage >)> callback, const rclcpp::SubscriptionOptionsWithAllocator< AllocatorT > &options)
Constructor.
Definition: generic_subscription.hpp:71
Additional meta data about messages taken from subscriptions.
Definition: message_info.hpp:26
Object oriented version of rcl_serialized_message_t with destructor to avoid memory leaks.
Definition: serialized_message.hpp:27
void handle_message(std::shared_ptr< void > &message, const rclcpp::MessageInfo &message_info) override
Cast the message to a rclcpp::SerializedMessage and call the callback.
void return_serialized_message(std::shared_ptr< rclcpp::SerializedMessage > &message) override
Return the message borrowed in create_serialized_message.
virtual ~GenericSubscription()=default
void add_event_handler(const EventCallbackT &callback, const rcl_subscription_event_type_t event_type)
Definition: subscription_base.hpp:282
void handle_loaned_message(void *loaned_message, const rclcpp::MessageInfo &message_info) override
This function is currently not implemented.