OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
dds::topic::Filter Class Reference

Filter objects contain SQL expressions that allow the application to specify a filter on the locally available data. More...

#include "Filter.hpp"

Inheritance diagram for dds::topic::Filter:
Inheritance graph

Public Types

typedef D::const_iterator const_iterator
 
typedef D::iterator iterator
 

Public Member Functions

 Filter (const std::string &query_expression)
 
template<typename FWIterator >
 Filter (const std::string &query_expression, const FWIterator &params_begin, const FWIterator &params_end)
 
 Filter (const std::string &query_expression, const std::vector< std::string > &params)
 
void add_parameter (const std::string &param)
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator end () const
 
iterator end ()
 
const std::string & expression () const
 
bool operator!= (const Value &other) const
 
D * operator-> ()
 
const D * operator-> () const
 
bool operator== (const Value &other) const
 
template<typename FWIterator >
void parameters (const FWIterator &begin, const FWIterator end)
 
uint32_t parameters_length () const
 

Detailed Description

Filter objects contain SQL expressions that allow the application to specify a filter on the locally available data.

A Filter is used to create a ContentFilteredTopic.

SQL Expression
The SQL query string is set by expression which must be a subset of the SQL query language. In this query expression, parameters may be used, which must be set in the sequence of strings defined by the parameter query_parameters. A parameter is a string which can define an integer, float, string or enumeration. The number of values in query_parameters must be equal or greater than the highest referenced n token in the query_expression (e.g. if %1 and %8 are used as parameters in the query_expression, the query_parameters should at least contain n+1 = 9 values).
Look here for the specific query expression syntax.
See also
dds::topic::ContentFilteredTopic
Topic Definition

Definition at line 57 of file Filter.hpp.

Member Typedef Documentation

◆ const_iterator

typedef D::const_iterator dds::topic::Filter::const_iterator

Iterator for the query expression parameters.

Definition at line 68 of file Filter.hpp.

◆ iterator

typedef D::iterator dds::topic::Filter::iterator

Iterator for the query expression parameters.

Definition at line 63 of file Filter.hpp.

Constructor & Destructor Documentation

◆ Filter() [1/3]

dds::topic::Filter::Filter ( const std::string &  query_expression)

Create a Filter based on a query expression.

Parameters
query_expressionSQL expression
Exceptions
dds::core::Exception

Definition at line 41 of file FilterImpl.hpp.

◆ Filter() [2/3]

template<typename FWIterator >
dds::topic::Filter::Filter ( const std::string &  query_expression,
const FWIterator &  params_begin,
const FWIterator &  params_end 
)

Create a Filter based on a query expression and an iterable parameter container.

Parameters
query_expressionSQL expression
Template Parameters
params_beginIterator pointing to the beginning of the parameters to set
params_endIterator pointing to the end of the parameters to set
Exceptions
dds::core::Exception

Definition at line 48 of file FilterImpl.hpp.

◆ Filter() [3/3]

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

Create a Filter based on a query expression and parameter vector.

Parameters
query_expressionSQL expression
Template Parameters
paramsVector containing SQL expression parameters
Exceptions
dds::core::Exception

Definition at line 54 of file FilterImpl.hpp.

Member Function Documentation

◆ add_parameter()

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

Adds a parameter to the query.

See SQL expression info

Parameters
paramThe parameter to add
Exceptions
dds::core::Exception

Definition at line 110 of file FilterImpl.hpp.

◆ begin() [1/2]

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

Provides the begin iterator to the SQL expression parameter list.

See SQL expression info

Returns
dds::topic::Filter::const_iterator The begin iterator
Exceptions
dds::core::Exception

Definition at line 69 of file FilterImpl.hpp.

◆ begin() [2/2]

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

Provides the begin iterator to the SQL expression parameter list.

See SQL expression info

Returns
dds::topic::Filter::iterator The begin iterator
Exceptions
dds::core::Exception

Definition at line 85 of file FilterImpl.hpp.

◆ end() [1/2]

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

The end iterator to the SQL expression parameter list.

See SQL expression info

Returns
dds::topic::Filter::const_iterator The end iterator
Exceptions
dds::core::Exception

Definition at line 77 of file FilterImpl.hpp.

◆ end() [2/2]

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

The end iterator to the SQL expression parameter list.

See SQL expression info

Returns
dds::topic::Filter::iterator The end iterator
Exceptions
dds::core::Exception

Definition at line 93 of file FilterImpl.hpp.

◆ expression()

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

Get the query expression.

Returns
std::string The SQL expression.
Exceptions
dds::core::Exception

Definition at line 61 of file FilterImpl.hpp.

◆ operator!=()

template<typename D >
bool dds::core::Value< D >::operator!= ( const Value< D > &  other) const
inherited

Compare this Value with another Value

Parameters
otherValue
Returns
true if not equal

Definition at line 99 of file Value.hpp.

◆ operator->() [1/2]

template<typename D >
D * dds::core::Value< D >::operator-> ( )
inherited

The operator->() is provided to be able to directly invoke functions on the delegate.

The decision to provide direct access to the delegate was motivated by the need for providing a way that was not invasive with respect to the CXXDDS API and yet would allow for vendor-specific extension. Thus vendor-specific extensions can be invoked on the Value and on all its subclasses as follows:

my_dds_value.standard_function();
my_dds_value->vendor_specific_extension();
Returns
a reference to delegate.

Definition at line 111 of file Value.hpp.

◆ operator->() [2/2]

template<typename D >
const D * dds::core::Value< D >::operator-> ( ) const
inherited

The operator->() is provided to be able to directly invoke functions on the delegate.

The decision to provide direct access to the delegate was motivated by the need for providing a way that was not invasive with respect to the CXXDDS API and yet would allow for vendor-specific extension. Thus vendor-specific extensions can be invoked on the Value and on all its subclasses as follows:

my_dds_value.standard_function();
my_dds_value->vendor_specific_extension();
Returns
a reference to delegate.

Definition at line 105 of file Value.hpp.

◆ operator==()

template<typename D >
bool dds::core::Value< D >::operator== ( const Value< D > &  other) const
inherited

Compare this Value with another Value

Parameters
otherValue
Returns
true if equal

Definition at line 93 of file Value.hpp.

◆ parameters()

template<typename FWIterator >
void dds::topic::Filter::parameters ( const FWIterator &  begin,
const FWIterator  end 
)

Sets the query parameters.

See SQL expression info

Template Parameters
beginIterator pointing to the beginning of the parameters to set
endIterator pointing to the end of the parameters to set
Exceptions
dds::core::Exception

Definition at line 102 of file FilterImpl.hpp.

◆ parameters_length()

uint32_t dds::topic::Filter::parameters_length ( ) const

Gets the number of parameters in the query of the filter.

See SQL expression info

Returns
uint32_t The number of parameters in the query
Exceptions
dds::core::Exception

Definition at line 118 of file FilterImpl.hpp.


The documentation for this class was generated from the following files: