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