42 #include "reda/reda_sequence.h"
48 #if defined(RTI_WIN32) || defined(RTI_WINCE30)
49 #define REDADllExport __declspec( dllexport )
54 #define concatenate(A, B) A ## B
60 #ifdef REDA_SEQUENCE_USER_API
61 #ifndef REDA_SEQUENCE_API
62 #define REDA_SEQUENCE_API REDA_SEQUENCE_API_USER_DEFAULT
64 #if REDA_SEQUENCE_API < REDA_SEQUENCE_API_BASIC
65 #error "REDA_SEQUENCE_USER_API defined along with API level < REDA_SEQUENCE_API_BASIC"
70 #ifndef REDA_SEQUENCE_API
71 #define REDA_SEQUENCE_API REDA_SEQUENCE_API_DEFAULT
74 #if REDA_SEQUENCE_API < REDA_SEQUENCE_API_UNTYPED
75 #error "REDA_SEQUENCE_API_UNTYPED <= REDA_SEQUENCE_API <= REDA_SEQUENCE_API_FULL"
79 #if REDA_SEQUENCE_API > REDA_SEQUENCE_API_UNTYPED
80 #ifndef TSeq_initialize
81 #define TSeq_initialize
83 #ifndef TSeq_get_maximum
84 #define TSeq_get_maximum
86 #ifndef TSeq_set_maximum
87 #define TSeq_set_maximum
89 #ifndef TSeq_get_length
90 #define TSeq_get_length
92 #ifndef TSeq_set_length
93 #define TSeq_set_length
95 #ifndef TSeq_get_reference
96 #define TSeq_get_reference
100 #define TSeq_finalize
103 #ifdef REDA_SEQUENCE_USER_API
111 #if REDA_SEQUENCE_API > REDA_SEQUENCE_API_BASIC
115 #ifndef TSeq_is_equal
116 #define TSeq_is_equal
118 #ifndef TSeq_loan_contiguous
119 #define TSeq_loan_contiguous
121 #ifndef TSeq_loan_discontiguous
122 #define TSeq_loan_discontiguous
124 #ifndef TSeq_has_ownership
125 #define TSeq_has_ownership
127 #ifndef TSeq_has_discontiguous_buffer
128 #define TSeq_has_discontiguous_buffer
130 #ifndef TSeq_get_contiguous_buffer
131 #define TSeq_get_contiguous_buffer
133 #ifndef TSeq_get_discontiguous_buffer
134 #define TSeq_get_discontiguous_buffer
136 #ifndef TSeq_set_contiguous_buffer
137 #define TSeq_set_contiguous_buffer
142 #ifndef TSeq_set_token
143 #define TSeq_set_token
145 #ifndef TSeq_get_token
146 #define TSeq_get_token
148 #ifndef TSeq_ensure_length
149 #define TSeq_ensure_length
151 #ifndef TSeq_from_array
152 #define TSeq_from_array
154 #ifndef TSeq_to_array
155 #define TSeq_to_array
159 #if REDA_SEQUENCE_API > REDA_SEQUENCE_API_FULL
160 #error "REDA_SEQUENCE_API_UNTYPED <= REDA_SEQUENCE_API <= REDA_SEQUENCE_API_FULL"
167 #ifndef REDA_SEQUENCE_EXCLUDE_STRUCT
169 struct REDADllExport TSeq
171 T* _contiguous_buffer;
174 RTI_INT32 _element_size;
180 #ifdef TSeq_get_maximum
181 RTI_INT32 maximum()
const;
183 #ifdef TSeq_set_maximum
184 #ifndef TSeq_isCDRStringType
185 bool maximum(RTI_INT32 new_max);
187 #ifdef TSeq_isCDRStringType_no_max
188 bool maximum(RTI_INT32 new_max,RTI_UINT32 max_str_len);
190 bool maximum(RTI_INT32 new_max,RTI_UINT32 max_str_len);
191 bool maximum(RTI_INT32 new_max);
195 #ifdef TSeq_get_length
196 RTI_INT32 length()
const;
198 #ifdef TSeq_set_length
199 bool length(RTI_INT32 new_length);
201 #ifdef TSeq_get_reference
202 T* get_reference(RTI_INT32 i);
206 #ifndef TSeq_isCDRStringType
207 bool copy(
const TSeq& src_seq);
209 bool copy(
const TSeq& src_seq,RTI_UINT32 max_str_len);
210 bool copy(
const TSeq& src_seq);
215 bool is_equal(
const TSeq& other)
const;
217 #ifdef TSeq_loan_contiguous
218 bool loan_contiguous(
void* buffer, RTI_INT32 new_length, RTI_INT32 new_max);
220 #ifdef TSeq_loan_discontiguous
221 bool loan_discontiguous(
void* buffer, RTI_INT32 new_length, RTI_INT32 new_max);
226 #ifdef TSeq_has_ownership
227 bool has_ownership();
229 #ifdef TSeq_get_contiguous_buffer
230 T* get_contiguous_buffer()
const;
232 #ifdef TSeq_set_contiguous_buffer
233 bool set_contiguous_buffer(T* buffer);
235 #ifdef TSeq_has_discontiguous_buffer
236 bool has_discontiguous_buffer();
238 #ifdef TSeq_set_token
239 void set_token(
void *token1,
void *token2);
241 #ifdef TSeq_get_token
242 void get_token(
void **token1,
void **token2);
244 #ifdef TSeq_ensure_length
245 #ifndef TSeq_isCDRStringType
246 bool ensure_length(RTI_INT32 length, RTI_INT32 max);
248 #ifdef TSeq_isCDRStringType_no_max
249 bool ensure_length(RTI_INT32 length, RTI_INT32 max,RTI_UINT32 max_str_len);
251 bool ensure_length(RTI_INT32 length, RTI_INT32 max,RTI_UINT32 max_str_len);
252 bool ensure_length(RTI_INT32 length, RTI_INT32 max);
257 #ifdef TSeq_from_array
258 #ifndef TSeq_isCDRStringType
259 bool from_array(
const T elv[], RTI_INT32 length);
261 #ifdef TSeq_isCDRStringType_no_max
262 bool from_array(
const T elv[], RTI_INT32 length,RTI_UINT32 max_str_len);
264 bool from_array(
const T elv[], RTI_INT32 length,RTI_UINT32 max_str_len);
265 bool from_array(
const T elv[], RTI_INT32 length);
271 #ifndef TSeq_isCDRStringType
272 bool to_array(T elv[], RTI_INT32 length);
274 #ifdef TSeq_isCDRStringType_no_max
275 bool to_array(T elv[], RTI_INT32 length,RTI_UINT32 max_str_len);
277 bool to_array(T elv[], RTI_INT32 length,RTI_UINT32 max_str_len);
278 bool to_array(T elv[], RTI_INT32 length);
290 TSeq(
const TSeq& seq);
292 TSeq& operator=(
const TSeq& src_seq);
294 #ifdef TSeq_get_reference
295 T& operator[] (RTI_INT32 index);
296 const T& operator[] (RTI_INT32 index)
const;
299 bool operator==(
const TSeq& other)
const;
300 bool operator!=(
const TSeq& other)
const;
308 #if REDA_SEQUENCE_API > REDA_SEQUENCE_API_FULL
309 #error "REDA_SEQUENCE_API_UNTYPED <= REDA_SEQUENCE_API <= REDA_SEQUENCE_API_FULL"
313 #ifndef REDA_SEQUENCE_EXCLUDE_C_METHODS
319 #ifdef TSeq_initialize
320 #undef TSeq_initialize
321 #define _initialize(TSeq) concatenate(TSeq, _initialize)
322 #define TSeq_initialize _initialize(TSeq)
338 REDADllExport RTI_BOOL
339 TSeq_initialize(
struct TSeq*
self);
341 #undef TSeq_initialize
346 #define _finalize(TSeq) concatenate(TSeq, _finalize)
347 #define TSeq_finalize _finalize(TSeq)
363 REDADllExport RTI_BOOL
364 TSeq_finalize(
struct TSeq *
self);
369 #ifdef TSeq_get_maximum
370 #undef TSeq_get_maximum
371 #define _get_maximum(TSeq) concatenate(TSeq, _get_maximum)
372 #define TSeq_get_maximum _get_maximum(TSeq)
373 REDADllExport RTI_INT32
374 TSeq_get_maximum(
const struct TSeq *
self);
376 #undef TSeq_get_maximum
379 #ifdef TSeq_set_maximum
380 #undef TSeq_set_maximum
381 #define _set_maximum(TSeq) concatenate(TSeq, _set_maximum)
382 #define TSeq_set_maximum _set_maximum(TSeq)
383 #ifndef TSeq_isCDRStringType
384 REDADllExport RTI_BOOL
385 TSeq_set_maximum(
struct TSeq *
self, RTI_INT32 new_max);
387 #ifdef TSeq_isCDRStringType_no_max
388 REDADllExport RTI_BOOL
389 TSeq_set_maximum(
struct TSeq *
self, RTI_INT32 new_max, RTI_UINT32 max_str_len);
391 #undef TSeq_set_maximum_w_max
392 #define _set_maximum_w_max(TSeq) concatenate(TSeq,_set_maximum_w_max)
393 #define TSeq_set_maximum_w_max _set_maximum_w_max(TSeq)
394 REDADllExport RTI_BOOL
395 TSeq_set_maximum_w_max(
struct TSeq *
self, RTI_INT32 new_max, RTI_UINT32 max_str_len);
397 REDADllExport RTI_BOOL
398 TSeq_set_maximum(
struct TSeq *
self, RTI_INT32 new_max);
402 #undef TSeq_set_maximum
403 #undef _set_maximum_w_max
404 #undef TSeq_set_maximum_w_max
407 #ifdef TSeq_get_length
408 #undef TSeq_get_length
409 #define _get_length(TSeq) concatenate(TSeq, _get_length)
410 #define TSeq_get_length _get_length(TSeq)
411 REDADllExport RTI_INT32
412 TSeq_get_length(
const struct TSeq *
self);
414 #undef TSeq_get_length
417 #ifdef TSeq_set_length
418 #undef TSeq_set_length
419 #define _set_length(TSeq) concatenate(TSeq, _set_length)
420 #define TSeq_set_length _set_length(TSeq)
421 REDADllExport RTI_BOOL
422 TSeq_set_length(
struct TSeq *
self, RTI_INT32 new_length);
424 #undef TSeq_set_length
427 #ifdef TSeq_get_reference
428 #undef TSeq_get_reference
429 #define _get_reference(TSeq) concatenate(TSeq, _get_reference)
430 #define TSeq_get_reference _get_reference(TSeq)
432 TSeq_get_reference(
const struct TSeq *
self, RTI_INT32 i);
433 #undef _get_reference
434 #undef TSeq_get_reference
439 #define _copy(TSeq) concatenate(TSeq, _copy)
440 #define TSeq_copy _copy(TSeq)
441 #ifndef TSeq_isCDRStringType
442 REDADllExport
struct TSeq*
443 TSeq_copy(
struct TSeq *
self,
const struct TSeq *src);
445 #ifdef TSeq_isCDRStringType_no_max
446 REDADllExport
struct TSeq*
447 TSeq_copy(
struct TSeq *
self,
const struct TSeq *src, RTI_UINT32 max_str_len);
449 #undef TSeq_copy_w_max
450 #define _copy_w_max(TSeq) concatenate(TSeq, _copy_w_max)
451 #define TSeq_copy_w_max _copy_w_max(TSeq)
452 REDADllExport
struct TSeq*
453 TSeq_copy_w_max(
struct TSeq *
self,
const struct TSeq *src, RTI_UINT32 max_str_len);
455 REDADllExport
struct TSeq*
456 TSeq_copy(
struct TSeq *
self,
const struct TSeq *src);
462 #undef TSeq_copy_w_max
467 #define _is_equal(TSeq) concatenate(TSeq, _is_equal)
468 #define TSeq_is_equal _is_equal(TSeq)
469 REDADllExport RTI_BOOL
470 TSeq_is_equal(
const struct TSeq *left,
const struct TSeq *right);
475 #ifdef TSeq_loan_contiguous
476 #undef TSeq_loan_contiguous
477 #define _loan_contiguous(TSeq) concatenate(TSeq, _loan_contiguous)
478 #define TSeq_loan_contiguous _loan_contiguous(TSeq)
479 REDADllExport RTI_BOOL
480 TSeq_loan_contiguous(
struct TSeq *
self,
void *buffer,
481 RTI_INT32 new_length, RTI_INT32 new_max);
482 #undef _loan_contiguous
483 #undef TSeq_loan_contiguous
486 #ifdef TSeq_loan_discontiguous
487 #undef TSeq_loan_discontiguous
488 #define _loan_discontiguous(TSeq) concatenate(TSeq, _loan_discontiguous)
489 #define TSeq_loan_discontiguous _loan_discontiguous(TSeq)
490 REDADllExport RTI_BOOL
491 TSeq_loan_discontiguous(
struct TSeq *
self,
void *buffer,
492 RTI_INT32 new_length, RTI_INT32 new_max);
493 #undef _loan_discontiguous
494 #undef TSeq_loan_discontiguous
499 #define _unloan(TSeq) concatenate(TSeq, _unloan)
500 #define TSeq_unloan _unloan(TSeq)
501 REDADllExport RTI_BOOL
502 TSeq_unloan(
struct TSeq *
self);
507 #ifdef TSeq_has_ownership
508 #undef TSeq_has_ownership
509 #define _has_ownership(TSeq) concatenate(TSeq, _has_ownership)
510 #define TSeq_has_ownership _has_ownership(TSeq)
511 REDADllExport RTI_BOOL
512 TSeq_has_ownership(
const struct TSeq *
self);
513 #undef _has_ownership
514 #undef TSeq_has_ownership
517 #ifdef TSeq_get_contiguous_buffer
518 #undef TSeq_get_contiguous_buffer
519 #define _get_contiguous_buffer(TSeq) concatenate(TSeq, _get_contiguous_buffer)
520 #define TSeq_get_contiguous_buffer _get_contiguous_buffer(TSeq)
522 TSeq_get_contiguous_buffer(
const struct TSeq *
self);
523 #undef _get_contiguous_buffer
524 #undef TSeq_get_contiguous_buffer
527 #ifdef TSeq_get_discontiguous_buffer
528 #undef TSeq_get_discontiguous_buffer
529 #define _get_discontiguous_buffer(TSeq) concatenate(TSeq, TSeq_get_discontiguous_buffer)
530 #define TSeq_get_discontiguous_buffer _get_discontiguous_buffer(TSeq)
532 TSeq_get_discontiguous_buffer(
const struct TSeq *
self);
533 #undef _get_discontiguous_buffer
534 #undef TSeq_get_discontiguous_buffer
537 #ifdef TSeq_set_contiguous_buffer
538 #undef TSeq_set_contiguous_buffer
539 #define _set_contiguous_buffer(TSeq) concatenate(TSeq, _set_contiguous_buffer)
540 #define TSeq_set_contiguous_buffer _set_contiguous_buffer(TSeq)
541 REDADllExport RTI_BOOL
542 TSeq_set_contiguous_buffer(
struct TSeq *
self, T *buffer);
543 #undef _set_contiguous_buffer
544 #undef TSeq_set_contiguous_buffer
547 #ifdef TSeq_has_discontiguous_buffer
548 #undef TSeq_has_discontiguous_buffer
549 #define _has_discontiguous_buffer(TSeq) concatenate(TSeq, _has_discontiguous_buffer)
550 #define TSeq_has_discontiguous_buffer _has_discontiguous_buffer(TSeq)
551 REDADllExport RTI_BOOL
552 TSeq_has_discontiguous_buffer(
const struct TSeq *
self);
553 #undef _has_discontiguous_buffer
554 #undef TSeq_has_discontiguous_buffer
557 #ifdef TSeq_set_token
558 #undef TSeq_set_token
559 #define _set_token(TSeq) concatenate(TSeq, _set_token)
560 #define TSeq_set_token _set_token(TSeq)
562 TSeq_set_token(
struct TSeq *
self,
void *token1,
void *token2);
564 #undef TSeq_set_token
567 #ifdef TSeq_get_token
568 #undef TSeq_get_token
569 #define _get_token(TSeq) concatenate(TSeq, _get_token)
570 #define TSeq_get_token _get_token(TSeq)
572 TSeq_get_token(
struct TSeq *
self,
void **token1,
void **token2);
574 #undef TSeq_get_token
577 #ifdef TSeq_ensure_length
578 #undef TSeq_ensure_length
579 #define _ensure_length(TSeq) concatenate(TSeq, _ensure_length)
580 #define TSeq_ensure_length _ensure_length(TSeq)
581 #ifndef TSeq_isCDRStringType
582 REDADllExport RTI_BOOL
583 TSeq_ensure_length(
struct TSeq *
self,RTI_INT32 length, RTI_INT32 max);
585 #ifdef TSeq_isCDRStringType_no_max
586 REDADllExport RTI_BOOL
587 TSeq_ensure_length(
struct TSeq *
self,RTI_INT32 length, RTI_INT32 max,
588 RTI_INT32 max_str_len);
590 #undef TSeq_ensure_length_w_max
591 #define _ensure_length_w_max(TSeq) concatenate(TSeq, _ensure_length_w_max)
592 #define TSeq_ensure_length_w_max _ensure_length_w_max(TSeq)
593 REDADllExport RTI_BOOL
594 TSeq_ensure_length_w_max(
struct TSeq *
self,RTI_INT32 length, RTI_INT32 max,
595 RTI_INT32 max_str_len);
596 REDADllExport RTI_BOOL
597 TSeq_ensure_length(
struct TSeq *
self,RTI_INT32 length, RTI_INT32 max);
600 #undef _ensure_length
601 #undef TSeq_ensure_length
602 #undef _ensure_length_w_max
603 #undef TSeq_ensure_length_max
606 #ifdef TSeq_from_array
607 #undef TSeq_from_array
608 #define _from_array(TSeq) concatenate(TSeq, _from_array)
609 #define TSeq_from_array _from_array(TSeq)
610 #ifndef TSeq_isCDRStringType
611 REDADllExport RTI_BOOL
612 TSeq_from_array(
struct TSeq *
self,
const T elms_seq[], RTI_INT32 length);
614 #ifdef TSeq_isCDRStringType_no_max
615 REDADllExport RTI_BOOL
616 TSeq_from_array(
struct TSeq *
self,
const T elms_seq[], RTI_INT32 length,RTI_INT32 max_str_len);
618 #undef TSeq_from_array_w_max
619 #define _from_array_w_max(TSeq) concatenate(TSeq, _from_array_w_max)
620 #define TSeq_from_array_w_max _from_array_w_max(TSeq)
621 REDADllExport RTI_BOOL
622 TSeq_from_array_w_max(
struct TSeq *
self,
const T elms_seq[], RTI_INT32 length,RTI_INT32 max_str_len);
624 REDADllExport RTI_BOOL
625 TSeq_from_array(
struct TSeq *
self,
const T elms_seq[], RTI_INT32 length);
629 #undef TSeq_from_array
630 #undef _from_array_w_max
631 #undef TSeq_from_array_w_max
636 #define _to_array(TSeq) concatenate(TSeq, _to_array)
637 #define TSeq_to_array _to_array(TSeq)
638 #ifndef TSeq_isCDRStringType
639 REDADllExport RTI_BOOL
640 TSeq_to_array(
struct TSeq *
self,T elms_seq[], RTI_INT32 length);
642 #ifdef TSeq_isCDRStringType_no_max
643 REDADllExport RTI_BOOL
644 TSeq_to_array(
struct TSeq *
self,T elms_seq[], RTI_INT32 length,RTI_INT32 max_str_len);
646 #undef TSeq_to_array_w_max
647 #define _to_array_w_max(TSeq) concatenate(TSeq, _to_array_w_max)
648 #define TSeq_to_array_w_max _to_array_w_max(TSeq)
649 REDADllExport RTI_BOOL
650 TSeq_to_array_w_max(
struct TSeq *
self,T elms_seq[], RTI_INT32 length,RTI_INT32 max_str_len);
652 REDADllExport RTI_BOOL
653 TSeq_to_array(
struct TSeq *
self,T elms_seq[], RTI_INT32 length);
658 #undef _to_array_w_max
659 #undef TSeq_to_array_max
670 #undef REDA_SEQUENCE_API
672 #undef TSeq_isCDRStringType
673 #undef TSeq_isCDRStringType_no_max
674 #undef TSeq_isCDRCharStringType
675 #undef REDA_SEQUENCE_EXCLUDE_STRUCT
676 #undef REDA_SEQUENCE_EXCLUDE_C_METHODS
677 #undef REDA_SEQUENCE_USER_API