Go to the source code of this file.
◆ rmw_names_and_types_t
Associative array of topic or service names and types.
◆ rmw_get_zero_initialized_names_and_types()
Return a zero initialized array of names and types.
◆ rmw_names_and_types_check_zero()
Check that the given names_and_types
array is zero initialized.
Attribute | Adherence |
Allocates Memory | No |
Thread-Safe | Yes |
Uses Atomics | No |
Lock-Free | Yes |
- Thread-safety
- Access to the array of names and types is read-only, but it is not synchronized. Concurrent
names_and_types
reads are safe, but concurrent reads and writes are not.
- Parameters
-
[in] | names_and_types | Array to be checked. |
- Returns
- RMW_RET_OK if array is zero initialized, RMW_RET_INVALID_ARGUMENT otherwise.
◆ rmw_names_and_types_init()
Initialize an array of names and types.
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.
Attribute | Adherence |
Allocates Memory | Yes |
Thread-Safe | No |
Uses Atomics | No |
Lock-Free | Yes |
- Thread-safety
- Initialization is a reentrant procedure, but:
- Access to arrays of names and types is not synchronized. It is not safe to read or write
names_and_types
during initialization.
- The default allocators are thread-safe objects, but any custom
allocator
may not be. Check your allocator documentation for further reference.
- Parameters
-
[in,out] | names_and_types | Array to be initialized on success, but left unchanged on failure. |
[in] | size | Size of the array. |
[in] | allocator | Allocator to be used to populate names_and_types . |
- Returns
RMW_RET_OK
if successful, or
-
RMW_RET_INVALID_ARGUMENT
if names_and_types
is NULL, or
-
RMW_RET_INVALID_ARGUMENT
if names_and_types
is not a zero initialized array, or
-
RMW_RET_INVALID_ARGUMENT
if allocator
is invalid, by rcutils_allocator_is_valid() definition, or
-
RMW_BAD_ALLOC
if memory allocation fails, or
-
RMW_RET_ERROR
when an unspecified error occurs.
◆ rmw_names_and_types_fini()
Finalize an array of names and types.
This function deallocates the string array of names and the array of string arrays of types, and zero initializes the given array. If a logical error, such as RMW_RET_INVALID_ARGUMENT
, ensues, this function will return early, leaving the given array unchanged. Otherwise, it will proceed despite errors.
Attribute | Adherence |
Allocates Memory | No |
Thread-Safe | No |
Uses Atomics | No |
Lock-Free | Yes |
- Thread-safety
- Finalization is a reentrant procedure, but access to arrays of names and types is not synchronized. It is not safe to read or write
names_and_types
during initialization.
- Parameters
-
[in,out] | names_and_types | Array to be finalized. |
- Returns
RMW_RET_OK
if successful, or
-
RMW_RET_INVALID_ARGUMENT
if names_and_types
is NULL, or
-
RMW_RET_ERROR
when an unspecified error occurs.