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. limited with DDS.Subscriber; 
  13. with DDS.TopicDescription; 
  14. with DDS.DataReaderListener; 
  15. with DDS.QueryCondition; 
  16. with DDS.ReadCondition; 
  17. with DDS.Domain_Entity; 
  18. with DDS.IndexCondition; 
  19. --  <dref>DataReader</dref> 
  20. package DDS.DataReader is 
  21.  
  22.    type Ref is limited interface and DDS.Domain_Entity.Ref; 
  23.    type Ref_Access is access all Ref'Class; 
  24.  
  25.    --  Allows the application to: 
  26.    --   (1) declare the data it wishes to receive (i.e. make a subscription) and 
  27.    --   (2) access the data received by the attached DDS.Subscriber. 
  28.    -- 
  29.    --  A DDS.DataReader refers to exactly one DDS.TopicDescription 
  30.    --  (either a DDS.Topic, a DDS.ContentFilteredTopic or a DDS.MultiTopic) 
  31.    --  that identifies the data to be read. 
  32.    --  The subscription has a unique resulting type. The data-reader may give 
  33.    --  access to several instances of the resulting type, 
  34.    --  which can be distinguished from each other by their key. 
  35.    -- 
  36.    --  DDS.DataReader is an abstract class. 
  37.    --  It must be specialised for each particular application data-type 
  38.    --  (see USER_DATA). The additional methods or functions that must be defined 
  39.    --  in the auto-generated class for a hypothetical application type Foo are 
  40.    --  specified in the generic type DDS.example.FooDataReader. 
  41.    -- 
  42.    --  The following operations may be called even if the DDS.DataReader 
  43.    --  is not enabled. Other operations will fail with 
  44.    --  exception RETCODE_NOT_ENABLED if called on a disabled DDS.DataReader: 
  45.    -- 
  46.    --  See also: 
  47.    --      Operations Allowed in Listener Callbacks 
  48.  
  49.    type Ref_Access_Access is access all Ref_Access; 
  50.    type Ref_Access_Array is array (Natural range <>) of aliased Ref_Access; 
  51.  
  52.    procedure Initialize 
  53.      (Self : in out Ref_Access) is null; 
  54.  
  55.    procedure Finalize 
  56.      (Self : in out Ref_Access) is null; 
  57.  
  58.    procedure Copy 
  59.      (Dst : in out Ref_Access; 
  60.       Src : in Ref_Access); 
  61.  
  62.    function Create_Readcondition 
  63.      (Self            : not null access Ref; 
  64.       Sample_States   : in DDS.SampleStateMask; 
  65.       View_States     : in DDS.ViewStateMask; 
  66.       Instance_States : in DDS.InstanceStateMask) 
  67.       return DDS.ReadCondition.Ref_Access is abstract; 
  68.    --  <dref>DataReader_create_readcondition</dref> 
  69.    --  <internal> 
  70.    --  The returned DDS.ReadCondition will be 
  71.    --  attached and belong to the DDS.DataReader. 
  72.    --  </internal> 
  73.  
  74.    function Create_Querycondition 
  75.      (Self             : not null access Ref; 
  76.       Sample_States    : in DDS.SampleStateMask; 
  77.       View_States      : in DDS.ViewStateMask; 
  78.       Instance_States  : in DDS.InstanceStateMask; 
  79.       Query_Expression : in DDS.String; 
  80.       Query_Parameters : in DDS.String_Seq.Sequence) 
  81.       return DDS.QueryCondition.Ref_Access is abstract; 
  82.    --  <dref>DataReader_create_querycondition</dref> 
  83.    --  <internal> 
  84.    --  Not supported (optional>> Creates a DDS.QueryCondition. 
  85.    --  The returned DDS.QueryCondition will be attached 
  86.    --  and belong to the DDS.DataReader. 
  87.    --  Queries and Filters Syntax describes the syntax of 
  88.    --  query_expression and query_parameter 
  89.    --  </internal> 
  90.  
  91.    function Create_IndexCondition 
  92.      (Self            : not null access Ref; 
  93.       Index_Name      : in DDS.String; 
  94.       Sample_State    : in DDS.SampleStateMask; 
  95.       view_state      : in DDS.ViewStateMask; 
  96.       instance_state  : in DDS.InstanceStateMask; 
  97.       Sample_Info     : in DDS.SampleInfo) 
  98.       return DDS.IndexCondition.Ref_Access is abstract; 
  99.  
  100.    procedure Delete_Readcondition 
  101.      (Self        : not null access Ref; 
  102.       A_Condition : access DDS.ReadCondition.Ref'Class) is abstract; 
  103.    --  <dref>DataReader_delete_readcondition</dref> 
  104.  
  105.    procedure  Delete_Contained_Entities 
  106.      (Self : not null access Ref) is abstract; 
  107.    --  <dref>DataReader_delete_contained_entities</dref> 
  108.    --  <internal> 
  109.    --  Deletes all the entities that were created by means of the "create" 
  110.    --  operations on the dds.DataReader. 
  111.    --  Deletes all contained dds.ReadCondition and dds.QueryCondition objects. 
  112.    --  The operation will fail with RETCODE_PRECONDITION_NOT_MET if the any of 
  113.    --  the contained entities is in a state where it cannot be deleted. 
  114.    --  Once dds.DataReader.delete_contained_entities completes successfully, 
  115.    --  the application may delete the dds.DataReader, knowing that it has no 
  116.    --  contained dds.ReadCondition and dds.QueryCondition objects. 
  117.    --  </internal> 
  118.  
  119.    procedure Set_Qos 
  120.      (Self : not null access Ref; 
  121.       Qos  : in DDS.DataReaderQoS) is abstract; 
  122.    --  <dref>DataReader_set_qos</dref> 
  123.  
  124.    procedure Set_Qos_With_Profile 
  125.      (Self          : not null access Ref; 
  126.       library_name  : in String; 
  127.       profile_name  : in String) is abstract; 
  128.    procedure Set_Qos_With_Profile 
  129.      (Self          : not null access Ref; 
  130.       library_name  : in Standard.String; 
  131.       profile_name  : in Standard.String) is abstract; 
  132.    --  <dref>DataReader_set_qos_with_profile</dref> 
  133.    --  <internal> 
  134.    --  This operation modifies the QoS of the DDS.DataReader. 
  135.    --  The DataReaderQos.user_data, 
  136.    --      DataReaderQos.deadline, 
  137.    --      DataReaderQos.latency_budget, 
  138.    --      DataReaderQos.time_based_filter, 
  139.    --      DataReaderQos.reader_data_lifecycle 
  140.    --  can be changed. 
  141.    --  The other policies are immutable. 
  142.    --  </internal> 
  143.  
  144.  
  145.    procedure Get_Qos 
  146.      (Self : not null access Ref; 
  147.       Qos  : in out DDS.DataReaderQoS) is abstract; 
  148.    --  <dref>DataReader_get_qos</dref> 
  149.    --  <internal> 
  150.    --  Gets the reader QoS. 
  151.    --  This method may potentially allocate memory depending on the sequences 
  152.    --  contained in some QoS policies 
  153.    --  </internal> 
  154.  
  155.  
  156.    procedure Set_Listener 
  157.      (Self       : not null access Ref; 
  158.       A_Listener : in DDS.DataReaderListener.Ref_Access; 
  159.       Mask       : in DDS.StatusMask) is abstract; 
  160.    --  <dref>DataReader_set_listener</dref> 
  161.    --  <internal> 
  162.    --  Sets the reader listener. 
  163.    --  </internal> 
  164.  
  165.  
  166.    function Get_Listener 
  167.      (Self : not null access Ref) 
  168.       return DDS.DataReaderListener.Ref_Access is abstract; 
  169.    --  <dref>DataReader_get_listener</dref> 
  170.    --  <internal> 
  171.    --  Get the reader listener 
  172.    --  </internal> 
  173.  
  174.    procedure Call_ListnerT 
  175.      (Self       : not null access Ref; 
  176.       A_Listener : in DDS.DataReaderListener.Ref_Access; 
  177.       Mask       : in DDS.StatusMask) is abstract; 
  178.    --  <internal> 
  179.    --  Calls the reader listener. 
  180.    --  </internal> 
  181.  
  182.    function Get_Topicdescription 
  183.      (Self : not null access Ref) 
  184.       return DDS.TopicDescription.Ref_Access is abstract; 
  185.    --  <dref>DataReader_get_topicdescription</dref> 
  186.    --  <internal> 
  187.    --  Returns the dds.TopicDescription associated with the dds.DataReader. 
  188.    --  </internal> 
  189.  
  190.    function Get_Subscriber 
  191.      (Self : not null access Ref) 
  192.       return access DDS.Subscriber.Ref'Class is abstract; 
  193.    --  <dref>DataReader_get_subscriber</dref> 
  194.    --  <internal> 
  195.    --  Returns the dds.Subscriber to which the dds.DataReader belongs. 
  196.    --  </internal> 
  197.  
  198.  
  199.    procedure Get_Sample_Rejected_Status 
  200.      (Self   : not null access Ref; 
  201.       Status : in out DDS.SampleRejectedStatus) is abstract; 
  202.    --  <dref>DataReader_get_sample_rejected_status</dref> 
  203.    --  <internal> 
  204.    --  Return the StatusKind.SAMPLE_REJECTED_STATUS communication status. 
  205.    --  </internal> 
  206.  
  207.    procedure Get_Liveliness_Changed_Status 
  208.      (Self : not null access Ref; 
  209.       Status : in out DDS.LivelinessChangedStatus) is abstract; 
  210.    --  <dref>DataReader_get_liveliness_changed_status</dref> 
  211.    --  <internal> 
  212.    --  Returns the StatusKind.LIVELINESS_CHANGED_STATUS communication status. 
  213.    --  </internal> 
  214.  
  215.    procedure Get_Requested_Deadline_Missed_Status 
  216.      (Self : not null access Ref; 
  217.       Status : in out DDS.RequestedDeadlineMissedStatus) is abstract; 
  218.    --  <dref>DataReader_get_requested_deadline_missed_status</dref> 
  219.    --  <internal> 
  220.    --  Returns the StatusKind.REQUESTED_DEADLINE_MISSED_STATUS 
  221.    --  communication status. 
  222.    --  </internal> 
  223.  
  224.    procedure Get_Requested_Incompatible_Qos_Status 
  225.      (Self : not null access Ref; 
  226.       Status : in out DDS.RequestedIncompatibleQosStatus) is abstract; 
  227.    --  <dref>DataReader_get_requested_incompatible_qos_status</dref> 
  228.    --  <internal> 
  229.    --  Returns the StatusKind.REQUESTED_INCOMPATIBLE_QOS_STATUS 
  230.    --  communication status 
  231.    --  </internal> 
  232.  
  233.    procedure Get_Subscription_Matched_Status 
  234.      (Self : not null access Ref; 
  235.       Status : in out DDS.SubscriptionMatchedStatus) is abstract; 
  236.    --  <dref>DataReader_get_subscription_matched_status</dref> 
  237.    --  <internal> 
  238.    --  Returns the StatusKind.SUBSCRIPTION_MATCHED_STATUS communication status. 
  239.    --  </internal> 
  240.  
  241.    procedure Get_Sample_Lost_Status 
  242.      (Self : not null access Ref; 
  243.       Status : in out DDS.SampleLostStatus) is abstract; 
  244.    --  <dref>DataReader_get_sample_lost_status</dref> 
  245.    --  <internal> 
  246.    --  Returns the StatusKind.SAMPLE_LOST_STATUS_STATUS communication status 
  247.    --  </internal> 
  248.  
  249.    procedure Get_Datareader_Cache_Status 
  250.      (Self : not null access Ref; 
  251.       Status : in out DDS.DataReaderCacheStatus) is abstract; 
  252.    --  <dref>DataReader_get_datareader_cache_status</dref> 
  253.    --  <internal> 
  254.    --  Returns the StatusKind.DATA_READER_CACHE_STATUS communication status 
  255.    --  </internal> 
  256.  
  257.    procedure Get_Datareader_Protocol_Status 
  258.      (Self : not null access Ref; 
  259.       Status : in out DDS.DataReaderProtocolStatus) is abstract; 
  260.    --  <dref>DataReader_get_datareader_protocol_status</dref> 
  261.    --  <internal> 
  262.    --  Returns the StatusKind.DATA_READER_PROTOCOL_STATUS communication status 
  263.    --  </internal> 
  264.  
  265.    procedure Get_Matched_Publication_Datareader_Protocol_Status 
  266.      (Self : not null access Ref; 
  267.       Status : in out DDS.DataReaderProtocolStatus; 
  268.       Publication_Handle : not null access DDS.InstanceHandle_T) is abstract; 
  269.    --  <dref>DataReader_get_matched_publication_datareader_protocol_status</dref> 
  270.    --  <internal> 
  271.    --  Returns the StatusKind.DATA_READER_PROTOCOL_STATUS communication status 
  272.    --  for this reader, per matched publication identified by the 
  273.    --  Publication_Handle. 
  274.    --  </internal> 
  275.  
  276.    procedure Wait_For_Historical_Data 
  277.      (Self     : not null access Ref; 
  278.       Max_Wait : in DDS.Duration_T) is abstract; 
  279.    --  <dref>DataReader_wait_for_historical_data</dref> 
  280.    --  <internal> 
  281.    --  Waits until all "historical" data is received for dds.DataReader entities 
  282.    --  that have a non-VOLATILE PERSISTENCE Qos kind. 
  283.    --  This operation is intended only for dds.DataReader entities that have a 
  284.    --  non-VOLATILE PERSISTENCE QoS kind. 
  285.    --  As soon as an application enables a non-VOLATILE dds.DataReader, it will 
  286.    --  start receiving both "historical" data, i.e. the data that was written 
  287.    --  prior to the time the dds.DataReader joined the domain, as well as any 
  288.    --  new data written by the dds.DataWriter entities. 
  289.    --  There are situations where the application logic may require the 
  290.    --  application to wait until all "historical" data is received. 
  291.    --  This is the purpose of the dds.DataReader.wait_for_historical_data operations. 
  292.    --  The operation dds.DataReader.wait_for_historical_data blocks the calling 
  293.    --  thread until either all "historical" data is received, or else duration 
  294.    --  specified by the max_wait parameter clapses, whichever happens first. 
  295.    --  A successful completion indicates that all the "historical" data was 
  296.    --  "received"; timing out indicates that max_wait elapsed before all the 
  297.    --  data was received 
  298.    --  </internal> 
  299.  
  300.  
  301.    function Get_Matched_Publications 
  302.      (Self    : not null access Ref) 
  303.       return DDS.InstanceHandle_Seq.Sequence is abstract; 
  304.    --  <dref>DataReader_get_matched_publications</dref> 
  305.    --  <internal> 
  306.    --  Retrieve the list of publications currently "associated" with this 
  307.    --  DDS.DataReader. 
  308.    --  Matching publications are those in the same domain that have a matching 
  309.    --  DDS.Topic, compatible QoS common partition that the DDS.DomainParticipant 
  310.    --  has not indicated should be "ignored" by means of the 
  311.    --  DDS.DomainParticipant.ignore_publication operation. 
  312.    --  The handles returned in the publication_handles' list are the ones that 
  313.    --  are used by the DDS implementation to locally identify the corresponding 
  314.    --  matched DDSDataWriter entities. 
  315.    --  These handles match the ones that appear in the instance_handle field 
  316.    --  of the DDS.SampleInfo when reading the 
  317.    --  PublicationBuiltinTopicDataTypeSupport.PUBLICATION_TOPIC_NAME builtin topic 
  318.    --  The sequence will be grown if the sequence has ownership and the system 
  319.    --  has the corresponding resources. Use a sequence without ownership to 
  320.    --  avoid dynamic memory allocation. If the sequence is too small to 
  321.    --  store all the matches and the system can not resize the sequence, 
  322.    --  this method will fail with RETCODE_OUT_OF_RESOURCES. 
  323.    --  The maximum number of matches possible is configured with 
  324.    --  DDS.DomainParticipantResourceLimitsQosPolicy. 
  325.    --  You can use a zero-maximum sequence without ownership to quickly check 
  326.    --  whether there are any matches without allocating any memory. 
  327.    --  </internal> 
  328.  
  329.    function Get_Matched_Publication_Data 
  330.      (Self               : not null access Ref; 
  331.       Publication_Handle : not null access DDS.InstanceHandle_T) 
  332.       return DDS.PublicationBuiltinTopicData is abstract; 
  333.    --  <dref>DataReader_get_matched_publication_data</dref> 
  334.    --  <internal> 
  335.    --  This operation retrieves the information on a publication that is 
  336.    --  currently "associated" with the dds.DataReader. 
  337.    --  Publication with a matching dds.Topic, compatible QoS and common 
  338.    --  partition that the application has not indicated should be "ignored" 
  339.    --  by means of the dds.DomainParticipant.ignore_publication operation. 
  340.    --  The publication_handle must correspond to a publication currently 
  341.    --  associated with the dds.DataReader. Otherwise, the operation will fail 
  342.    --   with RETCODE_BAD_PARAMETER. 
  343.    --  use the operation dds.DataReader.get_matched_publications to find the 
  344.    --  publications that are currently matched with the DDS.DataReader. 
  345.    --  </internal> 
  346.  
  347.  
  348.    procedure  call_listener 
  349.      (Self  : not null access Ref; 
  350.       mask  : StatusMask) is abstract; 
  351.  
  352.    procedure  set_liveliness_changed_status 
  353.      (Self : not null access Ref; 
  354.       To  : LivelinessChangedStatus) is abstract; 
  355.  
  356.  
  357.  
  358.    function Read_Or_Take_W_Condition_UntypedI 
  359.      (Self                                : not null access constant Ref; 
  360.       Is_Loan                             : access DDS.Boolean; 
  361.       Received_Data                       : System.Address; 
  362.       Data_Count                          : access Natural; 
  363.       Info_Seq                            : SampleInfo_Seq.Sequence; 
  364.       Data_Seq_Len                        : Long_Integer; 
  365.       Data_Seq_Max_Len                    : Long_Integer; 
  366.       Data_Seq_Has_Ownership              : Long_Integer; 
  367.       Data_Seq_Contiguous_Buffer_For_Copy : System.Address; 
  368.       Data_Size                           : Integer; 
  369.       Max_Samples                         : Long_Integer; 
  370.       Condition                           : not null access DDS.ReadCondition.Ref'Class; 
  371.       Take                                : DDS.Boolean) return  DDS.ReturnCode_T is abstract; 
  372.  
  373.    function Return_Loan_UntypedI 
  374.      (Self          : not null access constant Ref; 
  375.       Received_Data : System.Address; 
  376.       Data_Count    : Natural; 
  377.       Info_Seq      : Standard.DDS.SampleInfo_Seq.Sequence) return DDS.ReturnCode_T is abstract; 
  378.  
  379.    procedure Return_Loan_UntypedI 
  380.      (Self          : not null access constant Ref; 
  381.       Received_Data : System.Address; 
  382.       Data_Count    : Natural; 
  383.       Info_Seq      : Standard.DDS.SampleInfo_Seq.Sequence) is abstract; 
  384. end DDS.DataReader;