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.Topic; 
  12. with DDS.TopicDescription; 
  13.  
  14. --  It describes a more sophisticated subscription that indicates a 
  15. --  dds.DataReader does not want to necessarily see all values of each 
  16. --  instance published under the dds.Topic. 
  17. --  Rather, it wants to see only the values whose contents satisfy 
  18. --  certain criteria. This class therefore can be used to request 
  19. --  content-based subscriptions. 
  20. --  The selection of the content is done using the filter_expression 
  21. --  with parameters expression_parameters. 
  22. --      * The filter_expression attribute is a string that specifies the 
  23. --        criteria to select the data samples of interest. 
  24. --        It is similar to the WHERE part of an SQL clause. 
  25. --      * The expression_parameters attribute is a sequence of strings that 
  26. --        give values to the 'parameters' (i.e. "%n" tokens) in the 
  27. --        filter_expression. The number of supplied parameters must fit with 
  28. --        the requested values in the filter_expression 
  29. --       (i.e. the number of n tokens). 
  30. --  Queries and Filters Syntax describes the syntax of 
  31. --  filter_expression and expression_parameters. 
  32. --  Note on Content-Based Filtering and Sparse Value Types 
  33. --  If you are a user of the Dynamic Data API, you may define sparse value types; 
  34. --  that is, types for which every data sample need not include a value for 
  35. --  every field defined in the type. 
  36. --  (See TCKind.TK_SPARSE and TypeCodeFactory.create_sparse_tc.) 
  37. --  In order for a filter expression on a field to be well defined, 
  38. --  that field must be present in the data sample. 
  39. --  That means that you will only be able to perform a content-based filter 
  40. --  on fields that are marked as TypeCode.KEY_MEMBER or 
  41. --   TypeCode.NONKEY_REQUIRED_MEMBER. 
  42.  
  43. --  <dref>ContentFilteredTopic</dref> 
  44. package DDS.ContentFilteredTopic is 
  45.  
  46.    type Ref is limited interface and DDS.TopicDescription.Ref; 
  47.    type Ref_Access is access all Ref'Class; 
  48.  
  49.    function Get_Filter_Expression 
  50.      (Self : not null access Ref) 
  51.       return DDS.String is abstract; 
  52.    --  <dref>ContentFilteredTopic_get_filter_expression</dref> 
  53.    --  <internal> 
  54.    --  Return the filter_expression associated with the 
  55.    --  dds.ContentFilteredTopic. 
  56.    --  </internal> 
  57.  
  58.    ---------------------------------------------------------------------- 
  59.  
  60.    procedure Get_Expression_Parameters 
  61.      (Self       : not null access Ref; 
  62.       Parameters : access DDS.String_Seq.Sequence) is abstract; 
  63.    --  <dref>ContentFilteredTopic_get_expression_parameters</dref> 
  64.    --  <internal> 
  65.    --  Return the expression_parameters associated with the 
  66.    --  dds.ContentFilteredTopic. 
  67.    --  expression_parameters is either specified on the last successful 
  68.    --  call to dds.ContentFilteredTopic.set_expression_parameters or, 
  69.    --  if that method is never called, the parameters specified when the 
  70.    --  dds.ContentFilteredTopic was created. 
  71.    --  </internal> 
  72.  
  73.    ---------------------------------------------------------------------- 
  74.  
  75.  
  76.    procedure Set_Expression_Parameters 
  77.      (Self       : not null access Ref; 
  78.       Parameters : access constant DDS.String_Seq.Sequence) is abstract; 
  79.    --  <dref>ContentFilteredTopic_set_expression_parameters</dref> 
  80.    --  <internal> 
  81.    --  Change the expression_parameters associated with the 
  82.    --  dds.ContentFilteredTopic. 
  83.    --  </internal> 
  84.  
  85.  
  86.    function Get_Related_Topic 
  87.      (Self : not null access Ref) 
  88.       return DDS.Topic.Ref_Access is abstract; 
  89.    --  <dref>ContentFilteredTopic_get_related_topic</dref> 
  90.    --  <internal> 
  91.    --  Return the dds.Topic specified when the dds.ContentFilteredTopic 
  92.    --  was created 
  93.    --  </internal> 
  94.  
  95.    function Narrow (Self : not null access DDS.TopicDescription.Ref'Class) 
  96.                     return Ref_Access; 
  97.    --  <dref>ContentFilteredTopic_narrow</dref> 
  98.  
  99.    function To_ContentFilteredTopic (Self : not null access DDS.TopicDescription.Ref'Class) 
  100.                     return Ref_Access; 
  101.    --  <dref>ContentFilteredTopic_narrow</dref> 
  102.  
  103.    procedure Append_To_Expression_Parameter 
  104.      (Self  : not null access Ref; 
  105.       Index : Natural; 
  106.       Value : DDS.String) is abstract; 
  107.    --  <dref>ContentFilteredTopic_append_to_expression_parameter</dref> 
  108.  
  109.    procedure Remove_From_Expression_Parameter 
  110.      (Self  : not null access Ref; 
  111.       Index : Natural; 
  112.       Value : DDS.String) is abstract; 
  113.    --  <dref>ContentFilteredTopic_remove_from_expression_parameter</dref> 
  114.  
  115. end DDS.ContentFilteredTopic;