rclcpp  master
C++ ROS Client Library API
Public Member Functions | Static Public Member Functions | List of all members
rclcpp::WaitResult< WaitSetT > Class Template Referencefinal

Interface for introspecting a wait set after waiting on it. More...

#include <wait_result.hpp>

Public Member Functions

WaitResultKind kind () const
 Return the kind of the WaitResult. More...
 
const WaitSetT & get_wait_set () const
 Return the rcl wait set. More...
 
WaitSetT & get_wait_set ()
 Return the rcl wait set. More...
 
 WaitResult (WaitResult &&other) noexcept
 
 ~WaitResult ()
 

Static Public Member Functions

static WaitResult from_ready_wait_result_kind (WaitSetT &wait_set)
 Create WaitResult from a "ready" result. More...
 
static WaitResult from_timeout_wait_result_kind ()
 Create WaitResult from a "timeout" result. More...
 
static WaitResult from_empty_wait_result_kind ()
 Create WaitResult from a "empty" result. More...
 

Detailed Description

template<class WaitSetT>
class rclcpp::WaitResult< WaitSetT >

Interface for introspecting a wait set after waiting on it.

This class:

This class is only valid as long as the wait set which created it is valid, and it must be deleted before the wait set is deleted, as it contains a back reference to the wait set.

An instance of this, which is returned from rclcpp::WaitSetTemplate::wait(), will cause the wait set to keep ownership of the entities because it only holds a reference to the sequences of them, rather than taking a copy. Also, in the thread-safe case, an instance of this will cause the wait set, to block calls which modify the sequences of the entities, e.g. add/remove guard condition or subscription methods.

Template Parameters
WaitSetTThe wait set type which created this class.

Constructor & Destructor Documentation

◆ WaitResult()

template<class WaitSetT >
rclcpp::WaitResult< WaitSetT >::WaitResult ( WaitResult< WaitSetT > &&  other)
inlinenoexcept

◆ ~WaitResult()

template<class WaitSetT >
rclcpp::WaitResult< WaitSetT >::~WaitResult ( )
inline

Member Function Documentation

◆ from_ready_wait_result_kind()

template<class WaitSetT >
static WaitResult rclcpp::WaitResult< WaitSetT >::from_ready_wait_result_kind ( WaitSetT &  wait_set)
inlinestatic

Create WaitResult from a "ready" result.

Parameters
[in]wait_setA reference to the wait set, which this class will keep for the duration of its lifetime.
Returns
a WaitResult from a "ready" result.

◆ from_timeout_wait_result_kind()

template<class WaitSetT >
static WaitResult rclcpp::WaitResult< WaitSetT >::from_timeout_wait_result_kind ( )
inlinestatic

Create WaitResult from a "timeout" result.

◆ from_empty_wait_result_kind()

template<class WaitSetT >
static WaitResult rclcpp::WaitResult< WaitSetT >::from_empty_wait_result_kind ( )
inlinestatic

Create WaitResult from a "empty" result.

◆ kind()

template<class WaitSetT >
WaitResultKind rclcpp::WaitResult< WaitSetT >::kind ( ) const
inline

Return the kind of the WaitResult.

◆ get_wait_set() [1/2]

template<class WaitSetT >
const WaitSetT& rclcpp::WaitResult< WaitSetT >::get_wait_set ( ) const
inline

Return the rcl wait set.

Returns
const rcl wait set.
Exceptions
std::runtime_errorif the class cannot access wait set when the result was not ready

◆ get_wait_set() [2/2]

template<class WaitSetT >
WaitSetT& rclcpp::WaitResult< WaitSetT >::get_wait_set ( )
inline

Return the rcl wait set.

Returns
rcl wait set.
Exceptions
std::runtime_errorif the class cannot access wait set when the result was not ready

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