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