dds-xtypes_typeobject.idl 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077
  1. /* dds-xtypes_typeobject.idl */
  2. // The types in this file shall be serialized with XCDR encoding version 2
  3. module DDS {
  4. module XTypes {
  5. // ---------- Equivalence Kinds ------------------
  6. typedef octet EquivalenceKind;
  7. const octet EK_MINIMAL = 0xF1; // 0x1111 0001
  8. const octet EK_COMPLETE = 0xF2; // 0x1111 0010
  9. const octet EK_BOTH = 0xF3; // 0x1111 0011
  10. // ---------- TypeKinds (begin) ------------------
  11. typedef octet TypeKind; // Primitive TKs
  12. const octet TK_NONE = 0x00;
  13. const octet TK_BOOLEAN = 0x01;
  14. const octet TK_BYTE = 0x02;
  15. const octet TK_INT16 = 0x03;
  16. const octet TK_INT32 = 0x04;
  17. const octet TK_INT64 = 0x05;
  18. const octet TK_UINT16 = 0x06;
  19. const octet TK_UINT32 = 0x07;
  20. const octet TK_UINT64 = 0x08;
  21. const octet TK_FLOAT32 = 0x09;
  22. const octet TK_FLOAT64 = 0x0A;
  23. const octet TK_FLOAT128 = 0x0B;
  24. const octet TK_CHAR8 = 0x10;
  25. const octet TK_CHAR16 = 0x11;
  26. // String TKs
  27. const octet TK_STRING8 = 0x20;
  28. const octet TK_STRING16 = 0x21;
  29. // Constructed/Named types
  30. const octet TK_ALIAS = 0x30;
  31. // Enumerated TKs
  32. const octet TK_ENUM = 0x40;
  33. const octet TK_BITMASK = 0x41;
  34. // Structured TKs
  35. const octet TK_ANNOTATION = 0x50;
  36. const octet TK_STRUCTURE = 0x51;
  37. const octet TK_UNION = 0x52;
  38. const octet TK_BITSET = 0x53;
  39. // Collection TKs
  40. const octet TK_SEQUENCE = 0x60;
  41. const octet TK_ARRAY = 0x61;
  42. const octet TK_MAP = 0x62;
  43. // ---------- TypeKinds (end) ------------------
  44. // ---------- Extra TypeIdentifiers (begin) -----------
  45. typedef octet TypeIdentiferKind;
  46. const octet TI_STRING8_SMALL = 0x70;
  47. const octet TI_STRING8_LARGE = 0x71;
  48. const octet TI_STRING16_SMALL = 0x72;
  49. const octet TI_STRING16_LARGE = 0x73;
  50. const octet TI_PLAIN_SEQUENCE_SMALL = 0x80;
  51. const octet TI_PLAIN_SEQUENCE_LARGE = 0x81;
  52. const octet TI_PLAIN_ARRAY_SMALL = 0x90;
  53. const octet TI_PLAIN_ARRAY_LARGE = 0x91;
  54. const octet TI_PLAIN_MAP_SMALL = 0xA0;
  55. const octet TI_PLAIN_MAP_LARGE = 0xA1;
  56. const octet TI_STRONGLY_CONNECTED_COMPONENT = 0xB0;
  57. // ---------- Extra TypeIdentifiers (end) -------------
  58. // The name of some element (e.g. type, type member, module)
  59. // Valid characters are alphanumeric plus the "_" cannot start with digit
  60. const long MEMBER_NAME_MAX_LENGTH = 256; typedef string<MEMBER_NAME_MAX_LENGTH> MemberName;
  61. // Qualified type name includes the name of containing modules
  62. // using "::" as separator. No leading "::". E.g. "MyModule::MyType"
  63. const long TYPE_NAME_MAX_LENGTH = 256;
  64. typedef string<TYPE_NAME_MAX_LENGTH> QualifiedTypeName;
  65. // Every type has an ID. Those of the primitive types are pre-defined.
  66. typedef octet PrimitiveTypeId;
  67. // First 14 bytes of MD5 of the serialized TypeObject using XCDR
  68. // version 2 with Little Endian encoding
  69. typedef octet EquivalenceHash[14];
  70. // First 4 bytes of MD5 of of a member name converted to bytes
  71. // using UTF-8 encoding and without a 'nul' terminator.
  72. // Example: the member name "color" has NameHash {0x70, 0xDD, 0xA5, 0xDF}
  73. typedef octet NameHash[4];
  74. // Long Bound of a collection type
  75. typedef unsigned long LBound;
  76. typedef sequence<LBound> LBoundSeq;
  77. const LBound INVALID_LBOUND = 0;
  78. // Short Bound of a collection type
  79. typedef octet SBound;
  80. typedef sequence<SBound> SBoundSeq;
  81. const SBound INVALID_SBOUND = 0;
  82. @extensibility(FINAL) @nested
  83. union TypeObjectHashId switch (octet) {
  84. case EK_COMPLETE:
  85. case EK_MINIMAL:
  86. EquivalenceHash hash;
  87. };
  88. // Flags that apply to struct/union/collection/enum/bitmask/bitset
  89. // members/elements and DO affect type assignability
  90. // Depending on the flag it may not apply to members of all types
  91. // When not all, the applicable member types are listed
  92. @bit_bound(16)
  93. bitmask MemberFlag {
  94. @position(0) TRY_CONSTRUCT1, // T1 | 00 = INVALID, 01 = DISCARD
  95. @position(1) TRY_CONSTRUCT2, // T2 | 10 = USE_DEFAULT, 11 = TRIM
  96. @position(2) IS_EXTERNAL, // X StructMember, UnionMember,
  97. // CollectionElement
  98. @position(3) IS_OPTIONAL, // O StructMember
  99. @position(4) IS_MUST_UNDERSTAND, // M StructMember
  100. @position(5) IS_KEY, // K StructMember, UnionDiscriminator
  101. @position(6) IS_DEFAULT // D UnionMember, EnumerationLiteral
  102. };
  103. typedef MemberFlag CollectionElementFlag; // T1, T2, X
  104. typedef MemberFlag StructMemberFlag; // T1, T2, O, M, K, X
  105. typedef MemberFlag UnionMemberFlag; // T1, T2, D, X
  106. typedef MemberFlag UnionDiscriminatorFlag; // T1, T2, K
  107. typedef MemberFlag EnumeratedLiteralFlag; // D
  108. typedef MemberFlag AnnotationParameterFlag; // Unused. No flags apply
  109. typedef MemberFlag AliasMemberFlag; // Unused. No flags apply
  110. typedef MemberFlag BitflagFlag; // Unused. No flags apply
  111. typedef MemberFlag BitsetMemberFlag; // Unused. No flags apply
  112. // Mask used to remove the flags that do no affect assignability
  113. // Selects T1, T2, O, M, K, D
  114. const unsigned short MemberFlagMinimalMask = 0x003f;
  115. // Flags that apply to type declarationa and DO affect assignability
  116. // Depending on the flag it may not apply to all types
  117. // When not all, the applicable types are listed
  118. @bit_bound(16) bitmask TypeFlag {
  119. @position(0) IS_FINAL, // F |
  120. @position(1) IS_APPENDABLE, // A |- Struct, Union
  121. @position(2) IS_MUTABLE, // M | (exactly one flag)
  122. @position(3) IS_NESTED, // N Struct, Union
  123. @position(4) IS_AUTOID_HASH // H Struct
  124. };
  125. typedef TypeFlag StructTypeFlag; // All flags apply
  126. typedef TypeFlag UnionTypeFlag; // All flags apply
  127. typedef TypeFlag CollectionTypeFlag; // Unused. No flags apply
  128. typedef TypeFlag AnnotationTypeFlag; // Unused. No flags apply
  129. typedef TypeFlag AliasTypeFlag; // Unused. No flags apply
  130. typedef TypeFlag EnumTypeFlag; // Unused. No flags apply
  131. typedef TypeFlag BitmaskTypeFlag; // Unused. No flags apply
  132. typedef TypeFlag BitsetTypeFlag; // Unused. No flags apply
  133. // Mask used to remove the flags that do no affect assignability
  134. const unsigned short TypeFlagMinimalMask = 0x0007; // Selects M, A, F
  135. // Forward declaration
  136. union TypeIdentifier;
  137. // 1 Byte
  138. @extensibility(FINAL) @nested
  139. struct StringSTypeDefn {
  140. SBound bound;
  141. };
  142. // 4 Bytes
  143. @extensibility(FINAL) @nested
  144. struct StringLTypeDefn {
  145. LBound bound;
  146. };
  147. @extensibility(FINAL) @nested
  148. struct PlainCollectionHeader {
  149. EquivalenceKind equiv_kind;
  150. CollectionElementFlag element_flags;
  151. };
  152. @extensibility(FINAL) @nested
  153. struct PlainSequenceSElemDefn {
  154. PlainCollectionHeader header;
  155. SBound bound;
  156. @external TypeIdentifier element_identifier;
  157. };
  158. @extensibility(FINAL) @nested
  159. struct PlainSequenceLElemDefn {
  160. PlainCollectionHeader header;
  161. LBound bound;
  162. @external TypeIdentifier element_identifier;
  163. };
  164. @extensibility(FINAL) @nested
  165. struct PlainArraySElemDefn {
  166. PlainCollectionHeader header;
  167. SBoundSeq array_bound_seq;
  168. @external TypeIdentifier element_identifier;
  169. };
  170. @extensibility(FINAL) @nested
  171. struct PlainArrayLElemDefn {
  172. PlainCollectionHeader header;
  173. LBoundSeq array_bound_seq;
  174. @external TypeIdentifier element_identifier;
  175. };
  176. @extensibility(FINAL) @nested
  177. struct PlainMapSTypeDefn {
  178. PlainCollectionHeader header;
  179. SBound bound;
  180. @external TypeIdentifier element_identifier;
  181. CollectionElementFlag key_flags;
  182. @external TypeIdentifier key_identifier;
  183. };
  184. @extensibility(FINAL) @nested
  185. struct PlainMapLTypeDefn {
  186. PlainCollectionHeader header;
  187. LBound bound;
  188. @external TypeIdentifier element_identifier;
  189. CollectionElementFlag key_flags;
  190. @external TypeIdentifier key_identifier;
  191. };
  192. // Used for Types that have cyclic depencencies with other types
  193. @extensibility(APPENDABLE) @nested
  194. struct StronglyConnectedComponentId {
  195. TypeObjectHashId sc_component_id; // Hash StronglyConnectedComponent
  196. long scc_length; // StronglyConnectedComponent.length
  197. long scc_index ; // identify type in Strongly Connected Comp.
  198. };
  199. // Future extensibility
  200. @extensibility(MUTABLE) @nested
  201. struct ExtendedTypeDefn {
  202. // Empty. Available for future extension
  203. };
  204. // The TypeIdentifier uniquely identifies a type (a set of equivalent
  205. // types according to an equivalence relationship: COMPLETE, MNIMAL).
  206. //
  207. // In some cases (primitive types, strings, plain types) the identifier
  208. // is a explicit description of the type.
  209. // In other cases the Identifier is a Hash of the type description
  210. //
  211. // In the case of primitive types and strings the implied equivalence
  212. // relation is the identity.
  213. //
  214. // For Plain Types and Hash-defined TypeIdentifiers there are three
  215. // possibilities: MINIMAL, COMPLETE, and COMMON:
  216. // - MINIMAL indicates the TypeIdentifier identifies equivalent types
  217. // according to the MINIMAL equivalence relation
  218. // - COMPLETE indicates the TypeIdentifier identifies equivalent types
  219. // according to the COMPLETE equivalence relation
  220. // - COMMON indicates the TypeIdentifier identifies equivalent types
  221. // according to both the MINIMAL and the COMMON equivalence relation.
  222. // This means the TypeIdentifier is the same for both relationships
  223. //
  224. @extensibility(FINAL) @nested
  225. union TypeIdentifier switch (octet) {
  226. // ============ Primitive types - use TypeKind ====================
  227. // All primitive types fall here.
  228. // Commented-out because Unions cannot have cases with no member.
  229. /* case TK_NONE:
  230. case TK_BOOLEAN:
  231. case TK_BYTE_TYPE:
  232. case TK_INT16_TYPE:
  233. case TK_INT32_TYPE:
  234. case TK_INT64_TYPE:
  235. case TK_UINT16_TYPE:
  236. case TK_UINT32_TYPE:
  237. case TK_UINT64_TYPE:
  238. case TK_FLOAT32_TYPE:
  239. case TK_FLOAT64_TYPE:
  240. case TK_FLOAT128_TYPE:
  241. case TK_CHAR8_TYPE:
  242. case TK_CHAR16_TYPE:
  243. // No Value
  244. */
  245. // ============ Strings - use TypeIdentifierKind ===================
  246. case TI_STRING8_SMALL:
  247. case TI_STRING16_SMALL:
  248. StringSTypeDefn string_sdefn;
  249. case TI_STRING8_LARGE:
  250. case TI_STRING16_LARGE:
  251. StringLTypeDefn string_ldefn;
  252. // ============ Plain collectios - use TypeIdentifierKind =========
  253. case TI_PLAIN_SEQUENCE_SMALL:
  254. PlainSequenceSElemDefn seq_sdefn;
  255. case TI_PLAIN_SEQUENCE_LARGE:
  256. PlainSequenceLElemDefn seq_ldefn;
  257. case TI_PLAIN_ARRAY_SMALL:
  258. PlainArraySElemDefn array_sdefn;
  259. case TI_PLAIN_ARRAY_LARGE:
  260. PlainArrayLElemDefn array_ldefn;
  261. case TI_PLAIN_MAP_SMALL:
  262. PlainMapSTypeDefn map_sdefn;
  263. case TI_PLAIN_MAP_LARGE:
  264. PlainMapLTypeDefn map_ldefn;
  265. // ============ Types that are mutually dependent on each other ===
  266. case TI_STRONGLY_CONNECTED_COMPONENT:
  267. StronglyConnectedComponentId sc_component_id;
  268. // ============ The remaining cases - use EquivalenceKind =========
  269. case EK_COMPLETE:
  270. case EK_MINIMAL:
  271. EquivalenceHash equivalence_hash;
  272. // =================== Future extensibility ============
  273. // Future extensions
  274. default: ExtendedTypeDefn extended_defn;
  275. };
  276. typedef sequence<TypeIdentifier> TypeIdentifierSeq;
  277. // --- Annotation usage: ----------------------------------------------
  278. // ID of a type member
  279. typedef unsigned long MemberId;
  280. const unsigned long ANNOTATION_STR_VALUE_MAX_LEN = 128;
  281. const unsigned long ANNOTATION_OCTETSEC_VALUE_MAX_LEN = 128;
  282. @extensibility(MUTABLE) @nested
  283. struct ExtendedAnnotationParameterValue {
  284. // Empty. Available for future extension
  285. };
  286. /* Literal value of an annotation member: either the default value in its
  287. * definition or the value applied in its usage.
  288. */
  289. @extensibility(FINAL) @nested
  290. union AnnotationParameterValue switch (octet) {
  291. case TK_BOOLEAN:
  292. boolean boolean_value;
  293. case TK_BYTE:
  294. octet byte_value;
  295. case TK_INT16:
  296. short int16_value;
  297. case TK_UINT16:
  298. unsigned short uint_16_value;
  299. case TK_INT32:
  300. long int32_value;
  301. case TK_UINT32:
  302. unsigned long uint32_value;
  303. case TK_INT64:
  304. long long int64_value;
  305. case TK_UINT64:
  306. unsigned long long uint64_value;
  307. case TK_FLOAT32:
  308. float float32_value;
  309. case TK_FLOAT64:
  310. double float64_value;
  311. case TK_FLOAT128:
  312. long double float128_value;
  313. case TK_CHAR8:
  314. char char_value;
  315. case TK_CHAR16:
  316. wchar wchar_value;
  317. case TK_ENUM:
  318. long enumerated_value;
  319. case TK_STRING8:
  320. string<ANNOTATION_STR_VALUE_MAX_LEN> string8_value;
  321. case TK_STRING16:
  322. wstring<ANNOTATION_STR_VALUE_MAX_LEN> string16_value;
  323. default:
  324. ExtendedAnnotationParameterValue extended_value;
  325. };
  326. // The application of an annotation to some type or type member
  327. @extensibility(APPENDABLE) @nested
  328. struct AppliedAnnotationParameter {
  329. NameHash paramname_hash;
  330. AnnotationParameterValue value;
  331. };
  332. // Sorted by AppliedAnnotationParameter.paramname_hash
  333. typedef
  334. sequence<AppliedAnnotationParameter> AppliedAnnotationParameterSeq;
  335. @extensibility(APPENDABLE) @nested
  336. struct AppliedAnnotation {
  337. TypeIdentifier annotation_typeid;
  338. @optional AppliedAnnotationParameterSeq param_seq;
  339. };
  340. // Sorted by AppliedAnnotation.annotation_typeid
  341. typedef sequence<AppliedAnnotation> AppliedAnnotationSeq;
  342. // @verbatim(placement="<placement>", language="<lang>", text="<text>")
  343. @extensibility(FINAL) @nested
  344. struct AppliedVerbatimAnnotation {
  345. string<32> placement;
  346. string<32> language;
  347. string text;
  348. };
  349. // --- Aggregate types: -----------------------------------------------
  350. @extensibility(APPENDABLE) @nested
  351. struct AppliedBuiltinMemberAnnotations {
  352. @optional string unit; // @unit("<unit>")
  353. @optional AnnotationParameterValue min; // @min , @range
  354. @optional AnnotationParameterValue max; // @max , @range
  355. @optional string hash_id; // @hash_id("<membername>")
  356. };
  357. @extensibility(FINAL) @nested
  358. struct CommonStructMember {
  359. MemberId member_id;
  360. StructMemberFlag member_flags;
  361. TypeIdentifier member_type_id;
  362. };
  363. // COMPLETE Details for a member of an aggregate type
  364. @extensibility(FINAL) @nested
  365. struct CompleteMemberDetail {
  366. MemberName name;
  367. @optional AppliedBuiltinMemberAnnotations ann_builtin;
  368. @optional AppliedAnnotationSeq ann_custom;
  369. };
  370. // MINIMAL Details for a member of an aggregate type
  371. @extensibility(FINAL) @nested struct MinimalMemberDetail {
  372. NameHash name_hash;
  373. };
  374. // Member of an aggregate type
  375. @extensibility(APPENDABLE) @nested
  376. struct CompleteStructMember {
  377. CommonStructMember common;
  378. CompleteMemberDetail detail;
  379. };
  380. // Ordered by the member_index
  381. typedef sequence<CompleteStructMember> CompleteStructMemberSeq;
  382. // Member of an aggregate type
  383. @extensibility(APPENDABLE) @nested
  384. struct MinimalStructMember {
  385. CommonStructMember common;
  386. MinimalMemberDetail detail;
  387. };
  388. // Ordered by common.member_id
  389. typedef sequence<MinimalStructMember> MinimalStructMemberSeq;
  390. @extensibility(APPENDABLE) @nested
  391. struct AppliedBuiltinTypeAnnotations {
  392. @optional AppliedVerbatimAnnotation verbatim; // @verbatim(...)
  393. };
  394. @extensibility(FINAL) @nested
  395. struct MinimalTypeDetail {
  396. // Empty. Available for future extension
  397. };
  398. @extensibility(FINAL) @nested
  399. struct CompleteTypeDetail {
  400. @optional AppliedBuiltinTypeAnnotations ann_builtin;
  401. @optional AppliedAnnotationSeq ann_custom;
  402. QualifiedTypeName type_name;
  403. };
  404. @extensibility(APPENDABLE) @nested
  405. struct CompleteStructHeader {
  406. TypeIdentifier base_type;
  407. CompleteTypeDetail detail;
  408. };
  409. @extensibility(APPENDABLE) @nested
  410. struct MinimalStructHeader {
  411. TypeIdentifier base_type;
  412. MinimalTypeDetail detail;
  413. };
  414. @extensibility(FINAL) @nested
  415. struct CompleteStructType {
  416. StructTypeFlag struct_flags;
  417. CompleteStructHeader header;
  418. CompleteStructMemberSeq member_seq;
  419. };
  420. @extensibility(FINAL) @nested
  421. struct MinimalStructType {
  422. StructTypeFlag struct_flags;
  423. MinimalStructHeader header;
  424. MinimalStructMemberSeq member_seq;
  425. };
  426. // --- Union: ---------------------------------------------------------
  427. // Case labels that apply to a member of a union type
  428. // Ordered by their values
  429. typedef sequence<long> UnionCaseLabelSeq;
  430. @extensibility(FINAL) @nested
  431. struct CommonUnionMember {
  432. MemberId member_id;
  433. UnionMemberFlag member_flags;
  434. TypeIdentifier type_id;
  435. UnionCaseLabelSeq label_seq;
  436. };
  437. // Member of a union type
  438. @extensibility(APPENDABLE) @nested
  439. struct CompleteUnionMember {
  440. CommonUnionMember common;
  441. CompleteMemberDetail detail;
  442. };
  443. // Ordered by member_index
  444. typedef sequence<CompleteUnionMember> CompleteUnionMemberSeq;
  445. // Member of a union type
  446. @extensibility(APPENDABLE) @nested
  447. struct MinimalUnionMember {
  448. CommonUnionMember common;
  449. MinimalMemberDetail detail;
  450. };
  451. // Ordered by MinimalUnionMember.common.member_id
  452. typedef sequence<MinimalUnionMember> MinimalUnionMemberSeq;
  453. @extensibility(FINAL) @nested
  454. struct CommonDiscriminatorMember {
  455. UnionDiscriminatorFlag member_flags;
  456. TypeIdentifier type_id;
  457. };
  458. // Member of a union type
  459. @extensibility(APPENDABLE) @nested
  460. struct CompleteDiscriminatorMember {
  461. CommonDiscriminatorMember common;
  462. @optional AppliedBuiltinTypeAnnotations ann_builtin;
  463. @optional AppliedAnnotationSeq ann_custom;
  464. };
  465. // Member of a union type
  466. @extensibility(APPENDABLE) @nested
  467. struct MinimalDiscriminatorMember {
  468. CommonDiscriminatorMember common;
  469. };
  470. @extensibility(APPENDABLE) @nested
  471. struct CompleteUnionHeader {
  472. CompleteTypeDetail detail;
  473. };
  474. @extensibility(APPENDABLE) @nested
  475. struct MinimalUnionHeader {
  476. MinimalTypeDetail detail;
  477. };
  478. @extensibility(FINAL) @nested
  479. struct CompleteUnionType {
  480. UnionTypeFlag union_flags;
  481. CompleteUnionHeader header;
  482. CompleteDiscriminatorMember discriminator;
  483. CompleteUnionMemberSeq member_seq;
  484. };
  485. @extensibility(FINAL) @nested
  486. struct MinimalUnionType {
  487. UnionTypeFlag union_flags;
  488. MinimalUnionHeader header;
  489. MinimalDiscriminatorMember discriminator;
  490. MinimalUnionMemberSeq member_seq;
  491. };
  492. // --- Annotation: ---------------------------------------------------
  493. @extensibility(FINAL) @nested
  494. struct CommonAnnotationParameter {
  495. AnnotationParameterFlag member_flags;
  496. TypeIdentifier member_type_id;
  497. };
  498. // Member of an annotation type
  499. @extensibility(APPENDABLE) @nested
  500. struct CompleteAnnotationParameter {
  501. CommonAnnotationParameter common;
  502. MemberName name;
  503. AnnotationParameterValue default_value;
  504. };
  505. // Ordered by CompleteAnnotationParameter.name
  506. typedef sequence<CompleteAnnotationParameter> CompleteAnnotationParameterSeq;
  507. @extensibility(APPENDABLE) @nested
  508. struct MinimalAnnotationParameter {
  509. CommonAnnotationParameter common;
  510. NameHash name_hash;
  511. AnnotationParameterValue default_value;
  512. };
  513. // Ordered by MinimalAnnotationParameter.name_hash
  514. typedef sequence<MinimalAnnotationParameter> MinimalAnnotationParameterSeq;
  515. @extensibility(APPENDABLE) @nested
  516. struct CompleteAnnotationHeader {
  517. QualifiedTypeName annotation_name;
  518. };
  519. @extensibility(APPENDABLE) @nested
  520. struct MinimalAnnotationHeader {
  521. // Empty. Available for future extension
  522. };
  523. @extensibility(FINAL) @nested
  524. struct CompleteAnnotationType {
  525. AnnotationTypeFlag annotation_flag;
  526. CompleteAnnotationHeader header;
  527. CompleteAnnotationParameterSeq member_seq;
  528. };
  529. @extensibility(FINAL) @nested
  530. struct MinimalAnnotationType {
  531. AnnotationTypeFlag annotation_flag;
  532. MinimalAnnotationHeader header;
  533. MinimalAnnotationParameterSeq member_seq;
  534. };
  535. // --- Alias: ---------------------------------------------------------
  536. @extensibility(FINAL) @nested
  537. struct CommonAliasBody {
  538. AliasMemberFlag related_flags;
  539. TypeIdentifier related_type;
  540. };
  541. @extensibility(APPENDABLE) @nested
  542. struct CompleteAliasBody {
  543. CommonAliasBody common;
  544. @optional AppliedBuiltinMemberAnnotations ann_builtin;
  545. @optional AppliedAnnotationSeq ann_custom;
  546. };
  547. @extensibility(APPENDABLE) @nested
  548. struct MinimalAliasBody {
  549. CommonAliasBody common;
  550. };
  551. @extensibility(APPENDABLE) @nested
  552. struct CompleteAliasHeader {
  553. CompleteTypeDetail detail;
  554. };
  555. @extensibility(APPENDABLE) @nested
  556. struct MinimalAliasHeader {
  557. // Empty. Available for future extension
  558. };
  559. @extensibility(FINAL) @nested
  560. struct CompleteAliasType {
  561. AliasTypeFlag alias_flags;
  562. CompleteAliasHeader header;
  563. CompleteAliasBody body;
  564. };
  565. @extensibility(FINAL) @nested
  566. struct MinimalAliasType {
  567. AliasTypeFlag alias_flags;
  568. MinimalAliasHeader header;
  569. MinimalAliasBody body;
  570. };
  571. // --- Collections: ---------------------------------------------------
  572. @extensibility(FINAL) @nested
  573. struct CompleteElementDetail {
  574. @optional AppliedBuiltinMemberAnnotations ann_builtin;
  575. @optional AppliedAnnotationSeq ann_custom;
  576. };
  577. @extensibility(FINAL) @nested
  578. struct CommonCollectionElement {
  579. CollectionElementFlag element_flags;
  580. TypeIdentifier type;
  581. };
  582. @extensibility(APPENDABLE) @nested
  583. struct CompleteCollectionElement {
  584. CommonCollectionElement common;
  585. CompleteElementDetail detail;
  586. };
  587. @extensibility(APPENDABLE) @nested
  588. struct MinimalCollectionElement {
  589. CommonCollectionElement common;
  590. };
  591. @extensibility(FINAL) @nested
  592. struct CommonCollectionHeader {
  593. LBound bound;
  594. };
  595. @extensibility(APPENDABLE) @nested
  596. struct CompleteCollectionHeader {
  597. CommonCollectionHeader common;
  598. @optional CompleteTypeDetail detail; // not present for anonymous
  599. };
  600. @extensibility(APPENDABLE) @nested
  601. struct MinimalCollectionHeader {
  602. CommonCollectionHeader common;
  603. };
  604. // --- Sequence: -----------------------------------------------------
  605. @extensibility(FINAL) @nested
  606. struct CompleteSequenceType {
  607. CollectionTypeFlag collection_flag;
  608. CompleteCollectionHeader header;
  609. CompleteCollectionElement element;
  610. };
  611. @extensibility(FINAL) @nested
  612. struct MinimalSequenceType {
  613. CollectionTypeFlag collection_flag;
  614. MinimalCollectionHeader header;
  615. MinimalCollectionElement element;
  616. };
  617. // --- Array: -----------------------------------------------------
  618. @extensibility(FINAL) @nested
  619. struct CommonArrayHeader {
  620. LBoundSeq bound_seq;
  621. };
  622. @extensibility(APPENDABLE) @nested
  623. struct CompleteArrayHeader {
  624. CommonArrayHeader common;
  625. CompleteTypeDetail detail;
  626. };
  627. @extensibility(APPENDABLE) @nested
  628. struct MinimalArrayHeader {
  629. CommonArrayHeader common;
  630. };
  631. @extensibility(APPENDABLE) @nested
  632. struct CompleteArrayType {
  633. CollectionTypeFlag collection_flag;
  634. CompleteArrayHeader header;
  635. CompleteCollectionElement element;
  636. };
  637. @extensibility(FINAL) @nested
  638. struct MinimalArrayType {
  639. CollectionTypeFlag collection_flag;
  640. MinimalArrayHeader header;
  641. MinimalCollectionElement element;
  642. };
  643. // --- Map: -----------------------------------------------------
  644. @extensibility(FINAL) @nested
  645. struct CompleteMapType {
  646. CollectionTypeFlag collection_flag;
  647. CompleteCollectionHeader header;
  648. CompleteCollectionElement key;
  649. CompleteCollectionElement element;
  650. };
  651. @extensibility(FINAL) @nested
  652. struct MinimalMapType {
  653. CollectionTypeFlag collection_flag;
  654. MinimalCollectionHeader header;
  655. MinimalCollectionElement key;
  656. MinimalCollectionElement element;
  657. };
  658. // --- Enumeration: ---------------------------------------------------
  659. typedef unsigned short BitBound;
  660. // Constant in an enumerated type
  661. @extensibility(APPENDABLE) @nested
  662. struct CommonEnumeratedLiteral {
  663. long value;
  664. EnumeratedLiteralFlag flags;
  665. };
  666. // Constant in an enumerated type
  667. @extensibility(APPENDABLE) @nested
  668. struct CompleteEnumeratedLiteral {
  669. CommonEnumeratedLiteral common;
  670. CompleteMemberDetail detail;
  671. };
  672. // Ordered by EnumeratedLiteral.common.value
  673. typedef sequence<CompleteEnumeratedLiteral> CompleteEnumeratedLiteralSeq;
  674. // Constant in an enumerated type
  675. @extensibility(APPENDABLE) @nested
  676. struct MinimalEnumeratedLiteral {
  677. CommonEnumeratedLiteral common;
  678. MinimalMemberDetail detail;
  679. };
  680. // Ordered by EnumeratedLiteral.common.value
  681. typedef sequence<MinimalEnumeratedLiteral> MinimalEnumeratedLiteralSeq;
  682. @extensibility(FINAL) @nested
  683. struct CommonEnumeratedHeader {
  684. BitBound bit_bound;
  685. };
  686. @extensibility(APPENDABLE) @nested
  687. struct CompleteEnumeratedHeader {
  688. CommonEnumeratedHeader common;
  689. CompleteTypeDetail detail;
  690. };
  691. @extensibility(APPENDABLE) @nested
  692. struct MinimalEnumeratedHeader {
  693. CommonEnumeratedHeader common;
  694. };
  695. // Enumerated type
  696. @extensibility(FINAL) @nested
  697. struct CompleteEnumeratedType {
  698. EnumTypeFlag enum_flags; // unused
  699. CompleteEnumeratedHeader header;
  700. CompleteEnumeratedLiteralSeq literal_seq;
  701. };
  702. // Enumerated type
  703. @extensibility(FINAL) @nested
  704. struct MinimalEnumeratedType {
  705. EnumTypeFlag enum_flags; // unused
  706. MinimalEnumeratedHeader header;
  707. MinimalEnumeratedLiteralSeq literal_seq;
  708. };
  709. // --- Bitmask: -------------------------------------------------------
  710. // Bit in a bit mask
  711. @extensibility(FINAL) @nested
  712. struct CommonBitflag {
  713. unsigned short position;
  714. BitflagFlag flags;
  715. };
  716. @extensibility(APPENDABLE) @nested
  717. struct CompleteBitflag {
  718. CommonBitflag common;
  719. CompleteMemberDetail detail;
  720. };
  721. // Ordered by Bitflag.position
  722. typedef sequence<CompleteBitflag> CompleteBitflagSeq;
  723. @extensibility(APPENDABLE) @nested
  724. struct MinimalBitflag {
  725. CommonBitflag common;
  726. MinimalMemberDetail detail;
  727. };
  728. // Ordered by Bitflag.position
  729. typedef sequence<MinimalBitflag> MinimalBitflagSeq;
  730. @extensibility(FINAL) @nested
  731. struct CommonBitmaskHeader {
  732. BitBound bit_bound;
  733. };
  734. typedef CompleteEnumeratedHeader CompleteBitmaskHeader;
  735. typedef MinimalEnumeratedHeader MinimalBitmaskHeader;
  736. @extensibility(APPENDABLE) @nested
  737. struct CompleteBitmaskType {
  738. BitmaskTypeFlag bitmask_flags; // unused
  739. CompleteBitmaskHeader header;
  740. CompleteBitflagSeq flag_seq;
  741. };
  742. @extensibility(APPENDABLE) @nested
  743. struct MinimalBitmaskType {
  744. BitmaskTypeFlag bitmask_flags; // unused
  745. MinimalBitmaskHeader header;
  746. MinimalBitflagSeq flag_seq;
  747. };
  748. // --- Bitset: ---------------------------------------------------------
  749. @extensibility(FINAL) @nested
  750. struct CommonBitfield {
  751. unsigned short position;
  752. BitsetMemberFlag flags;
  753. octet bitcount;
  754. TypeKind holder_type; // Must be primitive integer type
  755. };
  756. @extensibility(APPENDABLE) @nested
  757. struct CompleteBitfield {
  758. CommonBitfield common;
  759. CompleteMemberDetail detail;
  760. };
  761. // Ordered by Bitfield.position
  762. typedef sequence<CompleteBitfield> CompleteBitfieldSeq;
  763. @extensibility(APPENDABLE) @nested
  764. struct MinimalBitfield {
  765. CommonBitfield common;
  766. NameHash name_hash;
  767. };
  768. // Ordered by Bitfield.position
  769. typedef sequence<MinimalBitfield> MinimalBitfieldSeq;
  770. @extensibility(APPENDABLE) @nested
  771. struct CompleteBitsetHeader {
  772. CompleteTypeDetail detail;
  773. };
  774. @extensibility(APPENDABLE) @nested
  775. struct MinimalBitsetHeader {
  776. // Empty. Available for future extension
  777. };
  778. @extensibility(APPENDABLE) @nested
  779. struct CompleteBitsetType {
  780. BitsetTypeFlag bitset_flags; // unused
  781. CompleteBitsetHeader header;
  782. CompleteBitfieldSeq field_seq;
  783. };
  784. @extensibility(APPENDABLE) @nested
  785. struct MinimalBitsetType {
  786. BitsetTypeFlag bitset_flags; // unused
  787. MinimalBitsetHeader header;
  788. MinimalBitfieldSeq field_seq;
  789. };
  790. // --- Type Object: --------------------------------------------------
  791. // The types associated with each case selection must have extensibility
  792. // kind APPENDABLE or MUTABLE so that they can be extended in the future
  793. @extensibility(MUTABLE) @nested
  794. struct CompleteExtendedType {
  795. // Empty. Available for future extension
  796. };
  797. @extensibility(FINAL) @nested
  798. union CompleteTypeObject switch (octet) {
  799. case TK_ALIAS:
  800. CompleteAliasType alias_type;
  801. case TK_ANNOTATION:
  802. CompleteAnnotationType annotation_type;
  803. case TK_STRUCTURE:
  804. CompleteStructType struct_type;
  805. case TK_UNION:
  806. CompleteUnionType union_type;
  807. case TK_BITSET:
  808. CompleteBitsetType bitset_type;
  809. case TK_SEQUENCE:
  810. CompleteSequenceType sequence_type;
  811. case TK_ARRAY:
  812. CompleteArrayType array_type;
  813. case TK_MAP:
  814. CompleteMapType map_type;
  815. case TK_ENUM:
  816. CompleteEnumeratedType enumerated_type;
  817. case TK_BITMASK:
  818. CompleteBitmaskType bitmask_type;
  819. // =================== Future extensibility ============
  820. default:
  821. CompleteExtendedType extended_type;
  822. };
  823. @extensibility(MUTABLE) @nested
  824. struct MinimalExtendedType {
  825. // Empty. Available for future extension
  826. };
  827. @extensibility(FINAL) @nested
  828. union MinimalTypeObject switch (octet) {
  829. case TK_ALIAS:
  830. MinimalAliasType alias_type;
  831. case TK_ANNOTATION:
  832. MinimalAnnotationType annotation_type;
  833. case TK_STRUCTURE:
  834. MinimalStructType struct_type;
  835. case TK_UNION:
  836. MinimalUnionType union_type;
  837. case TK_BITSET:
  838. MinimalBitsetType bitset_type;
  839. case TK_SEQUENCE:
  840. MinimalSequenceType sequence_type;
  841. case TK_ARRAY:
  842. MinimalArrayType array_type;
  843. case TK_MAP:
  844. MinimalMapType map_type;
  845. case TK_ENUM:
  846. MinimalEnumeratedType enumerated_type;
  847. case TK_BITMASK:
  848. MinimalBitmaskType bitmask_type;
  849. // =================== Future extensibility ============
  850. default:
  851. MinimalExtendedType extended_type;
  852. };
  853. @extensibility(APPENDABLE) @nested
  854. union TypeObject switch (octet) { // EquivalenceKind
  855. case EK_COMPLETE:
  856. CompleteTypeObject complete;
  857. case EK_MINIMAL:
  858. MinimalTypeObject minimal;
  859. };
  860. typedef sequence<TypeObject> TypeObjectSeq;
  861. // Set of TypeObjects representing a strong component: Equivalence class
  862. // for the Strong Connectivity relationship (mutual reachability between
  863. // types).
  864. // Ordered by fully qualified typename lexicographic order
  865. typedef TypeObjectSeq StronglyConnectedComponent;
  866. @extensibility(FINAL) @nested
  867. struct TypeIdentifierTypeObjectPair {
  868. TypeIdentifier type_identifier;
  869. TypeObject type_object;
  870. };
  871. typedef
  872. sequence<TypeIdentifierTypeObjectPair> TypeIdentifierTypeObjectPairSeq;
  873. @extensibility(FINAL) @nested
  874. struct TypeIdentifierPair {
  875. TypeIdentifier type_identifier1;
  876. TypeIdentifier type_identifier2;
  877. };
  878. typedef sequence<TypeIdentifierPair> TypeIdentifierPairSeq;
  879. @extensibility(APPENDABLE) @nested
  880. struct TypeIdentifierWithSize {
  881. DDS::Xtypes::TypeIdentifier type_id;
  882. unsigned long typeobject_serialized_size;
  883. };
  884. typedef sequence<TypeIdentifierWithSize> TypeIdentfierWithSizeSeq;
  885. @extensibility(APPENDABLE) @nested
  886. struct TypeIdentifierWithDependencies {
  887. TypeIdentifierWithSize typeid_with_size;
  888. // The total additional types related to minimal_type
  889. long dependent_typeid_count;
  890. sequence<TypeIdentifierWithSize> dependent_typeids;
  891. };
  892. typedef sequence<TypeIdentifierWithDependencies> TypeIdentifierWithDependenciesSeq;
  893. // This appears in the builtin DDS topics PublicationBuiltinTopicData
  894. // and SubscriptionBuiltinTopicData
  895. @extensibility(MUTABLE) @nested
  896. struct TypeInformation {
  897. @id(0x1001) TypeIdentifierWithDependencies minimal;
  898. @id(0x1002) TypeIdentifierWithDependencies complete;
  899. };
  900. typedef sequence<TypeInformation> TypeInformationSeq;
  901. }; // end of module XTypes
  902. }; // end module DDS