xidl-typeobject 0.72.2

A IDL codegen.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
/* dds-xtypes_typeobject.idl */
module DDS {
    module XTypes {
        // ---------- Equivalence Kinds -------------------
        typedef octet EquivalenceKind;

        const octet EK_MINIMAL = 0xF1;
        // 0x1111 0001
        const octet EK_COMPLETE = 0xF2;
        // 0x1111 0010
        const octet EK_BOTH = 0xF3;
        // 0x1111 0011
        // ---------- TypeKinds (begin) -------------------
        typedef octet TypeKind;
        // Primitive TKs
        const octet TK_NONE = 0x00;

        const octet TK_BOOLEAN = 0x01;

        const octet TK_BYTE = 0x02;

        const octet TK_INT16 = 0x03;

        const octet TK_INT32 = 0x04;

        const octet TK_INT64 = 0x05;

        const octet TK_UINT16 = 0x06;

        const octet TK_UINT32 = 0x07;

        const octet TK_UINT64 = 0x08;

        const octet TK_FLOAT32 = 0x09;

        const octet TK_FLOAT64 = 0x0A;

        const octet TK_FLOAT128 = 0x0B;

        const octet TK_CHAR8 = 0x10;

        const octet TK_CHAR16 = 0x11;
        // String TKs
        const octet TK_STRING8 = 0x20;

        const octet TK_STRING16 = 0x21;
        // Constructed/Named types
        const octet TK_ALIAS = 0x30;
        // Enumerated TKs
        const octet TK_ENUM = 0x40;

        const octet TK_BITMASK = 0x41;
        // Structured TKs
        const octet TK_ANNOTATION = 0x50;

        const octet TK_STRUCTURE = 0x51;

        const octet TK_UNION = 0x52;

        const octet TK_BITSET = 0x53;
        // Collection TKs
        const octet TK_SEQUENCE = 0x60;

        const octet TK_ARRAY = 0x61;

        const octet TK_MAP = 0x62;
        // ---------- TypeKinds (end) -------------------
        // ---------- Extra TypeIdentifiers (begin) ------------
        typedef octet TypeIdentiferKind;

        const octet TI_STRING8_SMALL = 0x70;

        const octet TI_STRING8_LARGE = 0x71;

        const octet TI_STRING16_SMALL = 0x72;

        const octet TI_STRING16_LARGE = 0x73;

        const octet TI_PLAIN_SEQUENCE_SMALL = 0x80;

        const octet TI_PLAIN_SEQUENCE_LARGE = 0x81;

        const octet TI_PLAIN_ARRAY_SMALL = 0x90;

        const octet TI_PLAIN_ARRAY_LARGE = 0x91;

        const octet TI_PLAIN_MAP_SMALL = 0xA0;

        const octet TI_PLAIN_MAP_LARGE = 0xA1;

        const octet TI_STRONGLY_CONNECTED_COMPONENT = 0xB0;
        // ---------- Extra TypeIdentifiers (end) --------------
        // The name of some element (e.g. type, type member, module)
        // Valid characters are alphanumeric plus the "_" cannot start with digit
        const long MEMBER_NAME_MAX_LENGTH = 256;

        typedef string<MEMBER_NAME_MAX_LENGTH> MemberName;
        // Qualified type name includes the name of containing modules
        // using "::" as separator. No leading "::". E.g. "MyModule::MyType"
        const long TYPE_NAME_MAX_LENGTH = 256;

        typedef string<TYPE_NAME_MAX_LENGTH> QualifiedTypeName;
        // Every type has an ID. Those of the primitive types are pre-defined.
        typedef octet PrimitiveTypeId;
        // First 14 bytes of MD5 of the serialized TypeObject.
        typedef octet EquivalenceHash[14];
        // First 4 bytes of MD5 of of a member name converted to bytes
        // using UTF-8 encoding and without a 'nul' terminator.
        // Example: the member name "color" has NameHash {0x70, 0xDD, 0xA5, 0xDF}
        typedef octet NameHash[4];
        // Long Bound of a collection type
        typedef unsigned long LBound;

        typedef sequence<LBound> LBoundSeq;

        const LBound INVALID_LBOUND = 0;
        // Short Bound of a collection type
        typedef octet SBound;

        typedef sequence<SBound> SBoundSeq;

        const SBound INVALID_SBOUND = 0;

