1. pragma Ada_2012; 
  2. --  (c) Copyright, Real-Time Innovations, $Date:: 2012-02-16 #$ 
  3. --  All rights reserved. 
  4. -- 
  5. --  No duplications, whole or partial, manual or electronic, may be made 
  6. --  without express written permission.  Any such copies, or 
  7. --  revisions thereof, must display this notice unaltered. 
  8. --  This code contains trade secrets of Real-Time Innovations, Inc. 
  9.  
  10.  
  11.  
  12. pragma Style_Checks ("NM32766"); 
  13.  
  14. with Ada.Unchecked_Conversion; 
  15. with DDS.Domain_Entity_Impl; 
  16. with DDS.Entity_Impl; 
  17. with DDS.Publisher; 
  18. limited with DDS.DomainParticipant; 
  19. with DDS.PublisherListener; 
  20. with DDS.Topic; 
  21. with DDS.DataWriter; 
  22. with DDS.DataWriterListener; 
  23.  
  24. with Ada.Unchecked_Deallocation; 
  25. with RTIDDS.Low_Level.ndds_reda_reda_worker_impl_h; 
  26. with RTIDDS.Low_Level.ndds_dds_c_dds_c_publication_h; use RTIDDS.Low_Level.ndds_dds_c_dds_c_publication_h; 
  27. with RTIDDS.Low_Level.ndds_dds_c_dds_c_infrastructure_h; use RTIDDS.Low_Level.ndds_dds_c_dds_c_infrastructure_h; 
  28.  
  29. package DDS.Publisher_Impl is 
  30.  
  31.    type Ref is limited new DDS.Domain_Entity_Impl.Ref and DDS.Publisher.Ref with null record; 
  32.    type Ref_Access is access all Ref'Class; 
  33.  
  34.    -- 
  35.  
  36.    function Create_DataWriter 
  37.      (Self       : not null access Ref; 
  38.       A_Topic    : not null DDS.Topic.Ref_Access; 
  39.       Qos        : in DDS.DataWriterQos; 
  40.       A_Listener : in DDS.DataWriterListener.Ref_Access; 
  41.       Mask       : in DDS.StatusMask) 
  42.      return DDS.DataWriter.Ref_Access; 
  43.  
  44.    function Create_DataWriter_With_Profile 
  45.      (Self         : not null access Ref; 
  46.       A_Topic    : not null DDS.Topic.Ref_Access; 
  47.       Library_Name : in DDS.String; 
  48.       profile_name : in DDS.String; 
  49.       A_Listener : in DDS.DataWriterListener.Ref_Access; 
  50.       Mask         : in DDS.StatusMask := STATUS_MASK_NONE) 
  51.       return DDS.DataWriter.Ref_Access; 
  52.  
  53.    function Create_DataWriter_With_Profile 
  54.      (Self         : not null access Ref; 
  55.       A_Topic    : in DDS.Topic.Ref_Access; 
  56.       Library_Name : in Standard.String; 
  57.       profile_name : in Standard.String; 
  58.       A_Listener : in DDS.DataWriterListener.Ref_Access; 
  59.       Mask         : in DDS.StatusMask := STATUS_MASK_NONE) 
  60.       return DDS.DataWriter.Ref_Access; 
  61.  
  62.  
  63.    procedure Delete_DataWriter 
  64.      (Self         : not null access Ref; 
  65.       A_DataWriter : in out DDS.DataWriter.Ref_Access); 
  66.  
  67.    function Lookup_DataWriter 
  68.      (Self       : not null access Ref; 
  69.       Topic_Name : in DDS.String_Ptr) 
  70.      return DDS.DataWriter.Ref_Access; 
  71.  
  72.    procedure Delete_Contained_Entities 
  73.      (Self : not null access Ref); 
  74.  
  75.    procedure Set_Qos 
  76.      (Self : not null access Ref; 
  77.       Qos  : in DDS.PublisherQos); 
  78.  
  79.    procedure Set_Qos_With_Profile 
  80.      (Self          : not null access Ref; 
  81.       library_name  : in String; 
  82.       profile_name  : in String); 
  83.  
  84.    procedure Set_Qos_With_Profile 
  85.      (Self          : not null access Ref; 
  86.       library_name  : in Standard.String; 
  87.       profile_name  : in Standard.String); 
  88.  
  89.    procedure Get_Qos 
  90.      (Self : not null access Ref; 
  91.       Qos  : in out DDS.PublisherQos); 
  92.  
  93.    procedure Set_Listener 
  94.      (Self       : not null access Ref; 
  95.       A_Listener : in DDS.PublisherListener.Ref_Access; 
  96.       Mask       : in DDS.StatusMask); 
  97.  
  98.    function Get_Listener 
  99.      (Self : not null access Ref) 
  100.       return DDS.PublisherListener.Ref_Access; 
  101.  
  102.    procedure Suspend_Publications 
  103.      (Self : not null access Ref); 
  104.  
  105.    procedure Resume_Publications 
  106.      (Self : not null access Ref); 
  107.  
  108.    procedure Begin_Coherent_Changes 
  109.      (Self : not null access Ref); 
  110.  
  111.    procedure End_Coherent_Changes 
  112.      (Self : not null access Ref); 
  113.  
  114.    procedure Wait_For_Acknowledgments 
  115.      (Self     : not null access Ref; 
  116.       Max_Wait : in DDS.Duration_T); 
  117.  
  118.    procedure Wait_For_Asynchronous_Publishing 
  119.      (Self     : not null  access Ref; 
  120.       Max_Wait : in DDS.Duration_T); 
  121.  
  122.    function Get_Participant 
  123.      (Self : not null access Ref) 
  124.       return access DDS.DomainParticipant.Ref'Class; 
  125.  
  126.    procedure Set_Default_DataWriter_Qos 
  127.      (Self : not null access Ref; 
  128.       Qos  : in DDS.DataWriterQos); 
  129.  
  130.    procedure Set_Default_DataWriter_Qos_With_Profile 
  131.      (Self     : not null access Ref; 
  132.       libName  : DDS.String; 
  133.       profName : DDS.String); 
  134.    procedure Set_Default_DataWriter_Qos_With_Profile 
  135.      (Self     : not null access Ref; 
  136.       libName  : Standard.String; 
  137.       profName : Standard.String); 
  138.  
  139.    procedure Get_Default_DataWriter_Qos 
  140.      (Self : not null access Ref; 
  141.       Qos  : in out DDS.DataWriterQos); 
  142.  
  143.    procedure Copy_From_Topic_Qos 
  144.      (Self             : not null access Ref; 
  145.       A_DataWriter_Qos : in out DDS.DataWriterQos; 
  146.       A_Topic_Qos      : in DDS.TopicQos); 
  147.  
  148.    procedure Set_Default_Profile 
  149.      (Self          : not null access Ref; 
  150.       library_name  : DDS.String; 
  151.       profile_name  : DDS.String); 
  152.  
  153.    procedure Set_Default_Library 
  154.      (Self          : not null access Ref; 
  155.       library_name   : DDS.String); 
  156.  
  157.    function Get_Default_Library 
  158.      (Self : not null access Ref) 
  159.       return DDS.String; 
  160.  
  161.    function Get_Default_Profile 
  162.      (Self : not null access Ref) 
  163.       return DDS.String; 
  164.  
  165.    function Get_Default_Profile_Library 
  166.      (Self : not null access Ref) 
  167.       return DDS.String; 
  168.  
  169.    -- Impl only 
  170.  
  171.    procedure Free (This : in out Ref_Access); 
  172.  
  173.    type DDS_Publisher_Access is access all DDS_Publisher with Storage_Size => 0; 
  174.    function CreateI (C_Participant : access DDS_DomainParticipant; 
  175.                      Qos           : in DDS.PublisherQos; 
  176.                      A_Listener    : in DDS.PublisherListener.Ref_Access; 
  177.                      Mask          : in DDS.StatusMask) 
  178.                      return DDS.Publisher.Ref_Access; 
  179.    function As_DDS_Entety_Access is new ada.Unchecked_Conversion(DDS_Publisher_Access,DDS.Entity_Impl.DDS_Entity_Access); 
  180.  
  181.    function Create_WrapperI (C_Publisher : in DDS_Publisher_Access) 
  182.                              return Ref_Access; 
  183.  
  184.    function Get_FacadeI (C_Publisher : DDS_Publisher_Access) 
  185.                         return Ref_Access; 
  186.  
  187.    procedure Finalize_Callback 
  188.      (arg1 : System.Address; 
  189.       arg2 : System.Address; 
  190.       arg3 : access RTIDDS.Low_Level.ndds_reda_reda_worker_impl_h.REDAWorker); 
  191.    pragma Convention (C, Finalize_Callback); 
  192.  
  193.  
  194.    function GetInterface (Self : not null access Ref) return DDS_Publisher_Access; 
  195.    procedure SetInterface (Self : not null access Ref; To : DDS_Publisher_Access); 
  196. private 
  197.  
  198.    procedure Free_Impl is new Ada.Unchecked_Deallocation (Ref'Class, Ref_Access); 
  199.    procedure Free_Mem (This : in out Ref_Access) renames Free_Impl; 
  200.  
  201. end DDS.Publisher_Impl;