rclcpp
master
C++ ROS Client Library API
|
#include <subscription_intra_process_base.hpp>
Public Member Functions | |
SubscriptionIntraProcessBase (const std::string &topic_name, rmw_qos_profile_t qos_profile) | |
virtual | ~SubscriptionIntraProcessBase ()=default |
size_t | get_number_of_ready_guard_conditions () |
Get the number of ready guard_conditions. More... | |
bool | add_to_wait_set (rcl_wait_set_t *wait_set) |
Add the Waitable to a wait set. More... | |
virtual bool | is_ready (rcl_wait_set_t *wait_set)=0 |
Check if the Waitable is ready. More... | |
virtual std::shared_ptr< void > | take_data ()=0 |
Take the data so that it can be consumed with execute . More... | |
virtual void | execute (std::shared_ptr< void > &data)=0 |
Execute data that is passed in. More... | |
virtual bool | use_take_shared_method () const =0 |
const char * | get_topic_name () const |
rmw_qos_profile_t | get_actual_qos () const |
Public Member Functions inherited from rclcpp::Waitable | |
virtual | ~Waitable ()=default |
virtual size_t | get_number_of_ready_subscriptions () |
Get the number of ready subscriptions. More... | |
virtual size_t | get_number_of_ready_timers () |
Get the number of ready timers. More... | |
virtual size_t | get_number_of_ready_clients () |
Get the number of ready clients. More... | |
virtual size_t | get_number_of_ready_events () |
Get the number of ready events. More... | |
virtual size_t | get_number_of_ready_services () |
Get the number of ready services. More... | |
bool | exchange_in_use_by_wait_set_state (bool in_use_state) |
Exchange the "in use by wait set" state for this timer. More... | |
Protected Attributes | |
std::recursive_mutex | reentrant_mutex_ |
rcl_guard_condition_t | gc_ |
|
inline |
|
virtualdefault |
|
inlinevirtual |
Get the number of ready guard_conditions.
Returns a value of 0 by default. This should be overridden if the Waitable contains one or more guard_conditions.
Reimplemented from rclcpp::Waitable.
|
virtual |
Add the Waitable to a wait set.
[in] | wait_set | A handle to the wait set to add the Waitable to. |
true
if the Waitable is added successfully, false
otherwise. rclcpp::execptions::RCLError | from rcl_wait_set_add_*() |
Implements rclcpp::Waitable.
|
pure virtual |
Check if the Waitable is ready.
The input wait set should be the same that was used in a previously call to add_to_wait_set()
. The wait set should also have been previously waited on with rcl_wait()
.
[in] | wait_set | A handle to the wait set the Waitable was previously added to and that has been waited on. |
true
if the Waitable is ready, false
otherwise. Implements rclcpp::Waitable.
Implemented in rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >.
|
pure virtual |
Take the data so that it can be consumed with execute
.
NOTE: take_data is a partial fix to a larger design issue with the multithreaded executor. This method is likely to be removed when a more permanent fix is implemented. A longterm fix is currently being discussed here: https://github.com/ros2/rclcpp/pull/1276
This method takes the data from the underlying data structure and writes it to the void shared pointer data
that is passed into the method. The data
can then be executed with the execute
method.
Before calling this method, the Waitable should be added to a wait set, waited on, and then updated.
Example usage:
Implements rclcpp::Waitable.
Implemented in rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >.
|
pure virtual |
Execute data that is passed in.
Before calling this method, the Waitable should be added to a wait set, waited on, and then updated - and the take_data
method should be called.
Example usage:
Implements rclcpp::Waitable.
Implemented in rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >.
|
pure virtual |
const char* rclcpp::experimental::SubscriptionIntraProcessBase::get_topic_name | ( | ) | const |
rmw_qos_profile_t rclcpp::experimental::SubscriptionIntraProcessBase::get_actual_qos | ( | ) | const |
|
protected |
|
protected |