rmw
master
C API providing a middleware abstraction layer which is used to implement the rest of ROS.
|
#include <stddef.h>
#include "rcutils/allocator.h"
#include "rcutils/types.h"
#include "rmw/macros.h"
#include "rmw/types.h"
#include "rmw/visibility_control.h"
Go to the source code of this file.
Classes | |
struct | rmw_names_and_types_t |
Associative array of topic or service names and types. More... | |
Typedefs | |
typedef struct RMW_PUBLIC_TYPE rmw_names_and_types_t | rmw_names_and_types_t |
Associative array of topic or service names and types. More... | |
Functions | |
rmw_names_and_types_t | rmw_get_zero_initialized_names_and_types (void) |
Return a rmw_names_and_types_t struct with members initialized to NULL . More... | |
rmw_ret_t | rmw_names_and_types_check_zero (rmw_names_and_types_t *names_and_types) |
Check that a rmw_topic_names_and_types_t struct is zero initialized. More... | |
rmw_ret_t | rmw_names_and_types_init (rmw_names_and_types_t *names_and_types, size_t size, rcutils_allocator_t *allocator) |
Initialize a rmw_names_and_types_t object. More... | |
rmw_ret_t | rmw_names_and_types_fini (rmw_names_and_types_t *names_and_types) |
Finalize a rmw_names_and_types_t object. More... | |
typedef struct RMW_PUBLIC_TYPE rmw_names_and_types_t rmw_names_and_types_t |
Associative array of topic or service names and types.
rmw_names_and_types_t rmw_get_zero_initialized_names_and_types | ( | void | ) |
Return a rmw_names_and_types_t struct with members initialized to NULL
.
rmw_ret_t rmw_names_and_types_check_zero | ( | rmw_names_and_types_t * | names_and_types | ) |
Check that a rmw_topic_names_and_types_t struct is zero initialized.
Sets error message if names_and_types is not zero initialized
[in] | names_and_types | Object to check |
rmw_ret_t rmw_names_and_types_init | ( | rmw_names_and_types_t * | names_and_types, |
size_t | size, | ||
rcutils_allocator_t * | allocator | ||
) |
Initialize a rmw_names_and_types_t object.
This function initializes the string array for the names and allocates space for all the string arrays for the types according to the given size, but it does not initialize the string array for each setup of types. However, the string arrays for each set of types is zero initialized.
If a non RMW_RET_OK return value is returned, the RMW error message will be set
[in,out] | names_and_types | object to be initialized |
[in] | size | the number of names and sets of types to be stored |
[in] | allocator | to be used to allocate and deallocate memory |
RMW_RET_OK
on successfully running the check, or RMW_RET_INVALID_ARGUMENT
if names_and_types is NULL, or RMW_BAD_ALLOC
if memory allocation fails, or RMW_RET_ERROR
when an unspecified error occurs. rmw_ret_t rmw_names_and_types_fini | ( | rmw_names_and_types_t * | names_and_types | ) |
Finalize a rmw_names_and_types_t object.
The names_and_types_t objects are populated by one of the rmw_get_*_names_and_types() functions. During which memory is allocated to store the names and types. This function will reclaim any resources within the object so it is safe to destroy without leaking memory.
The allocator within the rmw_names_and_types_t object is used to deallocate memory.
If a non RMW_RET_OK return value is returned, the RMW error message will be set
[in,out] | names_and_types | object to be finalized |
RMW_RET_OK
on successfully running the check, or RMW_RET_INVALID_ARGUMENT
if names_and_types is NULL, or RMW_RET_ERROR
when an unspecified error occurs.