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