rclcpp  master
C++ ROS Client Library API
Public Types | Public Member Functions | List of all members
rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT > Class Template Reference

#include <subscription_intra_process.hpp>

Inheritance diagram for rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >:
Inheritance graph
[legend]
Collaboration diagram for rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >:
Collaboration graph
[legend]

Public Types

using MessageAllocTraits = allocator::AllocRebind< MessageT, Alloc >
 
using MessageAlloc = typename MessageAllocTraits::allocator_type
 
using ConstMessageSharedPtr = std::shared_ptr< const MessageT >
 
using MessageUniquePtr = std::unique_ptr< MessageT, Deleter >
 
using BufferUniquePtr = typename rclcpp::experimental::buffers::IntraProcessBuffer< MessageT, Alloc, Deleter >::UniquePtr
 

Public Member Functions

 SubscriptionIntraProcess (AnySubscriptionCallback< CallbackMessageT, Alloc > callback, std::shared_ptr< Alloc > allocator, rclcpp::Context::SharedPtr context, const std::string &topic_name, rmw_qos_profile_t qos_profile, rclcpp::IntraProcessBufferType buffer_type)
 
bool is_ready (rcl_wait_set_t *wait_set)
 Check if the Waitable is ready. More...
 
void execute ()
 Execute any entities of the Waitable that are ready. More...
 
void provide_intra_process_message (ConstMessageSharedPtr message)
 
void provide_intra_process_message (MessageUniquePtr message)
 
bool use_take_shared_method () const
 
- Public Member Functions inherited from rclcpp::experimental::SubscriptionIntraProcessBase
 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...
 
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...
 

Additional Inherited Members

- Protected Attributes inherited from rclcpp::experimental::SubscriptionIntraProcessBase
std::recursive_mutex reentrant_mutex_
 
rcl_guard_condition_t gc_
 

Member Typedef Documentation

◆ MessageAllocTraits

template<typename MessageT , typename Alloc = std::allocator<void>, typename Deleter = std::default_delete<MessageT>, typename CallbackMessageT = MessageT>
using rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >::MessageAllocTraits = allocator::AllocRebind<MessageT, Alloc>

◆ MessageAlloc

template<typename MessageT , typename Alloc = std::allocator<void>, typename Deleter = std::default_delete<MessageT>, typename CallbackMessageT = MessageT>
using rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >::MessageAlloc = typename MessageAllocTraits::allocator_type

◆ ConstMessageSharedPtr

template<typename MessageT , typename Alloc = std::allocator<void>, typename Deleter = std::default_delete<MessageT>, typename CallbackMessageT = MessageT>
using rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >::ConstMessageSharedPtr = std::shared_ptr<const MessageT>

◆ MessageUniquePtr

template<typename MessageT , typename Alloc = std::allocator<void>, typename Deleter = std::default_delete<MessageT>, typename CallbackMessageT = MessageT>
using rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >::MessageUniquePtr = std::unique_ptr<MessageT, Deleter>

◆ BufferUniquePtr

template<typename MessageT , typename Alloc = std::allocator<void>, typename Deleter = std::default_delete<MessageT>, typename CallbackMessageT = MessageT>
using rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >::BufferUniquePtr = typename rclcpp::experimental::buffers::IntraProcessBuffer< MessageT, Alloc, Deleter >::UniquePtr

Constructor & Destructor Documentation

◆ SubscriptionIntraProcess()

template<typename MessageT , typename Alloc = std::allocator<void>, typename Deleter = std::default_delete<MessageT>, typename CallbackMessageT = MessageT>
rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >::SubscriptionIntraProcess ( AnySubscriptionCallback< CallbackMessageT, Alloc >  callback,
std::shared_ptr< Alloc >  allocator,
rclcpp::Context::SharedPtr  context,
const std::string topic_name,
rmw_qos_profile_t  qos_profile,
rclcpp::IntraProcessBufferType  buffer_type 
)
inline

Member Function Documentation

◆ is_ready()

template<typename MessageT , typename Alloc = std::allocator<void>, typename Deleter = std::default_delete<MessageT>, typename CallbackMessageT = MessageT>
bool rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >::is_ready ( rcl_wait_set_t )
inlinevirtual

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::experimental::SubscriptionIntraProcessBase.

◆ execute()

template<typename MessageT , typename Alloc = std::allocator<void>, typename Deleter = std::default_delete<MessageT>, typename CallbackMessageT = MessageT>
void rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >::execute ( )
inlinevirtual

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::experimental::SubscriptionIntraProcessBase.

◆ provide_intra_process_message() [1/2]

template<typename MessageT , typename Alloc = std::allocator<void>, typename Deleter = std::default_delete<MessageT>, typename CallbackMessageT = MessageT>
void rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >::provide_intra_process_message ( ConstMessageSharedPtr  message)
inline

◆ provide_intra_process_message() [2/2]

template<typename MessageT , typename Alloc = std::allocator<void>, typename Deleter = std::default_delete<MessageT>, typename CallbackMessageT = MessageT>
void rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >::provide_intra_process_message ( MessageUniquePtr  message)
inline

◆ use_take_shared_method()

template<typename MessageT , typename Alloc = std::allocator<void>, typename Deleter = std::default_delete<MessageT>, typename CallbackMessageT = MessageT>
bool rclcpp::experimental::SubscriptionIntraProcess< MessageT, Alloc, Deleter, CallbackMessageT >::use_take_shared_method ( ) const
inlinevirtual

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