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