1. with Interfaces; 
  2. with System; 
  3.  
  4. with Ada.Unchecked_Deallocation; 
  5. with Ada.Strings; 
  6. with Ada.Strings.Wide_Unbounded; 
  7. with Ada.Strings.Unbounded; 
  8. package RTIDDS.Types is 
  9.  
  10.    pragma Preelaborate; 
  11.  
  12.    subtype Address is System.Address; 
  13.    --  Provided as a subtype here so that generated code can avoid a direct 
  14.    --  dependency on System, which may clash with a used-defined identifier. 
  15.  
  16.    --  Note that some of these names duplicate names in Standard. The reason is 
  17.    --  that this is patterned after package CORBA, which is required to do 
  18.    --  that. 
  19.  
  20.    type    short              is new Interfaces.Integer_16; 
  21.    type    long               is new Interfaces.Integer_32; 
  22.    type    Long_Long          is new Interfaces.Integer_64; 
  23.    type    unsigned_short     is new Interfaces.Unsigned_16; 
  24.    type    unsigned_long      is new Interfaces.Unsigned_32; 
  25.    type    Unsigned_Long_Long is new Interfaces.Unsigned_64; 
  26.    pragma Warnings (Off); -- redefinition of entity in Standard 
  27.    type    Float              is new Interfaces.IEEE_Float_32; 
  28.    pragma Warnings (On); 
  29.    type    Double             is new Interfaces.IEEE_Float_64; 
  30.    type    Long_Double        is new Interfaces.IEEE_Extended_Float; 
  31.    subtype Char               is Standard.Character; 
  32.    subtype Wchar              is Standard.Wide_Character; 
  33.    type    Octet              is new Interfaces.Unsigned_8; 
  34.    pragma Warnings (Off); -- redefinition of entity in Standard 
  35.    subtype Boolean            is Standard.Boolean; 
  36.  
  37.    type Wide_String is new Ada.Strings.Wide_Unbounded.Unbounded_Wide_String; 
  38.    type String is new Ada.Strings.Unbounded.Unbounded_String; 
  39.    type    Short_Ptr              is access all short; 
  40.    type    Long_Ptr               is access all long; 
  41.    type    Long_Long_Ptr          is access all Long_Long; 
  42.    type    Unsigned_Short_Ptr     is access all unsigned_short; 
  43.    type    Unsigned_Long_Ptr      is access all unsigned_long; 
  44.    type    Unsigned_Long_Long_Ptr is access all Unsigned_Long_Long; 
  45.    type    Float_Ptr              is access all Float; 
  46.    type    Double_Ptr             is access all Double; 
  47.    type    Long_Double_Ptr        is access all Long_Double; 
  48.    type    Char_Ptr               is access all Char; 
  49.    type    Wchar_Ptr              is access all Wchar; 
  50.    type    Octet_Ptr              is access all Octet; 
  51.    type    Boolean_Ptr            is access all Boolean; 
  52.    type    String_Ptr             is access all String; 
  53.    type    Wide_String_Ptr        is access all Wide_String; 
  54.  
  55.    --  and the deallocation method for each pointer type 
  56.  
  57.    procedure Deallocate is new Ada.Unchecked_Deallocation 
  58.      (short, Short_Ptr); 
  59.    procedure Deallocate is new Ada.Unchecked_Deallocation 
  60.      (long, Long_Ptr); 
  61.    procedure Deallocate is new Ada.Unchecked_Deallocation 
  62.      (Long_Long, Long_Long_Ptr); 
  63.    procedure Deallocate is new Ada.Unchecked_Deallocation 
  64.      (unsigned_short, Unsigned_Short_Ptr); 
  65.    procedure Deallocate is new Ada.Unchecked_Deallocation 
  66.      (unsigned_long, Unsigned_Long_Ptr); 
  67.    procedure Deallocate is new Ada.Unchecked_Deallocation 
  68.      (Unsigned_Long_Long, Unsigned_Long_Long_Ptr); 
  69.    procedure Deallocate is new Ada.Unchecked_Deallocation 
  70.      (Float, Float_Ptr); 
  71.    procedure Deallocate is new Ada.Unchecked_Deallocation 
  72.      (Double, Double_Ptr); 
  73.    procedure Deallocate is new Ada.Unchecked_Deallocation 
  74.      (Long_Double, Long_Double_Ptr); 
  75.    procedure Deallocate is new Ada.Unchecked_Deallocation 
  76.      (Char, Char_Ptr); 
  77.    procedure Deallocate is new Ada.Unchecked_Deallocation 
  78.      (Wchar, Wchar_Ptr); 
  79.    procedure Deallocate is new Ada.Unchecked_Deallocation 
  80.      (Octet, Octet_Ptr); 
  81.    procedure Deallocate is new Ada.Unchecked_Deallocation 
  82.      (Boolean, Boolean_Ptr); 
  83.    procedure Deallocate is new Ada.Unchecked_Deallocation 
  84.      (Wide_String, Wide_String_Ptr); 
  85.  
  86.    ----------------------------- 
  87.    -- Trimmed_Image functions -- 
  88.    ----------------------------- 
  89.  
  90.    --  The following return 'Image (X) without the leading space. The intent is 
  91.    --  that they are called with a type conversion (unless the type is already 
  92.    --  Long_Long or Unsigned_Long_Long). 
  93.  
  94.    function Trimmed_Image (X : Long_Long) return Standard.String; 
  95.    function Trimmed_Image (X : Unsigned_Long_Long) return Standard.String; 
  96.  
  97.    --------------------------------- 
  98.    -- String conversion functions -- 
  99.    --------------------------------- 
  100.  
  101.    function To_Rtidds_String (Source : Standard.String) return String; 
  102.    function To_Standard_String (Source : String) return Standard.String; 
  103.  
  104.    function To_Rtidds_Wide_String 
  105.      (Source : Standard.Wide_String) return Wide_String; 
  106.  
  107.    function To_Standard_Wide_String 
  108.      (Source : Wide_String) return Standard.Wide_String; 
  109.    type Bool is new Boolean; 
  110.    for Bool'Size use 32; 
  111.    RTI_BOOL_TRUE : constant Bool := True; 
  112.    RTI_BOOL_FALSE : constant Bool := False; 
  113. end RTIDDS.Types;