rclcpp  master
C++ ROS Client Library API
Public Member Functions | Protected Attributes | List of all members
rclcpp::experimental::SubscriptionIntraProcessBase Class Referenceabstract

#include <subscription_intra_process_base.hpp>

Inheritance diagram for rclcpp::experimental::SubscriptionIntraProcessBase:
Inheritance graph
[legend]
Collaboration diagram for rclcpp::experimental::SubscriptionIntraProcessBase:
Collaboration graph
[legend]

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 void execute ()=0
 Execute any entities of the Waitable that are ready. 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 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...
 

Protected Attributes

std::recursive_mutex reentrant_mutex_
 
rcl_guard_condition_t gc_
 

Constructor & Destructor Documentation

◆ SubscriptionIntraProcessBase()

rclcpp::experimental::SubscriptionIntraProcessBase::SubscriptionIntraProcessBase ( const std::string topic_name,
rmw_qos_profile_t  qos_profile 
)
inline

◆ ~SubscriptionIntraProcessBase()

virtual rclcpp::experimental::SubscriptionIntraProcessBase::~SubscriptionIntraProcessBase ( )
virtualdefault

Member Function Documentation

◆ get_number_of_ready_guard_conditions()

size_t rclcpp::experimental::SubscriptionIntraProcessBase::get_number_of_ready_guard_conditions ( )
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.

Returns
The number of guard_conditions associated with the Waitable.

Reimplemented from rclcpp::Waitable.

◆ add_to_wait_set()

bool rclcpp::experimental::SubscriptionIntraProcessBase::add_to_wait_set ( rcl_wait_set_t wait_set)
virtual

Add the Waitable to a wait set.

Parameters
[in]wait_setA handle to the wait set to add the Waitable to.
Returns
true if the Waitable is added successfully, false otherwise.
Exceptions
rclcpp::execptions::RCLErrorfrom rcl_wait_set_add_*()

Implements rclcpp::Waitable.

◆ is_ready()

virtual bool rclcpp::experimental::SubscriptionIntraProcessBase::is_ready ( rcl_wait_set_t )
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().

Parameters
[in]wait_setA handle to the wait set the Waitable was previously added to and that has been waited on.
Returns
true if the Waitable is ready, false otherwise.

Implements rclcpp::Waitable.

Implemented in rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >.

◆ execute()

virtual void rclcpp::experimental::SubscriptionIntraProcessBase::execute ( )
pure virtual

Execute any entities of the Waitable that are ready.

Before calling this method, the Waitable should be added to a wait set, waited on, and then updated.

Example usage:

// ... create a wait set and a Waitable
// Add the Waitable to the wait set
bool add_ret = waitable.add_to_wait_set(wait_set);
// ... error handling
// Wait
rcl_ret_t wait_ret = rcl_wait(wait_set);
// ... error handling
// Update the Waitable
waitable.update(wait_set);
// Execute any entities of the Waitable that may be ready
waitable.execute();

Implements rclcpp::Waitable.

Implemented in rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >.

◆ use_take_shared_method()

virtual bool rclcpp::experimental::SubscriptionIntraProcessBase::use_take_shared_method ( ) const
pure virtual

◆ get_topic_name()

const char* rclcpp::experimental::SubscriptionIntraProcessBase::get_topic_name ( ) const

◆ get_actual_qos()

rmw_qos_profile_t rclcpp::experimental::SubscriptionIntraProcessBase::get_actual_qos ( ) const

Member Data Documentation

◆ reentrant_mutex_

std::recursive_mutex rclcpp::experimental::SubscriptionIntraProcessBase::reentrant_mutex_
protected

◆ gc_

rcl_guard_condition_t rclcpp::experimental::SubscriptionIntraProcessBase::gc_
protected

The documentation for this class was generated from the following file: