DDS-PSM-C++  1.0
ISO C++ API for OpenSplice DDS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Query.hpp
Go to the documentation of this file.
1 #ifndef DDS_CORE_TFILTER_EXPRESSION_HPP_
2 #define DDS_CORE_TFILTER_EXPRESSION_HPP_
3 
4 /* Copyright 2010, Object Management Group, Inc.
5  * Copyright 2010, PrismTech, Corp.
6  * Copyright 2010, Real-Time Innovations, Inc.
7  * All rights reserved.
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #include <dds/core/types.hpp>
23 #include <dds/core/Value.hpp>
24 #include <dds/sub/detail/Query.hpp>
25 
26 /*
27  * NOTE: The Query class is specified as follows to limit the issues associated
28  * with includes dependencies and to make it easier to forward declare in places
29  * where the information about the delegate layer should not pop out.
30  *
31  */
32 namespace dds {
33  namespace sub {
34  class Query;
35  }
36 }
37 
38 class dds::sub::Query: public dds::core::Value<detail::Query> {
39 public:
41 public:
42  // Random access iterators
43  typedef DELEGATE::iterator iterator;
44  typedef DELEGATE::const_iterator const_iterator;
45 
46 public:
47  template<typename T>
48  Query(const dds::sub::DataReader<T>& dr, const std::string& query_expression);
49 
50  template<typename T, typename FWIterator>
51  Query(const dds::sub::DataReader<T>& dr, const std::string& query_expression,
52  const FWIterator& params_begin, const FWIterator& params_end);
53 
54  template<typename T>
55  Query(const dds::sub::DataReader<T>& dr, const std::string& query_expression,
56  const std::vector<std::string>& params);
57 
58  const std::string& expression() const;
59 
60  void expression(const std::string& expr);
61 
65  const_iterator begin() const;
66 
70  const_iterator end() const;
71 
75  iterator begin();
76 
80  iterator end();
81 
82  template<typename FWIterator>
83  void parameters(const FWIterator& begin, const FWIterator end);
84 
85  void add_parameter(const std::string& param);
86 
87  uint32_t parameters_length() const;
88 
89  const AnyDataReader& data_reader() const;
90 };
91 
92 #endif /* DDS_CORE_TQUERY_HPP_ */