        @extensibility(FINAL)
        @nested
        union TypeObjectHashId switch (octet) {
            case EK_COMPLETE:
            case EK_MINIMAL:
                EquivalenceHash hash;

        };
        // Flags that apply to struct/union/collection/enum/bitmask/bitset
        // members/elements and DO affect type assignability
        // Depending on the flag it may not apply to members of all types
        // When not all, the applicable member types are listed
        @bit_bound(16)
        bitmask MemberFlag {
            @position(0)
            TRY_CONSTRUCT1,
            // T1 | 00 = INVALID, 01 = DISCARD
            @position(1)
            TRY_CONSTRUCT2,
            // T2 | 10 = USE_DEFAULT, 11 = TRIM
            @position(2)
            IS_EXTERNAL,
            // X  StructMember, UnionMember,
            //    CollectionElement
            @position(3)
            IS_OPTIONAL,
            // O  StructMember
            @position(4)
            IS_MUST_UNDERSTAND,
            // M  StructMember
            @position(5)
            IS_KEY,
            // K  StructMember, UnionDiscriminator
            @position(6)
            IS_DEFAULT
            // D  UnionMember, EnumerationLiteral
        };

        typedef MemberFlag CollectionElementFlag;
        // T1, T2, X
        typedef MemberFlag StructMemberFlag;
        // T1, T2, O, M, K, X
        typedef MemberFlag UnionMemberFlag;
        // T1, T2, D, X
        typedef MemberFlag UnionDiscriminatorFlag;
        // T1, T2, K
        typedef MemberFlag EnumeratedLiteralFlag;
        // D
        typedef MemberFlag AnnotationParameterFlag;
        // Unused. No flags apply
        typedef MemberFlag AliasMemberFlag;
        // Unused. No flags apply
        typedef MemberFlag BitflagFlag;
        // Unused. No flags apply
        typedef MemberFlag BitsetMemberFlag;
        // Unused. No flags apply
        // Mask used to remove the flags that do no affect assignability
        // Selects  T1, T2, O, M, K, D
        const unsigned short MemberFlagMinimalMask = 0x003f;
        // Flags that apply to type declarationa and DO affect assignability
        // Depending on the flag it may not apply to all types
        // When not all, the applicable  types are listed
        @bit_bound(16)
        bitmask TypeFlag {
            @position(0)
            IS_FINAL,
            // F |
            @position(1)
            IS_APPENDABLE,
            // A |-  Struct, Union
            @position(2)
            IS_MUTABLE,
            // M |   (exactly one flag)
            @position(3)
            IS_NESTED,
            // N     Struct, Union
            @position(4)
            IS_AUTOID_HASH
            // H     Struct
        };

        typedef TypeFlag StructTypeFlag;
        // All flags apply
        typedef TypeFlag UnionTypeFlag;
        // All flags apply
        typedef TypeFlag CollectionTypeFlag;
        // Unused. No flags apply
        typedef TypeFlag AnnotationTypeFlag;
        // Unused. No flags apply
        typedef TypeFlag AliasTypeFlag;
        // Unused. No flags apply
        typedef TypeFlag EnumTypeFlag;
        // Unused. No flags apply
        typedef TypeFlag BitmaskTypeFlag;
        // Unused. No flags apply
        typedef TypeFlag BitsetTypeFlag;
        // Unused. No flags apply
        // Mask used to remove the flags that do no affect assignability
        const unsigned short TypeFlagMinimalMask = 0x0007;
        // Selects  M, A, F
        // Forward declaration
        union TypeIdentifier;
        // 1 Byte
        @extensibility(FINAL)
        @nested
        struct StringSTypeDefn {
            SBound bound;
        };
        // 4 Bytes
        @extensibility(FINAL)
        @nested
        struct StringLTypeDefn {
            LBound bound;
        };

        @extensibility(FINAL)
        @nested
        struct PlainCollectionHeader {
            EquivalenceKind equiv_kind;
            CollectionElementFlag element_flags;
        };

        @extensibility(FINAL)
        @nested
        struct PlainSequenceSElemDefn {
            PlainCollectionHeader header;
            SBound bound;
            @external
            TypeIdentifier element_identifier;
        };

        @extensibility(FINAL)
        @nested
        struct PlainSequenceLElemDefn {
            PlainCollectionHeader header;
            LBound bound;
            @external
            TypeIdentifier element_identifier;
        };

        @extensibility(FINAL)
        @nested
        struct PlainArraySElemDefn {
            PlainCollectionHeader header;
            SBoundSeq array_bound_seq;
            @external
            TypeIdentifier element_identifier;
        };

        @extensibility(FINAL)
        @nested
        struct PlainArrayLElemDefn {
            PlainCollectionHeader header;
            LBoundSeq array_bound_seq;
            @external
            TypeIdentifier element_identifier;
        };

        @extensibility(FINAL)
        @nested
        struct PlainMapSTypeDefn {
            PlainCollectionHeader header;
            SBound bound;
            @external
            TypeIdentifier element_identifier;
            CollectionElementFlag key_flags;
            @external
            TypeIdentifier key_identifier;
        };

        @extensibility(FINAL)
        @nested
        struct PlainMapLTypeDefn {
            PlainCollectionHeader header;
            LBound bound;
            @external
            TypeIdentifier element_identifier;
            CollectionElementFlag key_flags;
            @external
            TypeIdentifier key_identifier;
        };
        // Used for Types that have cyclic depencencies with other types
        @extensibility(APPENDABLE)
        @nested
        struct StronglyConnectedComponentId {
            TypeObjectHashId sc_component_id;
            // Hash StronglyConnectedComponent
            long scc_length;
            // StronglyConnectedComponent.length
            long scc_index;
            // identify type in Strongly Connected Comp.
        };
        // Future extensibility
        @extensibility(MUTABLE)
        @nested
        struct ExtendedTypeDefn {
            // Empty. Available for future extension
        };
        // The TypeIdentifier uniquely identifies a type (a set of equivalent
        // types according to an equivalence relationship:  COMPLETE, MNIMAL).
        //
        // In some cases (primitive types, strings, plain types) the identifier
        // is a explicit description of the type.
        // In other cases the Identifier is a Hash of the type description
        //
        // In the case of primitive types and strings the implied equivalence
        // relation is the identity.
        //
        // For Plain Types and Hash-defined TypeIdentifiers there are three
        //  possibilities: MINIMAL, COMPLETE, and COMMON:
        //   - MINIMAL indicates the TypeIdentifier identifies equivalent types
        //     according to the MINIMAL equivalence relation
        //   - COMPLETE indicates the TypeIdentifier identifies equivalent types
        //     according to the COMPLETE equivalence relation
        //   - COMMON indicates the TypeIdentifier identifies equivalent types
        //     according to both the MINIMAL and the COMMON equivalence relation.
        //     This means the TypeIdentifier is the same for both relationships
        //
        @extensibility(FINAL)
        @nested
        union TypeIdentifier switch (octet) {
            // ============  Primitive types - use TypeKind ====================
            // All primitive types fall here.
            // Commented-out because Unions cannot have cases with no member.
            /*
            case TK_NONE:
            case TK_BOOLEAN:
            case TK_BYTE_TYPE:
            case TK_INT16_TYPE:
            case TK_INT32_TYPE:
            case TK_INT64_TYPE:
            case TK_UINT16_TYPE:
            case TK_UINT32_TYPE:
            case TK_UINT64_TYPE:
            case TK_FLOAT32_TYPE:
            case TK_FLOAT64_TYPE:
            case TK_FLOAT128_TYPE:
            case TK_CHAR8_TYPE:
            case TK_CHAR16_TYPE:
                // No Value
                */
                // ============ Strings - use TypeIdentifierKind ===================
            case TI_STRING8_SMALL:
            case TI_STRING16_SMALL:
                StringSTypeDefn string_sdefn;

            case TI_STRING8_LARGE:
            case TI_STRING16_LARGE:
                StringLTypeDefn string_ldefn;
                // ============  Plain collectios - use TypeIdentifierKind =========
            case TI_PLAIN_SEQUENCE_SMALL:
                PlainSequenceSElemDefn seq_sdefn;
            case TI_PLAIN_SEQUENCE_LARGE:
                PlainSequenceLElemDefn seq_ldefn;
            case TI_PLAIN_ARRAY_SMALL:
                PlainArraySElemDefn array_sdefn;
            case TI_PLAIN_ARRAY_LARGE:
                PlainArrayLElemDefn array_ldefn;
            case TI_PLAIN_MAP_SMALL:
                PlainMapSTypeDefn map_sdefn;
            case TI_PLAIN_MAP_LARGE:
                PlainMapLTypeDefn map_ldefn;
                // ============  Types that are mutually dependent on each other ===
            case TI_STRONGLY_CONNECTED_COMPONENT:
                StronglyConnectedComponentId sc_component_id;
                // ============  The remaining cases - use EquivalenceKind =========
            case EK_COMPLETE:
            case EK_MINIMAL:
                EquivalenceHash equivalence_hash;
                // ===================  Future extensibility  ============
                // Future extensions
            default:
                ExtendedTypeDefn extended_defn;
        };

        typedef sequence<TypeIdentifier> TypeIdentifierSeq;
        // --- Annotation usage: -----------------------------------------------
        // ID of a type member
        typedef unsigned long MemberId;

        const unsigned long ANNOTATION_STR_VALUE_MAX_LEN = 128;

        const unsigned long ANNOTATION_OCTETSEC_VALUE_MAX_LEN = 128;

        @extensibility(MUTABLE)
        @nested
        struct ExtendedAnnotationParameterValue {
            // Empty. Available for future extension
        };
        /* Literal value of an annotation member: either the default value in its
        * definition or the value applied in its usage.
        */
        @extensibility(FINAL)
        @nested
        union AnnotationParameterValue switch (octet) {
            case TK_BOOLEAN:
                boolean boolean_value;
            case TK_BYTE:
                octet byte_value;
            case TK_INT16:
                short int16_value;
            case TK_UINT16:
                unsigned short uint_16_value;
            case TK_INT32:
                long int32_value;
            case TK_UINT32:
                unsigned long uint32_value;
            case TK_INT64:
                long long int64_value;
            case TK_UINT64:
                unsigned long long uint64_value;
            case TK_FLOAT32:
                float float32_value;
            case TK_FLOAT64:
                double float64_value;
            case TK_FLOAT128:
                long double float128_value;
            case TK_CHAR8:
                char char_value;
            case TK_CHAR16:
                wchar wchar_value;
            case TK_ENUM:
                long enumerated_value;
            case TK_STRING8:
                string<ANNOTATION_STR_VALUE_MAX_LEN> string8_value;
            case TK_STRING16:
                wstring<ANNOTATION_STR_VALUE_MAX_LEN> string16_value;
            default:
                ExtendedAnnotationParameterValue extended_value;
        };
        // The application of an annotation to some type or type member
        @extensibility(APPENDABLE)
        @nested
        struct AppliedAnnotationParameter {
            NameHash paramname_hash;
            AnnotationParameterValue value;
        };
        // Sorted by AppliedAnnotationParameter.paramname_hash
        typedef sequence<AppliedAnnotationParameter> AppliedAnnotationParameterSeq;

        @extensibility(APPENDABLE)
        @nested
        struct AppliedAnnotation {
            TypeIdentifier annotation_typeid;
            @optional
            AppliedAnnotationParameterSeq param_seq;
        };
        // Sorted by AppliedAnnotation.annotation_typeid
        typedef sequence<AppliedAnnotation> AppliedAnnotationSeq;
        // @verbatim(placement="<placement>", language="<lang>", text="<text>")
        @extensibility(FINAL)
        @nested
        struct AppliedVerbatimAnnotation {
            string<32> placement;
            string<32> language;
            string text;
        };
        // --- Aggregate types: ------------------------------------------------
        @extensibility(APPENDABLE)
        @nested
        struct AppliedBuiltinMemberAnnotations {
            @optional
            string unit;
            // @unit("<unit>")
            @optional
            AnnotationParameterValue min;
            // @min , @range
            @optional
            AnnotationParameterValue max;
            // @max , @range
            @optional
            string hash_id;
            // @hash_id("<membername>")
        };

        @extensibility(FINAL)
        @nested
        struct CommonStructMember {
            MemberId member_id;
            StructMemberFlag member_flags;
            TypeIdentifier member_type_id;
        };
        // COMPLETE Details for a member of an aggregate type
        @extensibility(FINAL)
        @nested
        struct CompleteMemberDetail {
            MemberName name;
            @optional
            AppliedBuiltinMemberAnnotations ann_builtin;
            @optional
            AppliedAnnotationSeq ann_custom;
        };
        // MINIMAL Details for a member of an aggregate type
        @extensibility(FINAL)
        @nested
        struct MinimalMemberDetail {
            NameHash name_hash;
        };
        // Member of an aggregate type
        @extensibility(APPENDABLE)
        @nested
        struct CompleteStructMember {
            CommonStructMember common;
            CompleteMemberDetail detail;
        };
        // Ordered by the member_index
        typedef sequence<CompleteStructMember> CompleteStructMemberSeq;
        // Member of an aggregate type
        @extensibility(APPENDABLE)
        @nested
        struct MinimalStructMember {
            CommonStructMember common;
            MinimalMemberDetail detail;
        };
        // Ordered by common.member_id
        typedef sequence<MinimalStructMember> MinimalStructMemberSeq;

        @extensibility(APPENDABLE)
        @nested
        struct AppliedBuiltinTypeAnnotations {
            @optional
            AppliedVerbatimAnnotation verbatim;
            // @verbatim(...)
        };

        @extensibility(FINAL)
        @nested
        struct MinimalTypeDetail {
            // Empty. Available for future extension
        };

        @extensibility(FINAL)
        @nested
        struct CompleteTypeDetail {
            @optional
            AppliedBuiltinTypeAnnotations ann_builtin;
            @optional
            AppliedAnnotationSeq ann_custom;
            QualifiedTypeName type_name;
        };

        @extensibility(APPENDABLE)
        @nested
        struct CompleteStructHeader {
            TypeIdentifier base_type;
            CompleteTypeDetail detail;
        };

        @extensibility(APPENDABLE)
        @nested
        struct MinimalStructHeader {
            TypeIdentifier base_type;
            MinimalTypeDetail detail;
        };

        @extensibility(FINAL)
        @nested
        struct CompleteStructType {
            StructTypeFlag struct_flags;
            CompleteStructHeader header;
            CompleteStructMemberSeq member_seq;
        };

        @extensibility(FINAL)
        @nested
        struct MinimalStructType {
            StructTypeFlag struct_flags;
            MinimalStructHeader header;
            MinimalStructMemberSeq member_seq;
        };
        // --- Union: ----------------------------------------------------------
        // Case labels that apply to a member of a union type
        // Ordered by their values
        typedef sequence<long> UnionCaseLabelSeq;

        @extensibility(FINAL)
        @nested
        struct CommonUnionMember {
            MemberId member_id;
            UnionMemberFlag member_flags;
            TypeIdentifier type_id;
            UnionCaseLabelSeq label_seq;
        };
        // Member of a union type
        @extensibility(APPENDABLE)
        @nested
        struct CompleteUnionMember {
            CommonUnionMember common;
            CompleteMemberDetail detail;
        };
        // Ordered by member_index
        typedef sequence<CompleteUnionMember> CompleteUnionMemberSeq;
        // Member of a union type
        @extensibility(APPENDABLE)
        @nested
        struct MinimalUnionMember {
            CommonUnionMember common;
            MinimalMemberDetail detail;
        };
        // Ordered by MinimalUnionMember.common.member_id
        typedef sequence<MinimalUnionMember> MinimalUnionMemberSeq;

        @extensibility(FINAL)
        @nested
        struct CommonDiscriminatorMember {
            UnionDiscriminatorFlag member_flags;
            TypeIdentifier type_id;
        };
        // Member of a union type
        @extensibility(APPENDABLE)
        @nested
        struct CompleteDiscriminatorMember {
            CommonDiscriminatorMember common;
            @optional
            AppliedBuiltinTypeAnnotations ann_builtin;
            @optional
            AppliedAnnotationSeq ann_custom;
        };
        // Member of a union type
        @extensibility(APPENDABLE)
        @nested
        struct MinimalDiscriminatorMember {
            CommonDiscriminatorMember common;
        };

        @extensibility(APPENDABLE)
        @nested
        struct CompleteUnionHeader {
            CompleteTypeDetail detail;
        };

        @extensibility(APPENDABLE)
        @nested
        struct MinimalUnionHeader {
            MinimalTypeDetail detail;
        };

        @extensibility(FINAL)
        @nested
        struct CompleteUnionType {
            UnionTypeFlag union_flags;
            CompleteUnionHeader header;
            CompleteDiscriminatorMember discriminator;
            CompleteUnionMemberSeq member_seq;
        };

        @extensibility(FINAL)
        @nested
        struct MinimalUnionType {
            UnionTypeFlag union_flags;
            MinimalUnionHeader header;
            MinimalDiscriminatorMember discriminator;
            MinimalUnionMemberSeq member_seq;
        };
        // --- Annotation: ----------------------------------------------------
        @extensibility(FINAL)
        @nested
        struct CommonAnnotationParameter {
            AnnotationParameterFlag member_flags;
            TypeIdentifier member_type_id;
        };
        // Member of an annotation type
        @extensibility(APPENDABLE)
        @nested
        struct CompleteAnnotationParameter {
            CommonAnnotationParameter common;
            MemberName name;
            AnnotationParameterValue default_value;
        };
        // Ordered by CompleteAnnotationParameter.name
        typedef sequence<CompleteAnnotationParameter> CompleteAnnotationParameterSeq;

        @extensibility(APPENDABLE)
        @nested
        struct MinimalAnnotationParameter {
            CommonAnnotationParameter common;
            NameHash name_hash;
            AnnotationParameterValue default_value;
        };
        // Ordered by MinimalAnnotationParameter.name_hash
        typedef sequence<MinimalAnnotationParameter> MinimalAnnotationParameterSeq;

        @extensibility(APPENDABLE)
        @nested
        struct CompleteAnnotationHeader {
            QualifiedTypeName annotation_name;
        };

        @extensibility(APPENDABLE)
        @nested
        struct MinimalAnnotationHeader {
            // Empty. Available for future extension
        };

        @extensibility(FINAL)
        @nested
        struct CompleteAnnotationType {
            AnnotationTypeFlag annotation_flag;
            CompleteAnnotationHeader header;
            CompleteAnnotationParameterSeq member_seq;
        };

