1. --  (c) Copyright, Real-Time Innovations, $Date:: 2012-02-16 #$ 
  2. --  All rights reserved. 
  3. -- 
  4. --  No duplications, whole or partial, manual or electronic, may be made 
  5. --  without express written permission.  Any such copies, or 
  6. --  revisions thereof, must display this notice unaltered. 
  7. --  This code contains trade secrets of Real-Time Innovations, Inc. 
  8.  
  9. with DDS; 
  10. with DDS.DomainParticipant; 
  11. with DDS.TypeSupport; 
  12. with DDS.DataReader; 
  13. with DDS.DataWriter; 
  14. with Ada.Unchecked_Conversion; 
  15. with Interfaces.C.Pointers; 
  16. with Interfaces.C; 
  17.  
  18. --  <defgroup>OctetsBuiltInTypeGroupDocs</defgroup> 
  19. --  <dref>OctetsTypeSupport</dref> 
  20. package DDS.Builtin_Octets_TypeSupport is 
  21.  
  22.    type Ref is new Standard.DDS.TypeSupport.Ref with null record; 
  23.    type Ref_Access is access all Ref'Class; 
  24.  
  25.    function Create_TypedDataReaderI 
  26.      (Self : access Ref) return Standard.DDS.DataReader.Ref_Access; 
  27.  
  28.    procedure Destroy_TypedDataReaderI 
  29.      (Self   : access Ref; 
  30.       Reader : in out Standard.DDS.DataReader.Ref_Access); 
  31.  
  32.    function Create_TypedDataWriterI 
  33.      (Self : access Ref) return Standard.DDS.DataWriter.Ref_Access; 
  34.  
  35.    procedure Destroy_TypedDataWriterI 
  36.      (Self   : access Ref; 
  37.       Writer : in out Standard.DDS.DataWriter.Ref_Access) is null; 
  38.  
  39.    --  <internal> 
  40.    --  static methods 
  41.    --  </internal> 
  42.  
  43.    procedure Register_Type 
  44.      (Participant : not null access Standard.DDS.DomainParticipant.Ref'Class; 
  45.       Type_Name   : in Standard.DDS.String); 
  46.    --  <dref>OctetsTypeSupport_register_type</dref> 
  47.  
  48.    procedure Unregister_Type 
  49.      (Participant : not null access Standard.DDS.DomainParticipant.Ref'Class; 
  50.       Type_Name   : in Standard.DDS.String); 
  51.    --  <dref>OctetsTypeSupport_unregister_type</dref> 
  52.  
  53.    function Get_Type_Name return Standard.DDS.String; 
  54.    --  <dref>OctetsTypeSupport_get_type_name</dref> 
  55.  
  56.    procedure Get_Type_Name (name : out Standard.DDS.String); 
  57.  
  58.    procedure Print_Data (A_Data : access DDS.Octets); 
  59.    --  <dref>OctetsTypeSupport_print_data</dref> 
  60.  
  61.    function Create_Data_W_Size 
  62.      (size : Integer) 
  63.       return DDS.Octets_Ptr; 
  64.  
  65.    procedure Initialize_Data_W_Size 
  66.      (a_data : access DDS.Octets; 
  67.       size   : Integer); 
  68.  
  69.    function From_Octets_To_Octet_Array 
  70.      (octets : DDS.Octets) 
  71.       return DDS.Octet_Array; 
  72.  
  73.    function Get_Octet 
  74.      (octets : DDS.Octets; 
  75.       index  : Integer) 
  76.      return Interfaces.Unsigned_8; 
  77.  
  78.    --  <internal> 
  79.    --  Methods to translate from low to high level and backward 
  80.    --  </internal> 
  81.  
  82.    package Octet_Pointer is new Interfaces.C.Pointers 
  83.      (Natural, 
  84.       DDS.Octet, 
  85.       DDS.Octet_Array, 
  86.       0); 
  87.  
  88.    type Octet_Access is access all Interfaces.Unsigned_8; 
  89.    function convertToAccess is new Ada.Unchecked_Conversion (System.Address, Octet_Access); 
  90.    function convertToPointer is new Ada.Unchecked_Conversion (Octet_Access, Octet_Pointer.Pointer); 
  91.    function ConvertToPointerDiff  (Source : Integer) return Interfaces.C.Ptrdiff_T; 
  92.    pragma Inline (ConvertToPointerDiff); 
  93.  
  94. end DDS.Builtin_Octets_TypeSupport;