rosidl_runtime_c  master
Generate the rosidl interfaces in C.
Macros | Functions
primitives_sequence_functions.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include "rosidl_runtime_c/primitives_sequence.h"
#include "rosidl_runtime_c/visibility_control.h"
Include dependency graph for primitives_sequence_functions.h:

Go to the source code of this file.

Macros

#define ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_INIT(STRUCT_NAME)
 Allocate the memory for the sequence. More...
 
#define ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_FINI(STRUCT_NAME)
 Deallocate the memory of the sequence. More...
 
#define ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_FUNCTIONS(STRUCT_NAME)
 See ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_INIT(STRUCT_NAME) and ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_FINI(STRUCT_NAME) More...
 

Functions

bool rosidl_runtime_c__bool__Sequence__init (rosidl_runtime_c__boolean__Sequence *sequence, size_t size)
 
void rosidl_runtime_c__bool__Sequence__fini (rosidl_runtime_c__boolean__Sequence *sequence)
 
bool rosidl_runtime_c__byte__Sequence__init (rosidl_runtime_c__octet__Sequence *sequence, size_t size)
 
void rosidl_runtime_c__byte__Sequence__fini (rosidl_runtime_c__octet__Sequence *sequence)
 
bool rosidl_runtime_c__float32__Sequence__init (rosidl_runtime_c__float__Sequence *sequence, size_t size)
 
void rosidl_runtime_c__float32__Sequence__fini (rosidl_runtime_c__float__Sequence *sequence)
 
bool rosidl_runtime_c__float64__Sequence__init (rosidl_runtime_c__double__Sequence *sequence, size_t size)
 
void rosidl_runtime_c__float64__Sequence__fini (rosidl_runtime_c__double__Sequence *sequence)
 

Macro Definition Documentation

◆ ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_INIT

#define ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_INIT (   STRUCT_NAME)
Value:
\
ROSIDL_GENERATOR_C_PUBLIC \
bool rosidl_runtime_c__ ## STRUCT_NAME ## __Sequence__init( \
rosidl_runtime_c__ ## STRUCT_NAME ## __Sequence * sequence, size_t size);

Allocate the memory for the sequence.

Calling the function with an already allocated sequence will leak the previously allocated memory.

param sequence a pointer to a sequence struct param size the number of items to allocate in the sequence, both sequence fields size and capacity are set to this parameter return true if successful, false if the passed sequence pointer is null or the memory allocation failed

◆ ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_FINI

#define ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_FINI (   STRUCT_NAME)
Value:
\
ROSIDL_GENERATOR_C_PUBLIC \
void rosidl_runtime_c__ ## STRUCT_NAME ## __Sequence__fini( \
rosidl_runtime_c__ ## STRUCT_NAME ## __Sequence * sequence);

Deallocate the memory of the sequence.

Calling the function with an already deallocated sequence is a no-op.

param sequence a pointer to a sequence struct

◆ ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_FUNCTIONS

#define ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_FUNCTIONS (   STRUCT_NAME)
ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_INIT
#define ROSIDL_RUNTIME_C__DECLARE_PRIMITIVE_SEQUENCE_INIT(STRUCT_NAME)
Allocate the memory for the sequence.
Definition: primitives_sequence_functions.h:43