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. 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.MetpTypeSupport; 
  18.  
  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.    procedure Delete_Readcondition 
  92.      (Self        : not null access Ref; 
  93.       A_Condition : access DDS.ReadCondition.Ref'Class) is abstract; 
  94.    --  <dref>DataReader_delete_readcondition</dref> 
  95.  
  96.    procedure  Delete_Contained_Entities 
  97.      (Self : not null access Ref) is abstract; 
  98.    --  <dref>DataReader_delete_contained_entities</dref> 
  99.    --  <internal> 
  100.    --  Deletes all the entities that were created by means of the "create" 
  101.    --  operations on the dds.DataReader. 
  102.    --  Deletes all contained dds.ReadCondition and dds.QueryCondition objects. 
  103.    --  The operation will fail with RETCODE_PRECONDITION_NOT_MET if the any of 
  104.    --  the contained entities is in a state where it cannot be deleted. 
  105.    --  Once dds.DataReader.delete_contained_entities completes successfully, 
  106.    --  the application may delete the dds.DataReader, knowing that it has no 
  107.    --  contained dds.ReadCondition and dds.QueryCondition objects. 
  108.    --  </internal> 
  109.  
  110.    procedure Set_Qos 
  111.      (Self : not null access Ref; 
  112.       Qos  : in DDS.DataReaderQoS) is abstract; 
  113.    --  <dref>DataReader_set_qos</dref> 
  114.  
  115.    procedure Set_Qos_With_Profile 
  116.      (Self          : not null access Ref; 
  117.       library_name  : in String; 
  118.       profile_name  : in String) is abstract; 
  119.    procedure Set_Qos_With_Profile 
  120.      (Self          : not null access Ref; 
  121.       library_name  : in Standard.String; 
  122.       profile_name  : in Standard.String) is abstract; 
  123.    --  <dref>DataReader_set_qos_with_profile</dref> 
  124.    --  <internal> 
  125.    --  This operation modifies the QoS of the DDS.DataReader. 
  126.    --  The DataReaderQos.user_data, 
  127.    --      DataReaderQos.deadline, 
  128.    --      DataReaderQos.latency_budget, 
  129.    --      DataReaderQos.time_based_filter, 
  130.    --      DataReaderQos.reader_data_lifecycle 
  131.    --  can be changed. 
  132.    --  The other policies are immutable. 
  133.    --  </internal> 
  134.  
  135.  
  136.    procedure Get_Qos 
  137.      (Self : not null access Ref; 
  138.       Qos  : in out DDS.DataReaderQoS) is abstract; 
  139.    --  <dref>DataReader_get_qos</dref> 
  140.    --  <internal> 
  141.    --  Gets the reader QoS. 
  142.    --  This method may potentially allocate memory depending on the sequences 
  143.    --  contained in some QoS policies 
  144.    --  </internal> 
  145.  
  146.  
  147.    procedure Set_Listener 
  148.      (Self       : not null access Ref; 
  149.       A_Listener : in DDS.DataReaderListener.Ref_Access; 
  150.       Mask       : in DDS.StatusMask) is abstract; 
  151.    --  <dref>DataReader_set_listener</dref> 
  152.    --  <internal> 
  153.    --  Sets the reader listener. 
  154.    --  </internal> 
  155.  
  156.  
  157.    function Get_Listener 
  158.      (Self : not null access Ref) 
  159.       return DDS.DataReaderListener.Ref_Access is abstract; 
  160.    --  <dref>DataReader_get_listener</dref> 
  161.    --  <internal> 
  162.    --  Get the reader listener 
  163.    --  </internal> 
  164.  
  165.    procedure Call_ListnerT 
  166.      (Self       : not null access Ref; 
  167.       A_Listener : in DDS.DataReaderListener.Ref_Access; 
  168.       Mask       : in DDS.StatusMask) is abstract; 
  169.    --  <internal> 
  170.    --  Calls the reader listener. 
  171.    --  </internal> 
  172.  
  173.    function Get_Topicdescription 
  174.      (Self : not null access Ref) 
  175.       return DDS.TopicDescription.Ref_Access is abstract; 
  176.    --  <dref>DataReader_get_topicdescription</dref> 
  177.    --  <internal> 
  178.    --  Returns the dds.TopicDescription associated with the dds.DataReader. 
  179.    --  </internal> 
  180.  
  181.    function Get_Subscriber 
  182.      (Self : not null access Ref) 
  183.       return access DDS.Subscriber.Ref'Class is abstract; 
  184.    --  <dref>DataReader_get_subscriber</dref> 
  185.    --  <internal> 
  186.    --  Returns the dds.Subscriber to which the dds.DataReader belongs. 
  187.    --  </internal> 
  188.  
  189.  
  190.    procedure Get_Sample_Rejected_Status 
  191.      (Self   : not null access Ref; 
  192.       Status : in out DDS.SampleRejectedStatus) is abstract; 
  193.    --  <dref>DataReader_get_sample_rejected_status</dref> 
  194.    --  <internal> 
  195.    --  Return the StatusKind.SAMPLE_REJECTED_STATUS communication status. 
  196.    --  </internal> 
  197.  
  198.    procedure Get_Liveliness_Changed_Status 
  199.      (Self : not null access Ref; 
  200.       Status : in out DDS.LivelinessChangedStatus) is abstract; 
  201.    --  <dref>DataReader_get_liveliness_changed_status</dref> 
  202.    --  <internal> 
  203.    --  Returns the StatusKind.LIVELINESS_CHANGED_STATUS communication status. 
  204.    --  </internal> 
  205.  
  206.    procedure Get_Requested_Deadline_Missed_Status 
  207.      (Self : not null access Ref; 
  208.       Status : in out DDS.RequestedDeadlineMissedStatus) is abstract; 
  209.    --  <dref>DataReader_get_requested_deadline_missed_status</dref> 
  210.    --  <internal> 
  211.    --  Returns the StatusKind.REQUESTED_DEADLINE_MISSED_STATUS 
  212.    --  communication status. 
  213.    --  </internal> 
  214.  
  215.    procedure Get_Requested_Incompatible_Qos_Status 
  216.      (Self : not null access Ref; 
  217.       Status : in out DDS.RequestedIncompatibleQosStatus) is abstract; 
  218.    --  <dref>DataReader_get_requested_incompatible_qos_status</dref> 
  219.    --  <internal> 
  220.    --  Returns the StatusKind.REQUESTED_INCOMPATIBLE_QOS_STATUS 
  221.    --  communication status 
  222.    --  </internal> 
  223.  
  224.    procedure Get_Subscription_Matched_Status 
  225.      (Self : not null access Ref; 
  226.       Status : in out DDS.SubscriptionMatchedStatus) is abstract; 
  227.    --  <dref>DataReader_get_subscription_matched_status</dref> 
  228.    --  <internal> 
  229.    --  Returns the StatusKind.SUBSCRIPTION_MATCHED_STATUS communication status. 
  230.    --  </internal> 
  231.  
  232.    procedure Get_Sample_Lost_Status 
  233.      (Self : not null access Ref; 
  234.       Status : in out DDS.SampleLostStatus) is abstract; 
  235.    --  <dref>DataReader_get_sample_lost_status</dref> 
  236.    --  <internal> 
  237.    --  Returns the StatusKind.SAMPLE_LOST_STATUS_STATUS communication status 
  238.    --  </internal> 
  239.  
  240.    procedure Get_Datareader_Cache_Status 
  241.      (Self : not null access Ref; 
  242.       Status : in out DDS.DataReaderCacheStatus) is abstract; 
  243.    --  <dref>DataReader_get_datareader_cache_status</dref> 
  244.    --  <internal> 
  245.    --  Returns the StatusKind.DATA_READER_CACHE_STATUS communication status 
  246.    --  </internal> 
  247.  
  248.    procedure Get_Datareader_Protocol_Status 
  249.      (Self : not null access Ref; 
  250.       Status : in out DDS.DataReaderProtocolStatus) is abstract; 
  251.    --  <dref>DataReader_get_datareader_protocol_status</dref> 
  252.    --  <internal> 
  253.    --  Returns the StatusKind.DATA_READER_PROTOCOL_STATUS communication status 
  254.    --  </internal> 
  255.  
  256.    procedure Get_Matched_Publication_Datareader_Protocol_Status 
  257.      (Self : not null access Ref; 
  258.       Status : in out DDS.DataReaderProtocolStatus; 
  259.       Publication_Handle : not null access DDS.InstanceHandle_T) is abstract; 
  260.    --  <dref>DataReader_get_matched_publication_datareader_protocol_status</dref> 
  261.    --  <internal> 
  262.    --  Returns the StatusKind.DATA_READER_PROTOCOL_STATUS communication status 
  263.    --  for this reader, per matched publication identified by the 
  264.    --  Publication_Handle. 
  265.    --  </internal> 
  266.  
  267.    procedure Wait_For_Historical_Data 
  268.      (Self     : not null access Ref; 
  269.       Max_Wait : in DDS.Duration_T) is abstract; 
  270.    --  <dref>DataReader_wait_for_historical_data</dref> 
  271.    --  <internal> 
  272.    --  Waits until all "historical" data is received for dds.DataReader entities 
  273.    --  that have a non-VOLATILE PERSISTENCE Qos kind. 
  274.    --  This operation is intended only for dds.DataReader entities that have a 
  275.    --  non-VOLATILE PERSISTENCE QoS kind. 
  276.    --  As soon as an application enables a non-VOLATILE dds.DataReader, it will 
  277.    --  start receiving both "historical" data, i.e. the data that was written 
  278.    --  prior to the time the dds.DataReader joined the domain, as well as any 
  279.    --  new data written by the dds.DataWriter entities. 
  280.    --  There are situations where the application logic may require the 
  281.    --  application to wait until all "historical" data is received. 
  282.    --  This is the purpose of the dds.DataReader.wait_for_historical_data operations. 
  283.    --  The operation dds.DataReader.wait_for_historical_data blocks the calling 
  284.    --  thread until either all "historical" data is received, or else duration 
  285.    --  specified by the max_wait parameter clapses, whichever happens first. 
  286.    --  A successful completion indicates that all the "historical" data was 
  287.    --  "received"; timing out indicates that max_wait elapsed before all the 
  288.    --  data was received 
  289.    --  </internal> 
  290.  
  291.  
  292.    function Get_Matched_Publications 
  293.      (Self    : not null access Ref) 
  294.       return DDS.InstanceHandle_Seq.Sequence is abstract; 
  295.    --  <dref>DataReader_get_matched_publications</dref> 
  296.    --  <internal> 
  297.    --  Retrieve the list of publications currently "associated" with this 
  298.    --  DDS.DataReader. 
  299.    --  Matching publications are those in the same domain that have a matching 
  300.    --  DDS.Topic, compatible QoS common partition that the DDS.DomainParticipant 
  301.    --  has not indicated should be "ignored" by means of the 
  302.    --  DDS.DomainParticipant.ignore_publication operation. 
  303.    --  The handles returned in the publication_handles' list are the ones that 
  304.    --  are used by the DDS implementation to locally identify the corresponding 
  305.    --  matched DDSDataWriter entities. 
  306.    --  These handles match the ones that appear in the instance_handle field 
  307.    --  of the DDS.SampleInfo when reading the 
  308.    --  PublicationBuiltinTopicDataTypeSupport.PUBLICATION_TOPIC_NAME builtin topic 
  309.    --  The sequence will be grown if the sequence has ownership and the system 
  310.    --  has the corresponding resources. Use a sequence without ownership to 
  311.    --  avoid dynamic memory allocation. If the sequence is too small to 
  312.    --  store all the matches and the system can not resize the sequence, 
  313.    --  this method will fail with RETCODE_OUT_OF_RESOURCES. 
  314.    --  The maximum number of matches possible is configured with 
  315.    --  DDS.DomainParticipantResourceLimitsQosPolicy. 
  316.    --  You can use a zero-maximum sequence without ownership to quickly check 
  317.    --  whether there are any matches without allocating any memory. 
  318.    --  </internal> 
  319.  
  320.    function Get_Matched_Publication_Data 
  321.      (Self               : not null access Ref; 
  322.       Publication_Handle : not null access DDS.InstanceHandle_T) 
  323.       return DDS.PublicationBuiltinTopicData is abstract; 
  324.    --  <dref>DataReader_get_matched_publication_data</dref> 
  325.    --  <internal> 
  326.    --  This operation retrieves the information on a publication that is 
  327.    --  currently "associated" with the dds.DataReader. 
  328.    --  Publication with a matching dds.Topic, compatible QoS and common 
  329.    --  partition that the application has not indicated should be "ignored" 
  330.    --  by means of the dds.DomainParticipant.ignore_publication operation. 
  331.    --  The publication_handle must correspond to a publication currently 
  332.    --  associated with the dds.DataReader. Otherwise, the operation will fail 
  333.    --   with RETCODE_BAD_PARAMETER. 
  334.    --  use the operation dds.DataReader.get_matched_publications to find the 
  335.    --  publications that are currently matched with the DDS.DataReader. 
  336.    --  </internal> 
  337.  
  338.    function Is_Data_ConsistentI 
  339.      (Self          : not null access constant Ref; 
  340.       Sample        : System.Address; 
  341.       Sample_Info   : not null DDS.SampleInfo_Access; 
  342.       MetpImpl      : DDS.MetpTypeSupport.Unsupported'Class) return Standard.Boolean is abstract; 
  343.  
  344. end DDS.DataReader;