RTI Connext .NET API (legacy)  Version 6.1.1
DDS::ContentFilteredTopic Class Reference

<<interface>> Specialization of ITopicDescription that allows for content-based subscriptions. More...

#include <managed_topic.h>

Inheritance diagram for DDS::ContentFilteredTopic:
DDS::ITopicDescription

Public Member Functions

System::String ^ get_filter_expression ()
 Get the filter_expression. More...
 
void get_expression_parameters (StringSeq^ parameters)
 Get the expression_parameters. More...
 
void set_expression_parameters (StringSeq^ parameters)
 Set the expression_parameters. More...
 
void set_expression (System::String^ expression, StringSeq^ parameters)
 Set the filter_expression and expression_parameters. More...
 
void append_to_expression_parameter (System::Int32 index, System::String^ val)
 <<extension>> Appends a string term to the specified parameter string. More...
 
void remove_from_expression_parameter (System::Int32 index, System::String^ val)
 <<extension>> Removes a string term from the specified parameter string. More...
 
Topicget_related_topic ()
 Get the related_topic. More...
 
virtual System::String ^ get_type_name ()
 Get the associated type_name. More...
 
virtual System::String ^ get_name ()
 Get the name used to create this ITopicDescription . More...
 
virtual DomainParticipantget_participant ()
 Get the DDS::DomainParticipant to which the ITopicDescription belongs. More...
 

Static Public Member Functions

static ContentFilteredTopicnarrow (ITopicDescription^ topic_description)
 Narrow the given ITopicDescription pointer to a DDS::ContentFilteredTopic pointer. More...
 

Detailed Description

<<interface>> Specialization of ITopicDescription that allows for content-based subscriptions.

It describes a more sophisticated subscription that indicates a DDS::DataReader does not want to necessarily see all values of each instance published under the DDS::Topic. Rather, it wants to see only the values whose contents satisfy certain criteria. This class therefore can be used to request content-based subscriptions.

The selection of the content is done using the filter_expression with parameters expression_parameters.

  • The filter_expression attribute is a string that specifies the criteria to select the data samples of interest. It is similar to the WHERE part of an SQL clause.
  • The expression_parameters attribute is a sequence of strings that give values to the 'parameters' (i.e. "%n" tokens) in the filter_expression. The number of supplied parameters must fit with the requested values in the filter_expression (i.e. the number of n tokens).

Queries and Filters Syntax describes the syntax of filter_expression and expression_parameters.

Member Function Documentation

◆ narrow()

static ContentFilteredTopic ^ DDS::ContentFilteredTopic::narrow ( ITopicDescription topic_description)
static

Narrow the given ITopicDescription pointer to a DDS::ContentFilteredTopic pointer.

Returns
DDS::ContentFilteredTopic if this ITopicDescription is a DDS::ContentFilteredTopic. Otherwise, return NULL.

◆ get_filter_expression()

System::String ^ DDS::ContentFilteredTopic::get_filter_expression ( )

Get the filter_expression.

Return the filter_expression associated with the DDS::ContentFilteredTopic. filter_expression is either specified on the last successful call to DDS::ContentFilteredTopic::set_expression or, if that method is never called, the expression specified when the DDS::ContentFilteredTopic was created.

Returns
the filter_expression.

◆ get_expression_parameters()

void DDS::ContentFilteredTopic::get_expression_parameters ( StringSeq parameters)

Get the expression_parameters.

Return the expression_parameters associated with the DDS::ContentFilteredTopic. expression_parameters is either specified on the last successful call to DDS::ContentFilteredTopic::set_expression_parameters, DDS::ContentFilteredTopic::set_expression or, if that method is never called, the parameters specified when the DDS::ContentFilteredTopic was created.

Parameters
parameters<<inout>> the filter expression parameters. Cannot be NULL.
Exceptions
Oneof the Standard Return Codes
See also
DDS::DomainParticipant::create_contentfilteredtopic
DDS::ContentFilteredTopic::set_expression_parameters

◆ set_expression_parameters()

void DDS::ContentFilteredTopic::set_expression_parameters ( StringSeq parameters)

Set the expression_parameters.

Change the expression_parameters associated with the DDS::ContentFilteredTopic.

Parameters
parameters<<in>> the filter expression parameters Cannot be NULL.Length of sequence cannot be greater than 100.
Exceptions
Oneof the Standard Return Codes

◆ set_expression()

void DDS::ContentFilteredTopic::set_expression ( System::String^  expression,
StringSeq parameters 
)

Set the filter_expression and expression_parameters.

Changes the filter_expression and expression_parameters associated with the DDS::ContentFilteredTopic.

Parameters
expression<<in>> the filter expression. Cannot be NULL.
parameters<<in>> the filter expression parameters Cannot be NULL.Length of sequence cannot be greater than 100.
Returns
One of the Standard Return Codes.

Referenced by RTI.Connext.Queuing.QueueConsumer< TRep >::QueueConsumer().

◆ append_to_expression_parameter()

void DDS::ContentFilteredTopic::append_to_expression_parameter ( System::Int32  index,
System::String^  val 
)

<<extension>> Appends a string term to the specified parameter string.

Appends the input string to the end of the specified parameter string, separated by a comma. If the original parameter string is enclosed in quotation marks (''), the resultant string will also be enclosed in quotation marks.

This method can be used in expression parameters associated with MATCH operators in order to add a pattern to the match pattern list. For example, if the filter expression parameter value is:

'IBM'

Then append_to_expression_parameter(0, "MSFT") would generate the new value:

'IBM,MSFT'

Parameters
index<<in>> The index of the parameter string to be modified. The first index is index 0. When using the DDS::DomainParticipant::STRINGMATCHFILTER_NAME filter, index must be 0.
val<<in>> The string term to be appended to the parameter string.
Exceptions
Oneof the Standard Return Codes

◆ remove_from_expression_parameter()

void DDS::ContentFilteredTopic::remove_from_expression_parameter ( System::Int32  index,
System::String^  val 
)

<<extension>> Removes a string term from the specified parameter string.

Removes the input string from the specified parameter string. To be found and removed, the input string must exist as a complete term, bounded by comma separators or the strong boundary. If the original parameter string is enclosed in quotation marks (''), the resultant string will also be enclosed in quotation marks. If the removed term was the last entry in the string, the result will be a string of empty quotation marks.

This method can be used in expression parameters associated with MATCH operators in order to remove a pattern from the match pattern list. For example, if the filter expression paremeter value is:

'IBM,MSFT'

Then remove_from_expression_parameter(0, "IBM") would generate the expression:

'MSFT'

Parameters
index<<in>> The index of the parameter string to be modified. The first index is index 0. When using the DDS::DomainParticipant::STRINGMATCHFILTER_NAME filter, index must be 0.
val<<in>> The string term to be removed from the parameter string.
Exceptions
Oneof the Standard Return Codes

◆ get_related_topic()

Topic ^ DDS::ContentFilteredTopic::get_related_topic ( )

Get the related_topic.

Return the DDS::Topic specified when the DDS::ContentFilteredTopic was created.

Returns
The DDS::Topic assocated with the DDS::ContentFilteredTopic.

◆ get_type_name()

virtual System::String ^ DDS::ContentFilteredTopic::get_type_name ( )
virtual

Get the associated type_name.

The type name defines a locally unique type for the publication or the subscription.

The type_name corresponds to a unique string used to register a type via the FooTypeSupport::register_type method.

Thus, the type_name implies an association with a corresponding DDS::TypeSupport and this ITopicDescription.

Returns
the type name. The returned type name is valid until the ITopicDescription is deleted.
Postcondition
The result is non-NULL.
See also
DDS::TypeSupport, FooTypeSupport

Implements DDS::ITopicDescription.

◆ get_name()

virtual System::String ^ DDS::ContentFilteredTopic::get_name ( )
virtual

Get the name used to create this ITopicDescription .

Returns
the name used to create this ITopicDescription. The returned topic name is valid until the ITopicDescription is deleted.
Postcondition
The result is non-NULL.

Implements DDS::ITopicDescription.

◆ get_participant()

virtual DomainParticipant ^ DDS::ContentFilteredTopic::get_participant ( )
virtual

Get the DDS::DomainParticipant to which the ITopicDescription belongs.

Returns
The DDS::DomainParticipant to which the ITopicDescription belongs.
Postcondition
The result is non-NULL.

Implements DDS::ITopicDescription.