14 #ifndef RTI_ROUTING_PROCESSOR_QUERY_HPP_
15 #define RTI_ROUTING_PROCESSOR_QUERY_HPP_
17 #include <dds/core/Reference.hpp>
18 #include <rti/core/detail/SelfReference.hpp>
19 #include <rti/routing/adapter/StreamReader.hpp>
21 namespace rti {
namespace routing {
namespace processor {
25 class QueryHolder :
public rti::core::detail::RetainableType<QueryHolder>{
28 QueryHolder() : stream_reader_(NULL), query_data_(NULL)
34 const dds::topic::Filter& the_filter)
35 : stream_reader_(the_stream_reader),
43 if (query_data_ != NULL) {
44 stream_reader_->delete_content_query(query_data_);
48 void filter(
const dds::topic::Filter& filter)
50 query_data_ = stream_reader_->create_content_query(query_data_, filter);
73 class Query :
public dds::core::Reference<rti::routing::processor::QueryHolder> {
75 typedef dds::core::Reference<QueryHolder> Base;
76 OMG_DDS_REF_TYPE_NOTYPENAME(
79 rti::routing::processor::QueryHolder);
81 explicit Query(Base::DELEGATE_REF_T reference) : Base(reference)
83 if (this->delegate()) {
84 this->delegate()->remember_reference(this->delegate());
98 const dds::topic::Filter&
filter)
99 : Base(new QueryHolder(stream_reader, filter))
101 this->delegate()->remember_reference(this->delegate());
114 this->delegate()->filter(filter);
120 #endif // RTI_ROUTING_PROCESSOR_QUERY_HPP_