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. with Ada.Unchecked_Conversion; 
  13. with DDS.Entity_Impl; 
  14. with DDS.Subscriber; 
  15. with DDS.DomainParticipant; 
  16. with DDS.SubscriberListener; 
  17. with DDS.DataReaderListener; 
  18. with DDS.Domain_Entity_Impl; 
  19. with DDS.DataReader; 
  20. with DDS.DataReaderSeq; 
  21. with DDS.TopicDescription; 
  22.  
  23. private with System; 
  24. private 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_subscription_h; 
  27. package DDS.Subscriber_Impl is 
  28.    use RTIDDS.Low_Level.ndds_dds_c_dds_c_subscription_h; 
  29.  
  30.    type Ref is new DDS.Domain_Entity_Impl.Ref and DDS.Subscriber.Ref with private; 
  31.    type Ref_Access is access all Ref'Class; 
  32.  
  33.    -- 
  34.  
  35.    function Create_DataReader 
  36.      (Self       : not null access Ref; 
  37.       Topic      : not null access DDS.TopicDescription.Ref'Class; 
  38.       Qos        : in DDS.DataReaderQoS; 
  39.       A_Listener : in DDS.DataReaderListener.Ref_Access; 
  40.       Mask       : in DDS.StatusMask) 
  41.       return DDS.DataReader.Ref_Access; 
  42.  
  43.    function Create_DataReader_With_Profile 
  44.      (Self         : not null access Ref; 
  45.       Topic        : not null access DDS.TopicDescription.Ref'Class; 
  46.       Library_Name : in DDS.String; 
  47.       profile_name : in DDS.String; 
  48.       A_Listener   : in DDS.DataReaderListener.Ref_Access := null; 
  49.       Mask         : in DDS.StatusMask := STATUS_MASK_NONE) 
  50.       return DDS.DataReader.Ref_Access; 
  51.    function Create_DataReader_With_Profile 
  52.      (Self         : not null access Ref; 
  53.       Topic        : not null access DDS.TopicDescription.Ref'Class; 
  54.       Library_Name : in Standard.String; 
  55.       profile_name : in Standard.String; 
  56.       A_Listener   : in DDS.DataReaderListener.Ref_Access := null; 
  57.       Mask         : in DDS.StatusMask := STATUS_MASK_NONE) 
  58.       return DDS.DataReader.Ref_Access; 
  59.  
  60.    procedure Delete_DataReader 
  61.      (Self         : not null access Ref; 
  62.       A_DataReader : in out DDS.DataReader.Ref_Access); 
  63.  
  64.    procedure Delete_Contained_Entities 
  65.      (Self : not null access Ref); 
  66.  
  67.    function Lookup_DataReader 
  68.      (Self       : not null access Ref; 
  69.       Topic_Name : in DDS.String) 
  70.       return DDS.DataReader.Ref_Access; 
  71.  
  72.    procedure Get_DataReaders 
  73.      (Self            : not null access Ref; 
  74.       Readers         : not null access DDS.DataReaderSeq.Sequence; 
  75.       Sample_States   : in DDS.SampleStateKind; 
  76.       View_States     : in DDS.ViewStateKind; 
  77.       Instance_States : in DDS.InstanceStateKind); 
  78.  
  79.    procedure Notify_DataReaders 
  80.      (Self : not null access Ref); 
  81.  
  82.    procedure Set_Qos 
  83.      (Self : not null access Ref; 
  84.       Qos  : in DDS.SubscriberQos); 
  85.  
  86.    procedure Set_Qos_With_Profile 
  87.      (Self          : not null access Ref; 
  88.       library_name  : in String; 
  89.       profile_name  : in String); 
  90.    procedure Set_Qos_With_Profile 
  91.      (Self          : not null access Ref; 
  92.       library_name  : in Standard.String; 
  93.       profile_name  : in Standard.String); 
  94.  
  95.    procedure Get_Qos 
  96.      (Self : not null access Ref; 
  97.       Qos  : in out DDS.SubscriberQos); 
  98.  
  99.    procedure Set_Listener 
  100.      (Self       : not null access Ref; 
  101.       A_Listener : DDS.SubscriberListener.Ref_Access; 
  102.       Mask       : in DDS.StatusKind); 
  103.  
  104.    function Get_Listener 
  105.      (Self : not null access Ref) 
  106.       return DDS.SubscriberListener.Ref_Access; 
  107.  
  108.    procedure Begin_Access 
  109.      (Self : not null access Ref); 
  110.  
  111.    procedure End_Access 
  112.      (Self : not null access Ref); 
  113.  
  114.    function Get_Participant 
  115.      (Self : not null access Ref) 
  116.       return access DDS.DomainParticipant.Ref'Class; 
  117.  
  118.    procedure Set_Default_DataReader_Qos 
  119.      (Self : not null access Ref; 
  120.       Qos  : in DDS.DataReaderQoS); 
  121.  
  122.    procedure Set_Default_DataReader_Qos_With_Profile 
  123.      (Self     : not null access Ref; 
  124.       libName  : DDS.String; 
  125.       profName : DDS.String); 
  126.    procedure Set_Default_DataReader_Qos_With_Profile 
  127.      (Self     : not null access Ref; 
  128.       libName  : Standard.String; 
  129.       profName : Standard.String); 
  130.  
  131.    procedure Get_Default_DataReader_Qos 
  132.      (Self  : not null access Ref; 
  133.       Qos   : in out DDS.DataReaderQoS); 
  134.  
  135.    procedure Copy_From_Topic_Qos 
  136.      (Self             : not null access Ref; 
  137.       A_DataReader_Qos : in out DDS.DataReaderQoS; 
  138.       A_Topic_Qos      : in DDS.TopicQos); 
  139.  
  140.    procedure Set_Default_Profile 
  141.      (Self          : not null access Ref; 
  142.       library_name  : DDS.String; 
  143.       profile_name  : DDS.String); 
  144.  
  145.    procedure Set_Default_Library 
  146.      (Self          : not null access Ref; 
  147.       library_name   : DDS.String); 
  148.  
  149.    function Get_Default_Library 
  150.      (Self : not null access Ref) 
  151.       return DDS.String; 
  152.  
  153.    function Get_Default_Profile 
  154.      (Self : not null access Ref) 
  155.       return DDS.String; 
  156.  
  157.    function Get_Default_Profile_Library 
  158.      (Self : not null access Ref) 
  159.       return DDS.String; 
  160.  
  161.    procedure Free (This : in out Ref_Access); 
  162.    type DDS_Subscriber_Access is access all DDS_Subscriber with Storage_Size => 0; 
  163.  
  164.    function CreateI 
  165.      (Participant : in not null DDS.DomainParticipant.Ref_Access; 
  166.       Qos         : in DDS.SubscriberQos; 
  167.       A_Listener  : in DDS.SubscriberListener.Ref_Access; 
  168.       Mask        : in DDS.StatusMask) 
  169.      return DDS.Subscriber.Ref_Access; 
  170.  
  171.    function Create_WrapperI 
  172.      (C_Subscriber : not null DDS_Subscriber_Access) 
  173.      return DDS.Subscriber_Impl.Ref_Access; 
  174.  
  175.    function Get_FacadeI (C_Subscriber :  not null DDS_Subscriber_Access) 
  176.                          return Ref_Access; 
  177.  
  178.    procedure Finalize_Callback 
  179.      (arg1 : System.Address; 
  180.       arg2 : System.Address; 
  181.       arg3 : access RTIDDS.Low_Level.ndds_reda_reda_worker_impl_h.REDAWorker); 
  182.    pragma Convention (C, Finalize_Callback); 
  183.  
  184.    function As_DDS_Entity_access is new Ada.Unchecked_Conversion (DDS_Subscriber_Access, DDS.Entity_Impl.DDS_Entity_Access); 
  185.    function GetInterface (Self : not null access Ref) return DDS_Subscriber_Access; 
  186.    procedure SetInterface (Self : not null access Ref; To : DDS_Subscriber_Access); 
  187.  
  188.    procedure  call_listener (Self  : not null access Ref; 
  189.                              mask  : StatusMask); 
  190.  
  191.  
  192. private 
  193.  
  194.    type Ref is new DDS.Domain_Entity_Impl.Ref and DDS.Subscriber.Ref with record 
  195.       Participant : DDS.DomainParticipant.Ref_Access; 
  196.    end record; 
  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.Subscriber_Impl;