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.DataReader; 
  12. with DDS.Domain_Entity_Impl; 
  13. with DDS.Subscriber; 
  14. with DDS.Topic; 
  15. with DDS.TopicDescription; 
  16. with DDS.DataReaderListener; 
  17. with DDS.QueryCondition; 
  18. with DDS.ReadCondition; 
  19.  
  20. with System; 
  21. with RTIDDS.Low_Level.reda.worker_impl_h; 
  22. with RTIDDS.Low_Level.dds_c.infrastructure_h; use RTIDDS.Low_Level.dds_c.infrastructure_h; 
  23.  
  24. package DDS.DataReader_Impl is 
  25.  
  26.    type Ref is new DDS.Domain_Entity_Impl.Ref and DDS.DataReader.Ref with private; 
  27.    type Ref_Access is access all Ref'Class; 
  28.  
  29.    function Create_Readcondition 
  30.      (Self            : not null access Ref; 
  31.       Sample_States   : in DDS.SampleStateMask; 
  32.       View_States     : in DDS.ViewStateMask; 
  33.       Instance_States : in DDS.InstanceStateMask) 
  34.       return DDS.ReadCondition.Ref_Access; 
  35.  
  36.    function Create_Querycondition 
  37.      (Self             : not null access Ref; 
  38.       Sample_States    : in DDS.SampleStateMask; 
  39.       View_States      : in DDS.ViewStateMask; 
  40.       Instance_States  : in DDS.InstanceStateMask; 
  41.       Query_Expression : in DDS.String; 
  42.       Query_Parameters : in DDS.String_Seq.Sequence) 
  43.       return DDS.QueryCondition.Ref_Access; 
  44.  
  45.    procedure Delete_Readcondition 
  46.      (Self        : not null access Ref; 
  47.       A_Condition : access DDS.ReadCondition.Ref'Class); 
  48.  
  49.    procedure  Delete_Contained_Entities 
  50.      (Self : not null access Ref); 
  51.    --  Deletes all the entities that were created by means of the "create" operations on the DDS_DataReader. 
  52.    --  Deletes all contained DDS_ReadCondition and DDS_QueryCondition objects. 
  53.    --  Once DDS_DataReader_delete_contained_entities returns successfully, 
  54.    --  the application may delete the DDS_DataReader, knowing that it has no contained 
  55.    --- DDS_ReadCondition and DDS_QueryCondition objects. 
  56.    --      rasies exception on error 
  57.  
  58.    procedure Set_Qos 
  59.      (Self : not null access Ref; 
  60.       Qos  : in DDS.DataReaderQoS); 
  61.  
  62.    procedure Set_Qos_With_Profile 
  63.      (Self          : not null access Ref; 
  64.       Library_Name  : in String; 
  65.       Profile_Name  : in String); 
  66.    procedure Set_Qos_With_Profile 
  67.      (Self          : not null access Ref; 
  68.       Library_Name  : in Standard.String; 
  69.       Profile_Name  : in Standard.String); 
  70.  
  71.    procedure Get_Qos 
  72.      (Self : not null access Ref; 
  73.       Qos  : in out DDS.DataReaderQoS); 
  74.  
  75.    procedure Set_Listener 
  76.      (Self       : not null access Ref; 
  77.       A_Listener : in DDS.DataReaderListener.Ref_Access; 
  78.       Mask       : in DDS.StatusMask); 
  79.  
  80.    function Get_Listener 
  81.      (Self : not null access Ref) 
  82.       return DDS.DataReaderListener.Ref_Access; 
  83.  
  84.    procedure Call_ListnerT 
  85.      (Self       : not null access Ref; 
  86.       A_Listener : in DDS.DataReaderListener.Ref_Access; 
  87.       Mask       : in DDS.StatusMask); 
  88.  
  89.    function Get_Topicdescription 
  90.      (Self : not null access Ref) 
  91.       return DDS.TopicDescription.Ref_Access; 
  92.  
  93.    function Get_Subscriber 
  94.      (Self : not null access Ref) 
  95.       return access DDS.Subscriber.Ref'Class; 
  96.  
  97.    procedure Get_Sample_Rejected_Status 
  98.      (Self   : not null access Ref; 
  99.       Status : in out DDS.SampleRejectedStatus); 
  100.  
  101.    procedure Get_Liveliness_Changed_Status 
  102.      (Self   : not null access Ref; 
  103.       Status : in out DDS.LivelinessChangedStatus); 
  104.  
  105.    procedure Get_Requested_Deadline_Missed_Status 
  106.      (Self   : not null access Ref; 
  107.       Status : in out DDS.RequestedDeadlineMissedStatus); 
  108.  
  109.    procedure Get_Requested_Incompatible_Qos_Status 
  110.      (Self   : not null access Ref; 
  111.       Status : in out DDS.RequestedIncompatibleQosStatus); 
  112.  
  113.    procedure Get_Subscription_Matched_Status 
  114.      (Self   : not null access Ref; 
  115.       Status : in out DDS.SubscriptionMatchedStatus); 
  116.  
  117.    procedure Get_Sample_Lost_Status 
  118.      (Self   : not null access Ref; 
  119.       Status : in out DDS.SampleLostStatus); 
  120.  
  121.    procedure Get_Datareader_Cache_Status 
  122.      (Self   : not null access Ref; 
  123.       Status : in out DDS.DataReaderCacheStatus); 
  124.  
  125.    procedure Get_Datareader_Protocol_Status 
  126.      (Self   : not null access Ref; 
  127.       Status : in out DDS.DataReaderProtocolStatus); 
  128.  
  129.    procedure Get_Matched_Publication_Datareader_Protocol_Status 
  130.      (Self               : not null access Ref; 
  131.       Status             : in out DDS.DataReaderProtocolStatus; 
  132.       Publication_Handle : not null access DDS.InstanceHandle_T); 
  133.  
  134.    procedure Wait_For_Historical_Data 
  135.      (Self     : not null access Ref; 
  136.       Max_Wait : in DDS.Duration_T); 
  137.  
  138.    function Get_Matched_Publications 
  139.      (Self                : not null access Ref) 
  140.       return DDS.InstanceHandle_Seq.Sequence; 
  141.  
  142.    function Get_Matched_Publication_Data 
  143.      (Self               : not null access Ref; 
  144.       Publication_Handle : not null access DDS.InstanceHandle_T) 
  145.       return DDS.PublicationBuiltinTopicData; 
  146.  
  147.    procedure Free (This : in out Ref_Access); 
  148.  
  149.    function CreateI (Subscriber : not null DDS.Subscriber.Ref_Access; 
  150.                      Topic      : not null access DDS.TopicDescription.Ref'Class; 
  151.                      Qos        : in DDS.DataReaderQoS; 
  152.                      Listener   : in DDS.DataReaderListener.Ref_Access; 
  153.                      Mask       : in DDS.StatusMask) 
  154.                      return DDS.DataReader.Ref_Access; 
  155.  
  156.    function CreateI (Subscriber   : not null DDS.Subscriber.Ref_Access; 
  157.                      Topic        : not null access DDS.TopicDescription.Ref'Class; 
  158.                      Library_Name : in DDS.String; 
  159.                      Profile_Name : in DDS.String; 
  160.                      Listener     : in DDS.DataReaderListener.Ref_Access; 
  161.                      Mask         : in DDS.StatusMask) 
  162.                      return DDS.DataReader.Ref_Access; 
  163.  
  164.    function Create_WrapperI (Subscriber   : not null DDS.Subscriber.Ref_Access; 
  165.                              C_DataReader : System.Address; 
  166.                              Topic        : not null access DDS.Topic.Ref'Class) 
  167.                              return Ref_Access; 
  168.  
  169.    function Get_FacadeI (C_DataReader : System.Address) 
  170.                          return Ref_Access; 
  171.  
  172.  
  173.    procedure Read_Or_Take_UntypedI 
  174.      (Self                                : not null access Ref; 
  175.       Is_Loan                             : out DDS.Boolean; 
  176.       Received_Data                       : System.Address; 
  177.       Data_Count                          : out Natural; 
  178.       Info_Seq                            : SampleInfo_Seq.Sequence_Access; 
  179.       Data_Seq_Len                        : Long_Integer; 
  180.       Data_Seq_Max_Len                    : Long_Integer; 
  181.       Data_Seq_Has_Ownership              : Long_Integer; 
  182.       Data_Seq_Contiguous_Buffer_For_Copy : System.Address; 
  183.       Data_Size                           : Integer; 
  184.       Max_Samples                         : Long_Integer; 
  185.       Sample_States                       : SampleStateMask; 
  186.       View_States                         : ViewStateMask; 
  187.       Instance_States                     : InstanceStateMask; 
  188.       Take                                : DDS.Boolean); 
  189.    function Read_Or_Take_UntypedI 
  190.      (Self                                : not null access Ref; 
  191.       Is_Loan                             : access DDS.Boolean; 
  192.       Received_Data                       : System.Address; 
  193.       Data_Count                          : access Natural; 
  194.       Info_Seq                            : SampleInfo_Seq.Sequence_Access; 
  195.       Data_Seq_Len                        : Long_Integer; 
  196.       Data_Seq_Max_Len                    : Long_Integer; 
  197.       Data_Seq_Has_Ownership              : Long_Integer; 
  198.       Data_Seq_Contiguous_Buffer_For_Copy : System.Address; 
  199.       Data_Size                           : Integer; 
  200.       Max_Samples                         : Long_Integer; 
  201.       Sample_States                       : SampleStateMask; 
  202.       View_States                         : ViewStateMask; 
  203.       Instance_States                     : InstanceStateMask; 
  204.       Take                                : DDS.Boolean) return DDS_ReturnCode_t; 
  205.  
  206.  
  207.    procedure ReadI 
  208.      (Self            : not null access Ref; 
  209.       Received_Data   : System.Address; 
  210.       Info_Seq        : not null access Standard.DDS.SampleInfo_Seq.Sequence; 
  211.       Max_Samples     : in Standard.DDS.Long := Standard.DDS.LENGTH_UNLIMITED; 
  212.       Sample_States   : in Standard.DDS.SampleStateMask := Standard.DDS.ANY_SAMPLE_STATE; 
  213.       View_States     : in Standard.DDS.ViewStateMask := Standard.DDS.ANY_VIEW_STATE; 
  214.       Instance_States : in Standard.DDS.InstanceStateMask := Standard.DDS.ANY_INSTANCE_STATE); 
  215.  
  216.    procedure TakeI 
  217.      (Self            : not null access Ref; 
  218.       Received_Data   : System.Address; 
  219.       Info_Seq        : not null access Standard.DDS.SampleInfo_Seq.Sequence; 
  220.       Max_Samples     : in Standard.DDS.Long := Standard.DDS.LENGTH_UNLIMITED; 
  221.       Sample_States   : in Standard.DDS.SampleStateMask := Standard.DDS.ANY_SAMPLE_STATE; 
  222.       View_States     : in Standard.DDS.ViewStateMask := Standard.DDS.ANY_VIEW_STATE; 
  223.       Instance_States : in Standard.DDS.InstanceStateMask := Standard.DDS.ANY_INSTANCE_STATE); 
  224.  
  225.    procedure Read_W_Condition 
  226.      (Self          : not null access Ref; 
  227.       Received_Data : System.Address; 
  228.       Info_Seq      : not null access Standard.DDS.SampleInfo_Seq.Sequence; 
  229.       Max_Samples   : in Standard.DDS.Long := Standard.DDS.LENGTH_UNLIMITED; 
  230.       Condition     : access Standard.DDS.ReadCondition.Ref'Class); 
  231.  
  232.  
  233.  
  234.    procedure Take_W_Condition 
  235.      (Self          : not null access Ref; 
  236.       Received_Data : System.Address; 
  237.       Info_Seq      : not null access Standard.DDS.SampleInfo_Seq.Sequence; 
  238.       Max_Samples   : in Standard.DDS.Long := Standard.DDS.LENGTH_UNLIMITED; 
  239.       Condition     : access Standard.DDS.ReadCondition.Ref'Class); 
  240.  
  241.  
  242.    procedure Read_Next_Sample 
  243.      (Self          : not null access Ref; 
  244.       Received_Data : System.Address; 
  245.       Sample_Info   : not null access Standard.DDS.SampleInfo); 
  246.  
  247.  
  248.    procedure Take_Next_Sample 
  249.      (Self          : not null access Ref; 
  250.       Received_Data : System.Address; 
  251.       Sample_Info   : not null access Standard.DDS.SampleInfo); 
  252.  
  253.  
  254.    procedure Read_Instance 
  255.      (Self            : not null access Ref; 
  256.       Received_Data   : System.Address; 
  257.       Info_Seq        : not null access Standard.DDS.SampleInfo_Seq.Sequence; 
  258.       Max_Samples     : in Standard.DDS.Long := Standard.DDS.LENGTH_UNLIMITED; 
  259.       A_Handle        : access constant Standard.DDS.InstanceHandle_T; 
  260.       Sample_States   : in Standard.DDS.SampleStateMask := Standard.DDS.ANY_SAMPLE_STATE; 
  261.       View_States     : in Standard.DDS.ViewStateMask := Standard.DDS.ANY_VIEW_STATE; 
  262.       Instance_States : in Standard.DDS.InstanceStateMask := Standard.DDS.ANY_INSTANCE_STATE); 
  263.  
  264.  
  265.    procedure Take_Instance 
  266.      (Self            : not null access Ref; 
  267.       Received_Data   : System.Address; 
  268.       Info_Seq        : not null access Standard.DDS.SampleInfo_Seq.Sequence; 
  269.       Max_Samples     : in Standard.DDS.Long := Standard.DDS.LENGTH_UNLIMITED; 
  270.       A_Handle        : access constant Standard.DDS.InstanceHandle_T; 
  271.       Sample_States   : in Standard.DDS.SampleStateMask := Standard.DDS.ANY_SAMPLE_STATE; 
  272.       View_States     : in Standard.DDS.ViewStateMask := Standard.DDS.ANY_VIEW_STATE; 
  273.       Instance_States : in Standard.DDS.InstanceStateMask := Standard.DDS.ANY_INSTANCE_STATE); 
  274.  
  275.  
  276.    procedure Read_Next_Instance 
  277.      (Self            : not null access Ref; 
  278.       Received_Data   : System.Address; 
  279.       Info_Seq        : not null access Standard.DDS.SampleInfo_Seq.Sequence; 
  280.       Max_Samples     : in Standard.DDS.Long := Standard.DDS.LENGTH_UNLIMITED; 
  281.       Previous_Handle : access constant Standard.DDS.InstanceHandle_T; 
  282.       Sample_States   : in Standard.DDS.SampleStateMask := Standard.DDS.ANY_SAMPLE_STATE; 
  283.       View_States     : in Standard.DDS.ViewStateMask := Standard.DDS.ANY_VIEW_STATE; 
  284.       Instance_States : in Standard.DDS.InstanceStateMask := Standard.DDS.ANY_INSTANCE_STATE); 
  285.  
  286.  
  287.    procedure Take_Next_Instance 
  288.      (Self            : not null access Ref; 
  289.       Received_Data   : System.Address; 
  290.       Info_Seq        : not null access Standard.DDS.SampleInfo_Seq.Sequence; 
  291.       Max_Samples     : in Standard.DDS.Long := Standard.DDS.LENGTH_UNLIMITED; 
  292.       Previous_Handle : access constant Standard.DDS.InstanceHandle_T; 
  293.       Sample_States   : in Standard.DDS.SampleStateMask := Standard.DDS.ANY_SAMPLE_STATE; 
  294.       View_States     : in Standard.DDS.ViewStateMask := Standard.DDS.ANY_VIEW_STATE; 
  295.       Instance_States : in Standard.DDS.InstanceStateMask := Standard.DDS.ANY_INSTANCE_STATE); 
  296.  
  297.  
  298.  
  299.    procedure Read_Next_Instance_W_Condition 
  300.      (Self            : not null access Ref; 
  301.       Received_Data   : System.Address; 
  302.       Info_Seq        : not null access Standard.DDS.SampleInfo_Seq.Sequence; 
  303.       Max_Samples     : in Standard.DDS.Long := Standard.DDS.LENGTH_UNLIMITED; 
  304.       Previous_Handle : access constant Standard.DDS.InstanceHandle_T; 
  305.       Condition       : Standard.DDS.ReadCondition.Ref_Access); 
  306.  
  307.  
  308.  
  309.    procedure Take_Next_Instance_W_Condition 
  310.      (Self            : not null access Ref; 
  311.       Received_Data   : System.Address; 
  312.       Info_Seq        : not null access Standard.DDS.SampleInfo_Seq.Sequence; 
  313.       Max_Samples     : in Standard.DDS.Long := Standard.DDS.LENGTH_UNLIMITED; 
  314.       Previous_Handle : access constant Standard.DDS.InstanceHandle_T; 
  315.       Condition       : Standard.DDS.ReadCondition.Ref_Access); 
  316.  
  317.  
  318.  
  319.    procedure Return_Loan 
  320.      (Self          : not null access Ref; 
  321.       Received_Data : System.Address; 
  322.       Info_Seq      : not null access Standard.DDS.SampleInfo_Seq.Sequence); 
  323.  
  324.  
  325.    procedure Get_Key_Value 
  326.      (Self       : not null access Ref; 
  327.       Key_Holder : System.Address; 
  328.       Handle     : access constant Standard.DDS.InstanceHandle_T); 
  329.  
  330.  
  331.    function Lookup_Instance 
  332.      (Self       : not null access Ref; 
  333.       Key_Holder : System.Address) return Standard.DDS.InstanceHandle_T; 
  334.  
  335.    procedure Finalize_Callback 
  336.      (Arg1 : System.Address; 
  337.       Arg2 : System.Address; 
  338.       Arg3 : access RTIDDS.Low_Level.reda.worker_impl_h.REDAWorker); 
  339.    pragma Convention (C, Finalize_Callback); 
  340.  
  341. private 
  342.  
  343.    type Ref is new DDS.Domain_Entity_Impl.Ref and DDS.DataReader.Ref with null record; 
  344.  
  345.    procedure Free_Impl is new Ada.Unchecked_Deallocation (Ref'Class, Ref_Access); 
  346.    procedure Free (This : in out Ref_Access) renames Free_Impl; 
  347.  
  348.  
  349. end DDS.DataReader_Impl;