![]() |
OpenSplice ISO C++ 2 DCPS
v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
|
QueryCondition objects are specialized ReadCondition objects that allow the application to also specify a filter on the locally available data. More...
#include "QueryCondition.hpp"

Public Types | |
| typedef DELEGATE::const_iterator | const_iterator |
| typedef DELEGATE::iterator | iterator |
Public Member Functions | |
| QueryCondition (const dds::sub::Query &query, const dds::sub::status::DataState &status) | |
| template<typename FUN > | |
| QueryCondition (const dds::sub::Query &query, const dds::sub::status::DataState &status, FUN &functor) | |
| template<typename FUN > | |
| QueryCondition (const dds::sub::Query &query, const dds::sub::status::DataState &status, const FUN &functor) | |
| QueryCondition (const dds::sub::AnyDataReader &dr, const std::string &expression, const std::vector< std::string > ¶ms, const dds::sub::status::DataState &status) | |
| template<typename FUN > | |
| QueryCondition (const dds::sub::AnyDataReader &dr, const std::string &expression, const std::vector< std::string > ¶ms, const dds::sub::status::DataState &status, FUN &functor) | |
| template<typename FUN > | |
| QueryCondition (const dds::sub::AnyDataReader &dr, const std::string &expression, const std::vector< std::string > ¶ms, const dds::sub::status::DataState &status, const FUN &functor) | |
| void | add_parameter (const std::string ¶m) |
| const_iterator | begin () const |
| iterator | begin () |
| const dds::sub::AnyDataReader & | data_reader () const |
| void | dispatch () |
| const_iterator | end () const |
| iterator | end () |
| const std::string & | expression () const |
| void | expression (const std::string &expr) |
| const std::string & | expression () |
| template<typename Functor > | |
| void | handler (Functor &func) |
| template<typename Functor > | |
| void | handler (const Functor &func) |
| bool | is_nil () const |
| template<typename R > | |
| bool | operator!= (const R &ref) const |
| bool | operator!= (const null_type nil) const |
| DELEGATE * | operator-> () |
| const DELEGATE * | operator-> () const |
| template<typename R > | |
| bool | operator== (const R &ref) const |
| bool | operator== (const null_type) const |
| template<typename FWIterator > | |
| void | parameters (const FWIterator &begin, const FWIterator end) |
| uint32_t | parameters_length () const |
| void | reset_handler () |
| const dds::sub::status::DataState | state_filter () const |
| bool | trigger_value () const |
QueryCondition objects are specialized ReadCondition objects that allow the application to also specify a filter on the locally available data.
The query (query_expression) is similar to an SQL WHERE clause can be parameterized by arguments. See dds::sub::Query for more query information.
See the WaitSet examples for some examples.
Although the WaitSet examples use the StatusCondition, the basic usage of this Condition with a WaitSet is the same.
Definition at line 62 of file QueryCondition.hpp.
| typedef DELEGATE::const_iterator dds::sub::cond::QueryCondition::const_iterator |
Iterator for the query expression parameters.
Definition at line 80 of file QueryCondition.hpp.
| typedef DELEGATE::iterator dds::sub::cond::QueryCondition::iterator |
Iterator for the query expression parameters.
Definition at line 75 of file QueryCondition.hpp.
| dds::sub::cond::QueryCondition::QueryCondition | ( | const dds::sub::Query & | query, |
| const dds::sub::status::DataState & | status | ||
| ) |
Creates a QueryCondition instance.
This will create an QueryCondition that is associated with a dds::sub::Query, which is again associated with a dds::sub::DataReader.
See SQL expression info
See State mask info in ReadCondition.
| query | The query to filter on the locally available data. |
| status | A mask, which selects only those samples with the desired sample/view/instance states. |
| dds::core::Exception |
Definition at line 44 of file QueryConditionImpl.hpp.
| dds::sub::cond::QueryCondition::QueryCondition | ( | const dds::sub::Query & | query, |
| const dds::sub::status::DataState & | status, | ||
| FUN & | functor | ||
| ) |
Creates a QueryCondition instance.
This will create an QueryCondition that is associated with a dds::sub::Query, which is again associated with a dds::sub::DataReader.
The supplied functor will be called when this QueryCondition is triggered and either the inherited dds::core::cond::Condition::dispatch() is called or the dds::core::cond::WaitSet::dispatch() on the WaitSet to which this QueryCondition is attached to.
See SQL expression info
See State mask info in ReadCondition.
| query | The query to filter on the locally available data. |
| status | A mask, which selects only those samples with the desired sample/view/instance states. |
| functor | The functor to be called when the QueryCondition triggers. |
| dds::core::Exception |
| dds::sub::cond::QueryCondition::QueryCondition | ( | const dds::sub::Query & | query, |
| const dds::sub::status::DataState & | status, | ||
| const FUN & | functor | ||
| ) |
Creates a QueryCondition instance.
This will create an QueryCondition that is associated with a dds::sub::Query, which is again associated with a dds::sub::DataReader.
The supplied functor will be called when this QueryCondition is triggered and either the inherited dds::core::cond::Condition::dispatch() is called or the dds::core::cond::WaitSet::dispatch() on the WaitSet to which this QueryCondition is attached to.
See SQL expression info
See State mask info in ReadCondition.
| query | The query to filter on the locally available data. |
| status | A mask, which selects only those samples with the desired sample/view/instance states. |
| functor | The functor to be called when the QueryCondition triggers. |
| dds::core::Exception |
| dds::sub::cond::QueryCondition::QueryCondition | ( | const dds::sub::AnyDataReader & | dr, |
| const std::string & | expression, | ||
| const std::vector< std::string > & | params, | ||
| const dds::sub::status::DataState & | status | ||
| ) |
Creates a QueryCondition instance.
This will create an QueryCondition that is associated with an dds::sub::AnyDataReader, with parameters that essentially represent a query.
See SQL expression info
See State mask info in ReadCondition.
| dr | Query associated DataReader. |
| expression | Query expression |
| params | Query expression parameters |
| status | A mask, which selects only those samples with the desired sample/view/instance states. |
| dds::core::Exception |
Definition at line 90 of file QueryConditionImpl.hpp.
| dds::sub::cond::QueryCondition::QueryCondition | ( | const dds::sub::AnyDataReader & | dr, |
| const std::string & | expression, | ||
| const std::vector< std::string > & | params, | ||
| const dds::sub::status::DataState & | status, | ||
| FUN & | functor | ||
| ) |
Creates a QueryCondition instance.
This will create an QueryCondition that is associated with an dds::sub::AnyDataReader, with parameters that essentially represent a query.
The supplied functor will be called when this QueryCondition is triggered and either the inherited dds::core::cond::Condition::dispatch() is called or the dds::core::cond::WaitSet::dispatch() on the WaitSet to which this QueryCondition is attached to.
See SQL expression info
See State mask info in ReadCondition.
| dr | Query associated DataReader. |
| expression | Query expression |
| params | Query expression parameters |
| status | A mask, which selects only those samples with the desired sample/view/instance states. |
| dds::core::Exception |
| dds::sub::cond::QueryCondition::QueryCondition | ( | const dds::sub::AnyDataReader & | dr, |
| const std::string & | expression, | ||
| const std::vector< std::string > & | params, | ||
| const dds::sub::status::DataState & | status, | ||
| const FUN & | functor | ||
| ) |
Creates a QueryCondition instance.
This will create an QueryCondition that is associated with an dds::sub::AnyDataReader, with parameters that essentially represent a query.
The supplied functor will be called when this QueryCondition is triggered and either the inherited dds::core::cond::Condition::dispatch() is called or the dds::core::cond::WaitSet::dispatch() on the WaitSet to which this QueryCondition is attached to.
See SQL expression info
See State mask info in ReadCondition.
| dr | Query associated DataReader. |
| expression | Query expression |
| params | Query expression parameters |
| status | A mask, which selects only those samples with the desired sample/view/instance states. |
| dds::core::Exception |
| void dds::sub::cond::QueryCondition::add_parameter | ( | const std::string & | param | ) |
Adds a parameter to the query.
| param | The parameter to add |
| dds::core::Exception |
Definition at line 201 of file QueryConditionImpl.hpp.
| QueryCondition::const_iterator dds::sub::cond::QueryCondition::begin | ( | ) | const |
Provides the beginning iterator of the query parameter list.
| dds::core::Exception |
Definition at line 171 of file QueryConditionImpl.hpp.
| QueryCondition::iterator dds::sub::cond::QueryCondition::begin | ( | ) |
Provides the beginning iterator of the query parameter list.
| dds::core::Exception |
Definition at line 187 of file QueryConditionImpl.hpp.
| const AnyDataReader & dds::sub::cond::QueryCondition::data_reader | ( | ) | const |
This operation returns the DataReader associated with the QueryCondition.
Note that there is exactly one DataReader associated with each QueryCondition.
| dds::core::Exception |
Definition at line 218 of file QueryConditionImpl.hpp.
|
inherited |
Dispatches the functor that have been registered with the Condition.
The Condition has to have been triggered for the functor will be called by this function.
| dds::core::Exception |
Definition at line 76 of file ConditionImpl.hpp.
| QueryCondition::const_iterator dds::sub::cond::QueryCondition::end | ( | ) | const |
Provides the end iterator of the query parameter list.
| dds::core::Exception |
Definition at line 179 of file QueryConditionImpl.hpp.
| QueryCondition::iterator dds::sub::cond::QueryCondition::end | ( | ) |
Provides the end iterator of the query parameter list.
| dds::core::Exception |
Definition at line 193 of file QueryConditionImpl.hpp.
|
inherited |
Get expression.
| dds::core::Exception |
Definition at line 70 of file QueryImpl.hpp.
| void dds::sub::cond::QueryCondition::expression | ( | const std::string & | expr | ) |
Set the Query expression.
| expr | SQL expression |
| dds::core::Exception |
Definition at line 154 of file QueryConditionImpl.hpp.
| const std::string & dds::sub::cond::QueryCondition::expression | ( | ) |
Get the Query expression.
| dds::core::Exception |
Definition at line 163 of file QueryConditionImpl.hpp.
|
inherited |
Registers a functor as custom handler with this Condition.
The supplied functor will be called when this Condition is triggered and either the dds::core::cond::Condition::dispatch() is called or the dds::core::cond::WaitSet::dispatch() on the WaitSet to which this Condition is attached to.
| Functor | The functor to be called when the StatusCondition triggers. |
| dds::core::Exception |
|
inherited |
Registers a functor as custom handler with this Condition.
The supplied functor will be called when this Condition is triggered and either the dds::core::cond::Condition::dispatch() is called or the dds::core::cond::WaitSet::dispatch() on the WaitSet to which this Condition is attached to.
| Functor | The functor to be called when the StatusCondition triggers. |
| dds::core::Exception |
|
inherited |
Check if the referenced object is nil.
In other words, check if the reference is pointing to a null object.
Definition at line 143 of file ReferenceImpl.hpp.
|
inherited |
Compares two Reference objects and returns true if they are not equal.
Inequality is based on the referential inequality of the object being pointed to.
| ref | the other Reference object |
Definition at line 100 of file ReferenceImpl.hpp.
|
inherited |
Special operator!= used to check if this reference object does not equal the dds::core::null reference.
The non-null-check can be done like this:
Definition at line 157 of file ReferenceImpl.hpp.
|
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 Reference and on all its subclasses as follows:
Definition at line 180 of file ReferenceImpl.hpp.
|
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 Reference and on all its subclasses as follows:
Definition at line 188 of file ReferenceImpl.hpp.
|
inherited |
Compares two Reference objects and returns true if they are equal.
Equality is based on the referential equality of the object being pointed.
| ref | the other Reference object |
Definition at line 83 of file ReferenceImpl.hpp.
|
inherited |
Special operator== used to check if this reference object equals the dds::core::null reference.
The null-check can be done like this:
Definition at line 150 of file ReferenceImpl.hpp.
| void dds::sub::cond::QueryCondition::parameters | ( | const FWIterator & | begin, |
| const FWIterator | end | ||
| ) |
Sets the query parameters.
| begin | Iterator pointing to the beginning of the parameters to set |
| end | Iterator pointing to the end of the parameters to set |
| dds::core::Exception |
Definition at line 145 of file QueryConditionImpl.hpp.
| uint32_t dds::sub::cond::QueryCondition::parameters_length | ( | ) | const |
Gets the number of parameters in the query.
| dds::core::Exception |
Definition at line 210 of file QueryConditionImpl.hpp.
|
inherited |
Resets the handler for this Condition.
After the invocation of this function no handler will be registered with this Condition.
| dds::core::Exception |
Definition at line 69 of file ConditionImpl.hpp.
|
inherited |
This operation returns the set of data-states that are taken into account to determine the trigger_value of the ReadCondition.
These are data-states specified when the ReadCondition was created.
| dds::core::Exception |
Definition at line 87 of file ReadConditionImpl.hpp.
|
inherited |
This operation retrieves the trigger_value of the Condition.
A Condition has a trigger_value that can be TRUE or FALSE and is set by the Data Distribution Service (except a GuardCondition). This operation returns the trigger_value of the Condition.
| dds::core::Exception |
Definition at line 83 of file ConditionImpl.hpp.