rmw  master
C API providing a middleware abstraction layer which is used to implement the rest of ROS.
Classes | Typedefs | Functions
topic_endpoint_info_array.h File Reference
#include "rcutils/allocator.h"
#include "rmw/topic_endpoint_info.h"
#include "rmw/visibility_control.h"
Include dependency graph for topic_endpoint_info_array.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  rmw_topic_endpoint_info_array_t
 Array of rmw_topic_endpoint_info_t. More...
 

Typedefs

typedef struct RMW_PUBLIC_TYPE rmw_topic_endpoint_info_array_t rmw_topic_endpoint_info_array_t
 Array of rmw_topic_endpoint_info_t. More...
 

Functions

rmw_topic_endpoint_info_array_t rmw_get_zero_initialized_topic_endpoint_info_array (void)
 Return a rmw_topic_endpoint_info_array_t struct with members initialized to NULL. More...
 
rmw_ret_t rmw_topic_endpoint_info_array_check_zero (rmw_topic_endpoint_info_array_t *topic_endpoint_info_array)
 Check that a rmw_topic_endpoint_info_array_t struct is zero initialized. More...
 
rmw_ret_t rmw_topic_endpoint_info_array_init_with_size (rmw_topic_endpoint_info_array_t *topic_endpoint_info_array, size_t size, rcutils_allocator_t *allocator)
 Initialize the info_array member inside rmw_topic_endpoint_info_array_t with the given size. More...
 
rmw_ret_t rmw_topic_endpoint_info_array_fini (rmw_topic_endpoint_info_array_t *topic_endpoint_info_array, rcutils_allocator_t *allocator)
 Finalize a rmw_topic_endpoint_info_array_t object. More...
 

Typedef Documentation

◆ rmw_topic_endpoint_info_array_t

Function Documentation

◆ rmw_get_zero_initialized_topic_endpoint_info_array()

rmw_topic_endpoint_info_array_t rmw_get_zero_initialized_topic_endpoint_info_array ( void  )

Return a rmw_topic_endpoint_info_array_t struct with members initialized to NULL.

◆ rmw_topic_endpoint_info_array_check_zero()

rmw_ret_t rmw_topic_endpoint_info_array_check_zero ( rmw_topic_endpoint_info_array_t topic_endpoint_info_array)

Check that a rmw_topic_endpoint_info_array_t struct is zero initialized.

This function checks if the provided rmw_topic_endpoint_info_array_t is zero initialized or not.

If a non RMW_RET_OK return value is returned, the RMW error message will be set

Parameters
[in]topic_endpoint_info_arraythe data structure to be checked
Returns
RMW_RET_OK if topic_endpoint_info_array is zero initialized
RMW_RET_INVALID_ARGUMENT if the parameter is NULL, or
RMW_RET_ERROR if topic_endpoint_info_array is not zero initialized

◆ rmw_topic_endpoint_info_array_init_with_size()

rmw_ret_t rmw_topic_endpoint_info_array_init_with_size ( rmw_topic_endpoint_info_array_t topic_endpoint_info_array,
size_t  size,
rcutils_allocator_t allocator 
)

Initialize the info_array member inside rmw_topic_endpoint_info_array_t with the given size.

The rmw_topic_endpoint_info_array_t has a member variable info_array which is an array of type rmw_topic_endpoint_info_t. This function allocates memory to this array to hold n elements, where n is the value of the size param to this function. The member size is updated accordingly.

topic_endpoint_info_array must be zero initialized before being passed into this function.

If a non RMW_RET_OK return value is returned, the RMW error message will be set

Parameters
[in,out]topic_endpoint_info_arraythe data structure to initialise
[in]sizethe size of the array
[in]allocatorthe allocator to be used to allocate space
Returns
RMW_RET_OK on successful init, or
RMW_RET_INVALID_ARGUMENT if any of the parameters are NULL, or
RMW_RET_INVALID_ARGUMENT if topic_endpoint_info_array is not zero initialized, or
RMW_BAD_ALLOC if memory allocation fails, or
RMW_RET_ERROR when an unspecified error occurs.

◆ rmw_topic_endpoint_info_array_fini()

rmw_ret_t rmw_topic_endpoint_info_array_fini ( rmw_topic_endpoint_info_array_t topic_endpoint_info_array,
rcutils_allocator_t allocator 
)

Finalize a rmw_topic_endpoint_info_array_t object.

The info_array member variable inside of rmw_topic_endpoint_info_array represents an array of rmw_topic_endpoint_info_t. When initializing this array, memory is allocated for it using the allocator. This function reclaims any allocated resources within the object and also sets the value of size to 0.

If a non RMW_RET_OK return value is returned, the RMW error message will be set

Parameters
[in,out]topic_endpoint_info_arrayobject to be finalized
[in]allocatorthe allocator used to allocate memory to the object
Returns
RMW_RET_OK on successfully reclaiming memory, or
RMW_RET_INVALID_ARGUMENT if any parameters are NULL, or
RMW_RET_ERROR when an unspecified error occurs.