|
RTI Connext TSS C++ API
Version 4.2.0
|
Interface for operating on a generic sequence of elements. More...
Macros | |
| #define | FACE_SEQUENCE_UNBOUNDED_SENTINEL UINT_MAX |
| Value representing the bound of an unbounded FACE_sequence. | |
Typedefs | |
| typedef void(* | FACE_sequence_copy_elem_fn )(void *, const void *, FACE_unsigned_long) |
| Interface for operating on a generic sequence of elements. | |
| typedef enum FACE_sequence_return | FACE_sequence_return |
| Return codes used to report certain runtime errors. | |
Enumerations | |
| enum | FACE_sequence_return { FACE_SEQUENCE_NO_ERROR, FACE_SEQUENCE_INSUFFICIENT_BOUND, FACE_SEQUENCE_INSUFFICIENT_MEMORY, FACE_SEQUENCE_PRECONDITION_VIOLATED, FACE_SEQUENCE_NULL_THIS, FACE_SEQUENCE_NULL_PARAM, FACE_SEQUENCE_INVALID_PARAM } |
| Return codes used to report certain runtime errors. More... | |
Functions | |
| FACE_sequence_return | FACE_sequence_init_managed_unbounded (FACE_sequence *this_obj, size_t sizeof_T) |
| Managed unbounded initialization - initializes empty managed unbounded FACE_sequence. | |
| FACE_sequence_return | FACE_sequence_init_managed_bounded (FACE_sequence *this_obj, size_t sizeof_T, FACE_unsigned_long bound) |
| Managed bounded initialization - initializes empty managed FACE_sequence of specified bound. | |
| FACE_sequence_return | FACE_sequence_init_managed_copy (FACE_sequence *this_obj, FACE_sequence *src) |
| Managed copy initialization. | |
| FACE_sequence_return | FACE_sequence_init_managed_data (FACE_sequence *this_obj, const void *arr, size_t sizeof_T, FACE_unsigned_long length) |
| Managed array initialization. | |
| FACE_sequence_return | FACE_sequence_init_unmanaged (FACE_sequence *this_obj, void *src, size_t sizeof_T, FACE_unsigned_long length, FACE_unsigned_long bound) |
| Unmanaged initialization. | |
| FACE_sequence_return | FACE_sequence_free (FACE_sequence *this_obj) |
Frees any data managed by this_obj. | |
| FACE_sequence_return | FACE_sequence_clear (FACE_sequence *this_obj) |
Clears this_obj's data. | |
| FACE_sequence_return | FACE_sequence_append (FACE_sequence *this_obj, const FACE_sequence *src) |
Adds a copy of src's data to the this_obj's data. | |
| FACE_sequence_return | FACE_sequence_append_elem (FACE_sequence *this_obj, void *src, size_t sizeof_T) |
Adds a copy of src to the this_obj's data. | |
| FACE_sequence_return | FACE_sequence_reserve (FACE_sequence *this_obj, FACE_unsigned_long capacity) |
Reserve storage for capacity elements. | |
| const void * | FACE_sequence_at (const FACE_sequence *this_obj, FACE_unsigned_long index) |
| Gets the element at a given index. | |
| const void * | FACE_sequence_buffer (const FACE_sequence *this_obj) |
Returns pointer to this_obj's underlying data. | |
| FACE_sequence_return | FACE_sequence_length (const FACE_sequence *this_obj, FACE_unsigned_long *length) |
Gets the length of this_obj. | |
| FACE_sequence_return | FACE_sequence_capacity (const FACE_sequence *this_obj, FACE_unsigned_long *capacity) |
Gets the capacity of this_obj. | |
| FACE_sequence_return | FACE_sequence_bound (const FACE_sequence *this_obj, FACE_unsigned_long *bound) |
Gets the bound of this_obj. | |
| FACE_sequence_return | FACE_sequence_is_managed (const FACE_sequence *this_obj, FACE_boolean *is_managed) |
Gets whether or not this_obj is managed. | |
| FACE_sequence_return | FACE_sequence_is_bounded (const FACE_sequence *this_obj, FACE_boolean *is_bounded) |
Gets whether or not this_obj is bounded. | |
| FACE_sequence_return | FACE_sequence_is_valid (const FACE_sequence *this_obj, FACE_boolean *is_valid) |
Gets whether or not this_obj is in the invalid state. | |
Interface for operating on a generic sequence of elements.
| #define FACE_SEQUENCE_UNBOUNDED_SENTINEL UINT_MAX |
Value representing the bound of an unbounded FACE_sequence.
| typedef void(* FACE_sequence_copy_elem_fn)(void *, const void *, FACE_unsigned_long) |
Interface for operating on a generic sequence of elements.
A FACE_sequence is defined by three characteristics:
A "managed" FACE_sequence is responsible for and manages the lifetime of the memory for the data it represents. An "unmanaged" FACE_sequence essentially wraps a pointer to memory whose lifetime is managed elsewhere.
A FACE_sequence is "initialized" if it is in a state that could have resulted from successful initialization by one of the "_init" functions. Any other state makes the FACE_sequence "uninitialized".
When a memory allocation failure or precondition violation occurs, a FACE_sequence is put into a known "invalid state". In this invalid state:
Global preconditions:
this_obj parameter is NULL, the function does nothing and returns FACE_SEQUENCE_NULL_THIS.| typedef enum FACE_sequence_return FACE_sequence_return |
Return codes used to report certain runtime errors.
| enum FACE_sequence_return |
Return codes used to report certain runtime errors.
| FACE_sequence_return FACE_sequence_init_managed_unbounded | ( | FACE_sequence * | this_obj, |
| size_t | sizeof_T | ||
| ) |
Managed unbounded initialization - initializes empty managed unbounded FACE_sequence.
(see FACE_string_init_managed_unbounded)
After initialization, FACE_sequence_buffer() will return NULL.
| this_obj | the FACE_sequence to be initialized |
| sizeof_T | the size of each element in this_obj |
| FACE_sequence_return FACE_sequence_init_managed_bounded | ( | FACE_sequence * | this_obj, |
| size_t | sizeof_T, | ||
| FACE_unsigned_long | bound | ||
| ) |
Managed bounded initialization - initializes empty managed FACE_sequence of specified bound.
(see FACE_string_init_managed_bounded)
If allocation is successful, FACE_sequence_buffer() will return NULL.
| this_obj | the FACE_sequence to be initialized |
| sizeof_T | the size of each element in this_obj |
| bound | the specified bound for this_obj to be initialized with |
| FACE_sequence_return FACE_sequence_init_managed_copy | ( | FACE_sequence * | this_obj, |
| FACE_sequence * | src | ||
| ) |
Managed copy initialization.
| FACE_sequence_return FACE_sequence_init_managed_data | ( | FACE_sequence * | this_obj, |
| const void * | arr, | ||
| size_t | sizeof_T, | ||
| FACE_unsigned_long | length | ||
| ) |
Managed array initialization.
After initialization, this FACE_sequence manages its own data, which is a copy of the length elements of size sizeof_T in the array pointed to by arr, and the bound of this_obj is equal to length.
Preconditions:
this_obj is put into the invalid stateIf no preconditions are violated and memory allocation fails:
this_obj is put into the invalid stateThe caller must ensure length * sizeof_T is not greater than the size of the memory allocated at arr. If this condition is violated, the result is implementation-defined behavior and may result in an attempt to access restricted memory.
| this_obj | the FACE_sequence to be initialized |
| arr | a pointer to the array |
| sizeof_T | the size of each element in the array |
| length | the number of elements in the array |
| FACE_SEQUENCE_NULL_THIS | if this_obj is null |
| FACE_SEQUENCE_PRECONDITION_VIOLATED | if this_obj is already initialized or any other preconditions are false |
| FACE_SEQUENCE_NULL_PARAM | if arr is null |
| FACE_SEQUENCE_INSUFFICIENT_MEMORY | if memory allocation fails |
| FACE_SEQUENCE_NO_ERROR | otherwise. |
| FACE_sequence_return FACE_sequence_init_unmanaged | ( | FACE_sequence * | this_obj, |
| void * | src, | ||
| size_t | sizeof_T, | ||
| FACE_unsigned_long | length, | ||
| FACE_unsigned_long | bound | ||
| ) |
Unmanaged initialization.
(see FACE_string_init_unmanaged)
The caller must ensure bound * sizeof_T is not greater than the size of the memory allocated at src. If this condition is violated, the result is implementation-defined behavior and may result in an attempt to access restricted memory.
Preconditions:
this_obj is put into the invalid state| this_obj | a pointer to the FACE_sequence to be initialized |
| src | pointer to externally managed memory |
| length | the number of elements in the memory pointed to by src |
| sizeof_T | the size of each element in the memory pointed to by src |
| bound | the number of elements the externally managed memory can hold. Also serves as a capacity. |
| FACE_sequence_return FACE_sequence_free | ( | FACE_sequence * | this_obj | ) |
Frees any data managed by this_obj.
(see FACE_string_free)
| FACE_sequence_return FACE_sequence_clear | ( | FACE_sequence * | this_obj | ) |
Clears this_obj's data.
(see FACE_string_clear)
| FACE_sequence_return FACE_sequence_append | ( | FACE_sequence * | this_obj, |
| const FACE_sequence * | src | ||
| ) |
Adds a copy of src's data to the this_obj's data.
(see FACE_string_append)
| FACE_sequence_return FACE_sequence_append_elem | ( | FACE_sequence * | this_obj, |
| void * | src, | ||
| size_t | sizeof_T | ||
| ) |
Adds a copy of src to the this_obj's data.
(see FACE_string_append_elem)
Preconditions:
this_obj is put into the invalid state| this_obj | a pointer to the FACE_sequence to be initialized |
| src | pointer to externally managed memory |
| sizeof_T | the size of the element in memory pointed to by src |
| FACE_sequence_return FACE_sequence_reserve | ( | FACE_sequence * | this_obj, |
| FACE_unsigned_long | capacity | ||
| ) |
Reserve storage for capacity elements.
(see FACE_string_reserve)
| const void* FACE_sequence_at | ( | const FACE_sequence * | this_obj, |
| FACE_unsigned_long | index | ||
| ) |
Gets the element at a given index.
(see FACE_sequence_at)
| NULL | if this_obj is null, not initialized, or if index is out of range |
| a | const pointer to the element at the given index otherwise. |
| const void* FACE_sequence_buffer | ( | const FACE_sequence * | this_obj | ) |
Returns pointer to this_obj's underlying data.
To avoid accessing restricted memory, the caller should avoid dereferencing memory beyond buffer + length*(the size of each element).
| NULL | if this_obj is null or not initialized |
| a | pointer to contiguous memory for this_obj's data otherwise |
| FACE_sequence_return FACE_sequence_length | ( | const FACE_sequence * | this_obj, |
| FACE_unsigned_long * | length | ||
| ) |
Gets the length of this_obj.
(see FACE_string_length)
| FACE_sequence_return FACE_sequence_capacity | ( | const FACE_sequence * | this_obj, |
| FACE_unsigned_long * | capacity | ||
| ) |
Gets the capacity of this_obj.
(see FACE_string_capacity)
| FACE_sequence_return FACE_sequence_bound | ( | const FACE_sequence * | this_obj, |
| FACE_unsigned_long * | bound | ||
| ) |
Gets the bound of this_obj.
(see FACE_string_bound)
| FACE_sequence_return FACE_sequence_is_managed | ( | const FACE_sequence * | this_obj, |
| FACE_boolean * | is_managed | ||
| ) |
Gets whether or not this_obj is managed.
(see FACE_string_is_managed)
| FACE_sequence_return FACE_sequence_is_bounded | ( | const FACE_sequence * | this_obj, |
| FACE_boolean * | is_bounded | ||
| ) |
Gets whether or not this_obj is bounded.
(see FACE_string_is_bounded)
| FACE_sequence_return FACE_sequence_is_valid | ( | const FACE_sequence * | this_obj, |
| FACE_boolean * | is_valid | ||
| ) |
Gets whether or not this_obj is in the invalid state.
(see FACE_string_is_valid)