        @extensibility(FINAL)
        @nested
        struct MinimalAnnotationType {
            AnnotationTypeFlag annotation_flag;
            MinimalAnnotationHeader header;
            MinimalAnnotationParameterSeq member_seq;
        };
        // --- Alias: ----------------------------------------------------------
        @extensibility(FINAL)
        @nested
        struct CommonAliasBody {
            AliasMemberFlag related_flags;
            TypeIdentifier related_type;
        };

        @extensibility(APPENDABLE)
        @nested
        struct CompleteAliasBody {
            CommonAliasBody common;
            @optional
            AppliedBuiltinMemberAnnotations ann_builtin;
            @optional
            AppliedAnnotationSeq ann_custom;
        };

        @extensibility(APPENDABLE)
        @nested
        struct MinimalAliasBody {
            CommonAliasBody common;
        };

        @extensibility(APPENDABLE)
        @nested
        struct CompleteAliasHeader {
            CompleteTypeDetail detail;
        };

        @extensibility(APPENDABLE)
        @nested
        struct MinimalAliasHeader {
            // Empty. Available for future extension
        };

        @extensibility(FINAL)
        @nested
        struct CompleteAliasType {
            AliasTypeFlag alias_flags;
            CompleteAliasHeader header;
            CompleteAliasBody body;
        };

        @extensibility(FINAL)
        @nested
        struct MinimalAliasType {
            AliasTypeFlag alias_flags;
            MinimalAliasHeader header;
            MinimalAliasBody body;
        };
        // --- Collections: ----------------------------------------------------
        @extensibility(FINAL)
        @nested
        struct CompleteElementDetail {
            @optional
            AppliedBuiltinMemberAnnotations ann_builtin;
            @optional
            AppliedAnnotationSeq ann_custom;
        };

        @extensibility(FINAL)
        @nested
        struct CommonCollectionElement {
            CollectionElementFlag element_flags;
            TypeIdentifier type;
        };

        @extensibility(APPENDABLE)
        @nested
        struct CompleteCollectionElement {
            CommonCollectionElement common;
            CompleteElementDetail detail;
        };

        @extensibility(APPENDABLE)
        @nested
        struct MinimalCollectionElement {
            CommonCollectionElement common;
        };

        @extensibility(FINAL)
        @nested
        struct CommonCollectionHeader {
            LBound bound;
        };

        @extensibility(APPENDABLE)
        @nested
        struct CompleteCollectionHeader {
            CommonCollectionHeader common;
            @optional
            CompleteTypeDetail detail;
            // not present for anonymous
        };

        @extensibility(APPENDABLE)
        @nested
        struct MinimalCollectionHeader {
            CommonCollectionHeader common;
        };
        // --- Sequence: ------------------------------------------------------
        @extensibility(FINAL)
        @nested
        struct CompleteSequenceType {
            CollectionTypeFlag collection_flag;
            CompleteCollectionHeader header;
            CompleteCollectionElement element;
        };

        @extensibility(FINAL)
        @nested
        struct MinimalSequenceType {
            CollectionTypeFlag collection_flag;
            MinimalCollectionHeader header;
            MinimalCollectionElement element;
        };
        // --- Array: ------------------------------------------------------
        @extensibility(FINAL)
        @nested
        struct CommonArrayHeader {
            LBoundSeq bound_seq;
        };

        @extensibility(APPENDABLE)
        @nested
        struct CompleteArrayHeader {
            CommonArrayHeader common;
            CompleteTypeDetail detail;
        };

        @extensibility(APPENDABLE)
        @nested
        struct MinimalArrayHeader {
            CommonArrayHeader common;
        };

        @extensibility(APPENDABLE)
        @nested
        struct CompleteArrayType {
            CollectionTypeFlag collection_flag;
            CompleteArrayHeader header;
            CompleteCollectionElement element;
        };

        @extensibility(FINAL)
        @nested
        struct MinimalArrayType {
            CollectionTypeFlag collection_flag;
            MinimalArrayHeader header;
            MinimalCollectionElement element;
        };
        // --- Map: ------------------------------------------------------
        @extensibility(FINAL)
        @nested
        struct CompleteMapType {
            CollectionTypeFlag collection_flag;
            CompleteCollectionHeader header;
            CompleteCollectionElement key;
            CompleteCollectionElement element;
        };

