34 #ifndef reda_sequence_h
35 #define reda_sequence_h
56 #define REDA_SEQUENCE_API_UNTYPED 0
71 #define REDA_SEQUENCE_API_BASIC 1
90 #define REDA_SEQUENCE_API_FULL 2
95 #ifndef REDA_SEQUENCE_API_DEFAULT
97 #define REDA_SEQUENCE_API_DEFAULT REDA_SEQUENCE_API_FULL
99 #define REDA_SEQUENCE_API_DEFAULT REDA_SEQUENCE_API_BASIC
102 #if REDA_SEQUENCE_API_DEFAULT < REDA_SEQUENCE_API_BASIC
103 #error "REDA_SEQUENCE_API_DEFAULT must be at least REDA_SEQUENCE_API_BASIC"
110 #ifndef REDA_SEQUENCE_API_USER_DEFAULT
112 #define REDA_SEQUENCE_API_USER_DEFAULT REDA_SEQUENCE_API_FULL
114 #define REDA_SEQUENCE_API_USER_DEFAULT REDA_SEQUENCE_API_BASIC
117 #if REDA_SEQUENCE_API_USER_DEFAULT < REDA_SEQUENCE_API_BASIC
118 #error "REDA_SEQUENCE_API_USER_DEFAULT must be at least REDA_SEQUENCE_API_BASIC"
123 #define REDA_DEFINE_SEQUENCE_INITIALIZER(t_) \
124 { NULL,0,0,sizeof(t_),NULL,NULL,0 }
127 #define REDA_DEFINE_EMPTY_SEQUENCE_INITIALIZER \
128 { NULL,0,0,0,NULL,NULL,0 }
133 struct REDA_Sequence;
138 #define REDA_SEQUENCE_FLAG_LOAN 0x01
143 #define REDA_SEQUENCE_FLAG_DISCONTIGUOUS 0x02
149 #define REDA_SEQUENCE_FLAG_PTR_ALLOCATION 0x04
156 #define REDA_SEQUENCE_ELEMENT_ALLOC (0xfffffffe)
163 #define REDA_SEQUENCE_ELEMENT_REPLACE (0xffffffff)
179 MUST_CHECK_RETURN REDADllExport
RTI_BOOL
180 REDA_Sequence_initialize(
struct REDA_Sequence *
self, RTI_INT32 element_size);
196 SHOULD_CHECK_RETURN REDADllExport
RTI_BOOL
197 REDA_Sequence_finalize(
struct REDA_Sequence *
self);
214 REDADllExport RTI_INT32
215 REDA_Sequence_get_maximum(
const struct REDA_Sequence *
self);
243 MUST_CHECK_RETURN REDADllExport
RTI_BOOL
244 REDA_Sequence_set_maximum(
struct REDA_Sequence *
self, RTI_INT32 new_max,
260 REDADllExport RTI_INT32
261 REDA_Sequence_get_length(
const struct REDA_Sequence *
self);
280 MUST_CHECK_RETURN REDADllExport
RTI_BOOL
281 REDA_Sequence_set_length(
struct REDA_Sequence *
self, RTI_INT32 new_length);
298 MUST_CHECK_RETURN REDADllExport
void*
299 REDA_Sequence_get_buffer(
const struct REDA_Sequence *
self);
318 MUST_CHECK_RETURN REDADllExport
RTI_BOOL
319 REDA_Sequence_set_buffer(
struct REDA_Sequence *
self,
void *buffer);
336 MUST_CHECK_RETURN REDADllExport
void*
337 REDA_Sequence_get_reference(
const struct REDA_Sequence *
self,RTI_INT32 index);
365 MUST_CHECK_RETURN REDADllExport
struct REDA_Sequence*
366 REDA_Sequence_copy(
struct REDA_Sequence *
self,
367 const struct REDA_Sequence *src,
394 REDA_Sequence_is_equal(
const struct REDA_Sequence *left,
395 const struct REDA_Sequence *right,
418 MUST_CHECK_RETURN REDADllExport
RTI_BOOL
419 REDA_Sequence_loan_contiguous(
struct REDA_Sequence *
self,
void *buffer,
420 RTI_INT32 new_length, RTI_INT32 new_max);
443 MUST_CHECK_RETURN REDADllExport
RTI_BOOL
444 REDA_Sequence_loan_discontiguous(
struct REDA_Sequence *
self,
void *buffer,
445 RTI_INT32 new_length, RTI_INT32 new_max);
459 MUST_CHECK_RETURN REDADllExport
RTI_BOOL
460 REDA_Sequence_unloan(
struct REDA_Sequence *
self);
476 REDA_Sequence_has_ownership(
const struct REDA_Sequence *
self);
492 REDA_Sequence_has_discontiguous_buffer(
const struct REDA_Sequence *
self);
508 REDA_Sequence_set_token(
struct REDA_Sequence *
self,
void *token1,
void *token2);
524 REDA_Sequence_get_token(
const struct REDA_Sequence *
self,
void **token1,
void **token2);