rclcpp
master
C++ ROS Client Library API
|
#include <subscription.hpp>
Public Member Functions | |
SubscriptionBase (std::shared_ptr< rcl_node_t > node_handle, const rosidl_message_type_support_t &type_support_handle, const std::string &topic_name, const rcl_subscription_options_t &subscription_options, bool is_serialized=false) | |
Default constructor. More... | |
virtual | ~SubscriptionBase () |
Default destructor. More... | |
const char * | get_topic_name () const |
Get the topic that this subscription is subscribed on. More... | |
std::shared_ptr< rcl_subscription_t > | get_subscription_handle () |
const std::shared_ptr< rcl_subscription_t > | get_subscription_handle () const |
virtual const std::shared_ptr< rcl_subscription_t > | get_intra_process_subscription_handle () const |
virtual std::shared_ptr< void > | create_message ()=0 |
Borrow a new message. More... | |
virtual std::shared_ptr< rcl_serialized_message_t > | create_serialized_message ()=0 |
Borrow a new serialized message. More... | |
virtual void | handle_message (std::shared_ptr< void > &message, const rmw_message_info_t &message_info)=0 |
Check if we need to handle the message, and execute the callback if we do. More... | |
virtual void | return_message (std::shared_ptr< void > &message)=0 |
Return the message borrowed in create_message. More... | |
virtual void | return_serialized_message (std::shared_ptr< rcl_serialized_message_t > &message)=0 |
Return the message borrowed in create_serialized_message. More... | |
virtual void | handle_intra_process_message (rcl_interfaces::msg::IntraProcessMessage &ipm, const rmw_message_info_t &message_info)=0 |
const rosidl_message_type_support_t & | get_message_type_support_handle () const |
bool | is_serialized () const |
Protected Attributes | |
std::shared_ptr< rcl_subscription_t > | intra_process_subscription_handle_ |
std::shared_ptr< rcl_subscription_t > | subscription_handle_ |
std::shared_ptr< rcl_node_t > | node_handle_ |
Virtual base class for subscriptions. This pattern allows us to iterate over different template specializations of Subscription, among other things.
rclcpp::SubscriptionBase::SubscriptionBase | ( | std::shared_ptr< rcl_node_t > | node_handle, |
const rosidl_message_type_support_t & | type_support_handle, | ||
const std::string & | topic_name, | ||
const rcl_subscription_options_t & | subscription_options, | ||
bool | is_serialized = false |
||
) |
Default constructor.
[in] | node_handle | The rcl representation of the node that owns this subscription. |
[in] | type_support_handle | rosidl type support struct, for the Message type of the topic. |
[in] | topic_name | Name of the topic to subscribe to. |
[in] | subscription_options | options for the subscription. |
[in] | is_serialized | is true if the message will be delivered still serialized |
|
virtual |
Default destructor.
const char* rclcpp::SubscriptionBase::get_topic_name | ( | ) | const |
Get the topic that this subscription is subscribed on.
std::shared_ptr<rcl_subscription_t> rclcpp::SubscriptionBase::get_subscription_handle | ( | ) |
const std::shared_ptr<rcl_subscription_t> rclcpp::SubscriptionBase::get_subscription_handle | ( | ) | const |
|
virtual |
Reimplemented in rclcpp::Subscription< CallbackMessageT, Alloc >.
|
pure virtual |
Borrow a new message.
Implemented in rclcpp::Subscription< CallbackMessageT, Alloc >.
|
pure virtual |
Borrow a new serialized message.
Implemented in rclcpp::Subscription< CallbackMessageT, Alloc >.
|
pure virtual |
Check if we need to handle the message, and execute the callback if we do.
[in] | message | Shared pointer to the message to handle. |
[in] | message_info | Metadata associated with this message. |
Implemented in rclcpp::Subscription< CallbackMessageT, Alloc >.
|
pure virtual |
Return the message borrowed in create_message.
[in] | message | Shared pointer to the returned message. |
Implemented in rclcpp::Subscription< CallbackMessageT, Alloc >.
|
pure virtual |
Return the message borrowed in create_serialized_message.
[in] | message | Shared pointer to the returned message. |
Implemented in rclcpp::Subscription< CallbackMessageT, Alloc >.
|
pure virtual |
Implemented in rclcpp::Subscription< CallbackMessageT, Alloc >.
const rosidl_message_type_support_t& rclcpp::SubscriptionBase::get_message_type_support_handle | ( | ) | const |
bool rclcpp::SubscriptionBase::is_serialized | ( | ) | const |
|
protected |
|
protected |
|
protected |