        @extensibility(FINAL)
        @nested
        struct MinimalMapType {
            CollectionTypeFlag collection_flag;
            MinimalCollectionHeader header;
            MinimalCollectionElement key;
            MinimalCollectionElement element;
        };
        // --- Enumeration: ----------------------------------------------------
        typedef unsigned short BitBound;
        // Constant in an enumerated type
        @extensibility(APPENDABLE)
        @nested
        struct CommonEnumeratedLiteral {
            long value;
            EnumeratedLiteralFlag flags;
        };
        // Constant in an enumerated type
        @extensibility(APPENDABLE)
        @nested
        struct CompleteEnumeratedLiteral {
            CommonEnumeratedLiteral common;
            CompleteMemberDetail detail;
        };
        // Ordered by EnumeratedLiteral.common.value
        typedef sequence<CompleteEnumeratedLiteral> CompleteEnumeratedLiteralSeq;
        // Constant in an enumerated type
        @extensibility(APPENDABLE)
        @nested
        struct MinimalEnumeratedLiteral {
            CommonEnumeratedLiteral common;
            MinimalMemberDetail detail;
        };
        // Ordered by EnumeratedLiteral.common.value
        typedef sequence<MinimalEnumeratedLiteral> MinimalEnumeratedLiteralSeq;

        @extensibility(FINAL)
        @nested
        struct CommonEnumeratedHeader {
            BitBound bit_bound;
        };

        @extensibility(APPENDABLE)
        @nested
        struct CompleteEnumeratedHeader {
            CommonEnumeratedHeader common;
            CompleteTypeDetail detail;
        };

        @extensibility(APPENDABLE)
        @nested
        struct MinimalEnumeratedHeader {
            CommonEnumeratedHeader common;
        };
        // Enumerated type
        @extensibility(FINAL)
        @nested
        struct CompleteEnumeratedType {
            EnumTypeFlag enum_flags;
            // unused
            CompleteEnumeratedHeader header;
            CompleteEnumeratedLiteralSeq literal_seq;
        };
        // Enumerated type
        @extensibility(FINAL)
        @nested
        struct MinimalEnumeratedType {
            EnumTypeFlag enum_flags;
            // unused
            MinimalEnumeratedHeader header;
            MinimalEnumeratedLiteralSeq literal_seq;
        };
        // --- Bitmask: --------------------------------------------------------
        // Bit in a bit mask
        @extensibility(FINAL)
        @nested
        struct CommonBitflag {
            unsigned short position;
            BitflagFlag flags;
        };

        @extensibility(APPENDABLE)
        @nested
        struct CompleteBitflag {
            CommonBitflag common;
            CompleteMemberDetail detail;
        };
        // Ordered by Bitflag.position
        typedef sequence<CompleteBitflag> CompleteBitflagSeq;

        @extensibility(APPENDABLE)
        @nested
        struct MinimalBitflag {
            CommonBitflag common;
            MinimalMemberDetail detail;
        };
        // Ordered by Bitflag.position
        typedef sequence<MinimalBitflag> MinimalBitflagSeq;

        @extensibility(FINAL)
        @nested
        struct CommonBitmaskHeader {
            BitBound bit_bound;
        };

        typedef CompleteEnumeratedHeader CompleteBitmaskHeader;

        typedef MinimalEnumeratedHeader MinimalBitmaskHeader;

        @extensibility(APPENDABLE)
        @nested
        struct CompleteBitmaskType {
            BitmaskTypeFlag bitmask_flags;
            // unused
            CompleteBitmaskHeader header;
            CompleteBitflagSeq flag_seq;
        };

        @extensibility(APPENDABLE)
        @nested
        struct MinimalBitmaskType {
            BitmaskTypeFlag bitmask_flags;
            // unused
            MinimalBitmaskHeader header;
            MinimalBitflagSeq flag_seq;
        };
        // --- Bitset: ----------------------------------------------------------
        @extensibility(FINAL)
        @nested
        struct CommonBitfield {
            unsigned short position;
            BitsetMemberFlag flags;
            octet bitcount;
            TypeKind holder_type;
            // Must be primitive integer type
        };

        @extensibility(APPENDABLE)
        @nested
        struct CompleteBitfield {
            CommonBitfield common;
            CompleteMemberDetail detail;
        };
        // Ordered by Bitfield.position
        typedef sequence<CompleteBitfield> CompleteBitfieldSeq;

        @extensibility(APPENDABLE)
        @nested
        struct MinimalBitfield {
            CommonBitfield common;
            NameHash name_hash;
        };
        // Ordered by Bitfield.position
        typedef sequence<MinimalBitfield> MinimalBitfieldSeq;

        @extensibility(APPENDABLE)
        @nested
        struct CompleteBitsetHeader {
            CompleteTypeDetail detail;
        };

        @extensibility(APPENDABLE)
        @nested
        struct MinimalBitsetHeader {
            // Empty. Available for future extension
        };

        @extensibility(APPENDABLE)
        @nested
        struct CompleteBitsetType {
            BitsetTypeFlag bitset_flags;
            // unused
            CompleteBitsetHeader header;
            CompleteBitfieldSeq field_seq;
        };

