RTI Connext Modern C++ API Version 7.2.0
dds::topic::Filter Class Reference

Defines the filter to create a ContentFilteredTopic. More...

#include <dds/topic/Filter.hpp>

Public Member Functions

 Filter (const std::string &filter_expression)
 Creates a filter with a expression with no parameters. More...
 
template<typename FwdIterator >
 Filter (const std::string &filter_expression, const FwdIterator &params_begin, const FwdIterator &params_end)
 Creates a filter with an expression that contains parameters. More...
 
 Filter (const std::string &query_expression, const std::vector< std::string > &params)
 Creates a filter with an expression that contains parameters. More...
 
const std::string & expression () const
 Gets the filter expression. More...
 
const_iterator begin () const
 Provides the begin iterator to the parameter list. More...
 
const_iterator end () const
 The end iterator to the parameter list. More...
 
iterator begin ()
 Provides the begin iterator to the parameter list. More...
 
iterator end ()
 The end iterator to the parameter list. More...
 
template<typename FwdITerator >
Filterparameters (const FwdITerator &the_begin, const FwdITerator the_end)
 Modifies the parameters. More...
 
Filteradd_parameter (const std::string &param)
 Appends a parameter. More...
 
size_t parameters_length () const
 Gets the number of parameters. More...
 
std::string name () const
 <<extension>> Gets the filter name More...
 
dds::topic::Filtername (const std::string &the_name)
 <<extension>> Sets a filter name More...
 

Detailed Description

Defines the filter to create a ContentFilteredTopic.

Contains the filter expression and optionally the expression parameters. It also contains the filter name, which allows selecting the filter class to use–by default it's the built-in SQL filter.

Constructor & Destructor Documentation

◆ Filter() [1/3]

dds::topic::Filter::Filter ( const std::string &  filter_expression)
inline

Creates a filter with a expression with no parameters.

See also
Queries and Filters Syntax

◆ Filter() [2/3]

template<typename FwdIterator >
dds::topic::Filter::Filter ( const std::string &  filter_expression,
const FwdIterator &  params_begin,
const FwdIterator &  params_end 
)
inline

Creates a filter with an expression that contains parameters.

Template Parameters
FwdIteratorA forwar iterator whose value type is std::string (or convertible to)
Parameters
filter_expressionThe filter expression
params_beginThe beginning of the range of expression parameters
params_endThe end of the range (the number of parameter to create a ContentFilteredTopic can't exceed 100)
See also
Queries and Filters Syntax

◆ Filter() [3/3]

dds::topic::Filter::Filter ( const std::string &  query_expression,
const std::vector< std::string > &  params 
)
inline

Creates a filter with an expression that contains parameters.

Parameters
query_expressionThe query expression
paramsThe expression parameters (the number of parameter to create a ContentFilteredTopic can't exceed 100)
See also
Queries and Filters Syntax

Member Function Documentation

◆ expression()

const std::string & dds::topic::Filter::expression ( ) const
inline

Gets the filter expression.

◆ begin() [1/2]

const_iterator dds::topic::Filter::begin ( ) const
inline

Provides the begin iterator to the parameter list.

◆ end() [1/2]

const_iterator dds::topic::Filter::end ( ) const
inline

The end iterator to the parameter list.

◆ begin() [2/2]

iterator dds::topic::Filter::begin ( )
inline

Provides the begin iterator to the parameter list.

◆ end() [2/2]

iterator dds::topic::Filter::end ( )
inline

The end iterator to the parameter list.

◆ parameters()

template<typename FwdITerator >
Filter & dds::topic::Filter::parameters ( const FwdITerator &  the_begin,
const FwdITerator  the_end 
)
inline

Modifies the parameters.

◆ add_parameter()

Filter & dds::topic::Filter::add_parameter ( const std::string &  param)
inline

Appends a parameter.

◆ parameters_length()

size_t dds::topic::Filter::parameters_length ( ) const
inline

Gets the number of parameters.

◆ name() [1/2]

std::string name ( ) const

<<extension>> Gets the filter name

Returns
The name of the filter, or an empty string when using the default SQL filter.

◆ name() [2/2]

dds::topic::Filter & name ( const std::string &  the_name)

<<extension>> Sets a filter name

You can use one of the built-in filters (rti::topic::sql_filter_name and rti::topic::stringmatch_filter_name), or a custom filter, which you need to register using dds::domain::DomainParticipant::register_contentfilter().

[default] Empty string (equivalent to rti::topic::sql_filter_name)