CoreDX DDS C Reference Manual
Related Functions | List of all members
DDS_ContentFilteredTopic Struct Reference

DDS_ContentFilteredTopic provides a topic that may exclude data based on a specified filter. The ContentFilteredTopic is associated with another un-filtered topic related_topic. It applies a filter to the data of the related topic. If a data sample passes the filter, it will be made available to a DataReader associated with the ContentFilteredTopic. More...

Related Functions

(Note that these are not member functions.)

DDS_TopicDescription DDS_ContentFilteredTopic_TopicDescription (DDS_ContentFilteredTopic t)
 This operation 'casts' the provide DDS_ContentFilteredTopic to a DDS_TopicDescrition.
 
DDS_Topic DDS_ContentFilteredTopic_get_related_topic (DDS_ContentFilteredTopic t)
 This returns the real Topic associated with the ContentFilteredTopic. More...
 
DDS_ReturnCode_t DDS_ContentFilteredTopic_get_expression_parameters (DDS_ContentFilteredTopic t, DDS_StringSeq *parameters)
 This accesses the current set of parameters used by the ContentFilteredTopic. More...
 
DDS_ReturnCode_t DDS_ContentFilteredTopic_set_expression_parameters (DDS_ContentFilteredTopic t, const DDS_StringSeq *parameters)
 This specifies a new set of parameters for use with the filter_expression. More...
 

Detailed Description

DDS_ContentFilteredTopic provides a topic that may exclude data based on a specified filter. The ContentFilteredTopic is associated with another un-filtered topic related_topic. It applies a filter to the data of the related topic. If a data sample passes the filter, it will be made available to a DataReader associated with the ContentFilteredTopic.

The filter_expression is an SQL like condition expression, and filter_parameters provide optional parameters that are referenced by the filter_expression. The syntax of the filter expression is similar to the WHERE clause in SQL. For example "x<4" is a valid filter expression. It would test that data member 'x' is less than value '4'. If the filter expression evaluates to TRUE, then the data sample will be available, otherwise the data sample would be 'filtered' (excluded).

CoreDX DDS supports the 'LIKE' operator (and NOT LIKE) for regular expression string matching. The pattern string in a LIKE clause can contain '' to match zero or more characters, '_' to match a single character, or '[<characters>]' to match a range of characters.

CoreDX DDS also includes support for the 'IN' operator. This provides a very powerful mechanism for testing that a value appears in a set of values. For example "symbol IN ('ge', 'msft', 'ibm')" will select all samples that have a symbol value of 'ge', 'msft', or 'ibm'. This could also be written as a series of equality tests combined with the OR operator; however, the IN operator is much more efficient. A filter that matches on several hundred or even thousands of values can be implemented very efficiently using the 'IN' operator.

The filter_expression can refer to parameters. The syntax for paramters is the percent sign '' followed by a number. The number is the index of the paramter in the filter_paramters sequence. Parameters are counted starting at zero. So, "%0" refers to the first parameter, and "%4" refers to the fifth paramter. Using this syntax, the expression "x<%0" would test the value of 'x' against the first parameter in the sequence.

See also
DDS_DomainParticipant_create_contentfilteredtopic()

Friends And Related Function Documentation

DDS_ReturnCode_t DDS_ContentFilteredTopic_get_expression_parameters ( DDS_ContentFilteredTopic  t,
DDS_StringSeq *  parameters 
)
related

This accesses the current set of parameters used by the ContentFilteredTopic.

The parameters String Sequence is populated with the current set of parameters.

DDS_Topic DDS_ContentFilteredTopic_get_related_topic ( DDS_ContentFilteredTopic  t)
related

This returns the real Topic associated with the ContentFilteredTopic.

That is, the Topic provided when the ContentFilteredTopic was created.

DDS_ReturnCode_t DDS_ContentFilteredTopic_set_expression_parameters ( DDS_ContentFilteredTopic  t,
const DDS_StringSeq *  parameters 
)
related

This specifies a new set of parameters for use with the filter_expression.

The filter_expression is an SQL like condition expression, and the parameters argument provides optional parameters that are referenced by the filter_expression. The syntax for refering to paramters in a filter_expression is the percent sign '' followed by a number. The number is the index of the paramter in the filter_paramters sequence. Parameters are counted starting at zero. So, "%0" refers to the first parameter, and "%4" refers to the fifth paramter. Using this syntax, the expression "x<%0" would test the value of 'x' against the first parameter in the sequence.


© 2009-2017 Twin Oaks Computing, Inc
Castle Rock, CO 80108
All rights reserved.