        @extensibility(APPENDABLE)
        @nested
        struct MinimalBitsetType {
            BitsetTypeFlag bitset_flags;
            // unused
            MinimalBitsetHeader header;
            MinimalBitfieldSeq field_seq;
        };
        // --- Type Object: ---------------------------------------------------
        // The types associated with each case selection must have extensibility
        // kind APPENDABLE or MUTABLE so that they can be extended in the future
        @extensibility(MUTABLE)
        @nested
        struct CompleteExtendedType {
            // Empty. Available for future extension
        };

        @extensibility(FINAL)
        @nested
        union CompleteTypeObject switch (octet) {
            case TK_ALIAS:
                CompleteAliasType alias_type;
            case TK_ANNOTATION:
                CompleteAnnotationType annotation_type;
            case TK_STRUCTURE:
                CompleteStructType struct_type;
            case TK_UNION:
                CompleteUnionType union_type;
            case TK_BITSET:
                CompleteBitsetType bitset_type;
            case TK_SEQUENCE:
                CompleteSequenceType sequence_type;
            case TK_ARRAY:
                CompleteArrayType array_type;
            case TK_MAP:
                CompleteMapType map_type;
            case TK_ENUM:
                CompleteEnumeratedType enumerated_type;
            case TK_BITMASK:
                CompleteBitmaskType bitmask_type;
                // ===================  Future extensibility  ============
            default:
                CompleteExtendedType extended_type;
        };

        @extensibility(MUTABLE)
        @nested
        struct MinimalExtendedType {
            // Empty. Available for future extension
        };

        @extensibility(FINAL)
        @nested
        union MinimalTypeObject switch (octet) {
            case TK_ALIAS:
                MinimalAliasType alias_type;
            case TK_ANNOTATION:
                MinimalAnnotationType annotation_type;
            case TK_STRUCTURE:
                MinimalStructType struct_type;
            case TK_UNION:
                MinimalUnionType union_type;
            case TK_BITSET:
                MinimalBitsetType bitset_type;
            case TK_SEQUENCE:
                MinimalSequenceType sequence_type;
            case TK_ARRAY:
                MinimalArrayType array_type;
            case TK_MAP:
                MinimalMapType map_type;
            case TK_ENUM:
                MinimalEnumeratedType enumerated_type;
            case TK_BITMASK:
                MinimalBitmaskType bitmask_type;
                // ===================  Future extensibility  ============
            default:
                MinimalExtendedType extended_type;
        };

        @extensibility(APPENDABLE)
        @nested
        union TypeObject switch (octet) {
            // EquivalenceKind
            case EK_COMPLETE:
                CompleteTypeObject complete;
            case EK_MINIMAL:
                MinimalTypeObject minimal;
        };

        typedef sequence<TypeObject> TypeObjectSeq;
        // Set of TypeObjects representing a strong component: Equivalence class
        // for the Strong Connectivity relationship (mutual reachability between
        // types).
        // Ordered by fully qualified typename lexicographic order
        typedef TypeObjectSeq StronglyConnectedComponent;

        @extensibility(FINAL)
        @nested
        struct TypeIdentifierTypeObjectPair {
            TypeIdentifier type_identifier;
            TypeObject type_object;
        };

        typedef sequence<TypeIdentifierTypeObjectPair> TypeIdentifierTypeObjectPairSeq;

        @extensibility(FINAL)
        @nested
        struct TypeIdentifierPair {
            TypeIdentifier type_identifier1;
            TypeIdentifier type_identifier2;
        };

        typedef sequence<TypeIdentifierPair> TypeIdentifierPairSeq;

        @extensibility(APPENDABLE)
        @nested
        struct TypeIdentifierWithSize {
            TypeIdentifier type_id;
            unsigned long typeobject_serialized_size;
        };

        typedef sequence<TypeIdentifierWithSize> TypeIdentifierWithSizeSeq;

        @extensibility(APPENDABLE)
        @nested
        struct TypeIdentifierWithDependencies {
            TypeIdentifierWithSize typeid_with_size;
            // The total additional types related to minimal_type
            long dependent_typeid_count;
            sequence<TypeIdentifierWithSize> dependent_typeids;
        };

        typedef sequence<TypeIdentifierWithDependencies> TypeIdentifierWithDependenciesSeq;
        // This appears in the builtin DDS topics PublicationBuiltinTopicData
        // and SubscriptionBuiltinTopicData
        @extensibility(MUTABLE)
        @nested
        struct TypeInformation {
            @id(0x1001)
            TypeIdentifierWithDependencies minimal;
            @id(0x1002)
            TypeIdentifierWithDependencies complete;
        };

        typedef sequence<TypeInformation> TypeInformationSeq;

    };
    // end of module XTypes
};
// end module DDS