rmw  master
C API providing a middleware abstraction layer which is used to implement the rest of ROS.
Classes | Typedefs | Enumerations | Functions
event.h File Reference
#include <stdint.h>
#include "rcutils/allocator.h"
#include "rmw/macros.h"
#include "rmw/types.h"
#include "rmw/ret_types.h"
#include "rmw/visibility_control.h"
Include dependency graph for event.h:

Go to the source code of this file.

Classes

struct  rmw_event_t
 Encapsulate the RMW event implementation, data, and type. More...
 

Typedefs

typedef enum rmw_event_type_t rmw_event_type_t
 Define publisher/subscription events. More...
 
typedef struct RMW_PUBLIC_TYPE rmw_event_t rmw_event_t
 Encapsulate the RMW event implementation, data, and type. More...
 

Enumerations

enum  rmw_event_type_t {
  RMW_EVENT_LIVELINESS_CHANGED, RMW_EVENT_REQUESTED_DEADLINE_MISSED, RMW_EVENT_REQUESTED_QOS_INCOMPATIBLE, RMW_EVENT_MESSAGE_LOST,
  RMW_EVENT_LIVELINESS_LOST, RMW_EVENT_OFFERED_DEADLINE_MISSED, RMW_EVENT_OFFERED_QOS_INCOMPATIBLE, RMW_EVENT_INVALID
}
 Define publisher/subscription events. More...
 

Functions

rmw_event_t rmw_get_zero_initialized_event (void)
 Return a zero initialized event structure. More...
 
rmw_ret_t rmw_publisher_event_init (rmw_event_t *rmw_event, const rmw_publisher_t *publisher, rmw_event_type_t event_type)
 Initialize a rmw publisher event. More...
 
rmw_ret_t rmw_subscription_event_init (rmw_event_t *rmw_event, const rmw_subscription_t *subscription, rmw_event_type_t event_type)
 Initialize a rmw subscription event. More...
 
rmw_ret_t rmw_take_event (const rmw_event_t *event_handle, void *event_info, bool *taken)
 Take an event from the event handle. More...
 
rmw_ret_t rmw_event_fini (rmw_event_t *event)
 Finalize an rmw_event_t. More...
 

Typedef Documentation

◆ rmw_event_type_t

Define publisher/subscription events.

◆ rmw_event_t

Encapsulate the RMW event implementation, data, and type.

Enumeration Type Documentation

◆ rmw_event_type_t

Define publisher/subscription events.

Enumerator
RMW_EVENT_LIVELINESS_CHANGED 
RMW_EVENT_REQUESTED_DEADLINE_MISSED 
RMW_EVENT_REQUESTED_QOS_INCOMPATIBLE 
RMW_EVENT_MESSAGE_LOST 
RMW_EVENT_LIVELINESS_LOST 
RMW_EVENT_OFFERED_DEADLINE_MISSED 
RMW_EVENT_OFFERED_QOS_INCOMPATIBLE 
RMW_EVENT_INVALID 

Function Documentation

◆ rmw_get_zero_initialized_event()

rmw_event_t rmw_get_zero_initialized_event ( void  )

Return a zero initialized event structure.

◆ rmw_publisher_event_init()

rmw_ret_t rmw_publisher_event_init ( rmw_event_t rmw_event,
const rmw_publisher_t publisher,
rmw_event_type_t  event_type 
)

Initialize a rmw publisher event.

Parameters
[in|out]rmw_event to initialize
[in]publisherto initialize with
[in|out]event_type for the event to initialize
Returns
RMW_RET_OK if successful, or
RMW_RET_INVALID_ARGUMENT if invalid argument, or
RMW_RET_UNSUPPORTED if event_type is not supported, or
RMW_RET_ERROR if an unexpected error occurs.

◆ rmw_subscription_event_init()

rmw_ret_t rmw_subscription_event_init ( rmw_event_t rmw_event,
const rmw_subscription_t subscription,
rmw_event_type_t  event_type 
)

Initialize a rmw subscription event.

Parameters
[in|out]rmw_event to initialize
[in]subscriptionto initialize with
[in|out]event_type for the event to handle
Returns
RMW_RET_OK if successful, or
RMW_RET_INVALID_ARGUMENT if invalid argument, or
RMW_RET_UNSUPPORTED if event_type is not supported, or
RMW_RET_ERROR if an unexpected error occurs.

◆ rmw_take_event()

rmw_ret_t rmw_take_event ( const rmw_event_t event_handle,
void *  event_info,
bool *  taken 
)

Take an event from the event handle.

Parameters
[in]event_handleevent object to take from
[in|out]event_info event info object to write taken data into
[out]takenboolean flag indicating if an event was taken or not
Returns
RMW_RET_OK if successful, or
RMW_RET_BAD_ALLOC if memory allocation failed, or
RMW_RET_ERROR if an unexpected error occurs.

◆ rmw_event_fini()

rmw_ret_t rmw_event_fini ( rmw_event_t event)

Finalize an rmw_event_t.

Parameters
[in]eventto finalize