DDS-XTypes 1.2 RTF Avatar
  1. OMG Issue

DDSXTY12 — Computing the TypeObject and TypeId for recursive types

  • Key: DDSXTY12-147
  • Status: closed  
  • Source: Real-Time Innovations ( Gerardo Pardo-Castellote)
  • Summary:

    A recursive type is one that refers to itself either directly or indirectly. These types are useful to represent dynamic data structures such as trees. For example:

    struct Node;
    struct Node {
        long data;
        @external @optional Node left_child;
        @external @optional Node right_child:
    };
    

    The children are marked @external so that the generated code in languages like C and C++ that can hold object by value uses a reference and therefore does not complain about "incompletely defined symbols"

    The children are marked @optional so that the recursive type can be terminated.

    There is no fundamental problem in supporting these types in the XTYPES type system. Except that the algorithm used to create the TypeObject and compute the TypeId would fail because the type object of an aggregate type requires knowledge of the TypeIdentifiers (and hence TypeObjects) of all the member types and the recursion creates a cyclic-dependency on this.

    Even if this not resolved in RTF 2.2 we need a plan so that we do not break interoperability in the future.

  • Reported: DDS-XTypes 1.1 — Tue, 10 Jan 2017 15:14 GMT
  • Disposition: Duplicate or Merged — DDS-XTypes 1.2
  • Disposition Summary:

    This is addressed by DDSXTY12-100

    Issue DDSXTY12-100 modifies the definition of TypeObject and updates the algorithm to compute TypeIdentifiers from the TypeObjects.

    The updated algorithm can handle mutually dependent types and "recursive" types. Therefore this issue is being merged into DDSXTY12-100.

  • Updated: Thu, 22 Jun 2017 16:42 GMT