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