OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
Manipulators.hpp
Go to the documentation of this file.
1 /*
2  * Vortex OpenSplice
3  *
4  * This software and documentation are Copyright 2006 to 2021 ADLINK
5  * Technology Limited, its affiliated companies and licensors. All rights
6  * reserved.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 #ifndef OSPL_DDS_SUB_DETAIL_MANIPULATOR_HPP_
22 #define OSPL_DDS_SUB_DETAIL_MANIPULATOR_HPP_
23 
28 #include <dds/sub/Query.hpp>
29 
30 namespace dds
31 {
32 namespace sub
33 {
34 namespace functors
35 {
36 namespace detail
37 {
38 
39 
45 {
46 public:
53  n_(n)
54  {
55  }
56 
58  template<typename S>
59  void operator()(S& s)
60  {
61  s.max_samples(n_);
62  }
64 private:
65  uint32_t n_;
66 };
67 
68 
74 {
75 public:
82  query_(q)
83  {
84  }
85 
87  template<typename S>
88  void operator()(S& s)
89  {
90  s.content(query_);
91  }
93 private:
94  const dds::sub::Query query_;
95 };
96 
97 
103 {
104 public:
111  const dds::sub::status::DataState& s) :
112  state_(s)
113  {
114  }
115 
117  template<typename S>
118  void operator()(S& s)
119  {
120  s.state(state_);
121  }
123 private:
125 };
126 
127 
133 {
134 public:
141  handle_(h)
142  {
143  }
144 
146  template<typename S>
147  void operator()(S& s)
148  {
149  s.instance(handle_);
150  }
152 private:
154 };
155 
156 
162 {
163 public:
170  const dds::core::InstanceHandle& h) :
171  handle_(h)
172  {
173  }
174 
176  template<typename S>
177  void operator()(S& s)
178  {
179  s.next_instance(handle_);
180  }
182 private:
184 };
185 
186 
187 }
188 }
189 }
190 }
191 
192 
193 
194 #endif /* OSPL_DDS_SUB_DETAIL_MANIPULATOR_HPP_ */
InstanceManipulatorFunctor(const dds::core::InstanceHandle &h)
Support functor for dds::sub::state read manipulator.
Support functor for dds::sub::next_instance read manipulator.
Query objects contain expressions that allow the application to specify a filter on the locally avail...
Definition: Query.hpp:61
Class to hold sample DataState information.
Definition: DataState.hpp:371
Class to hold the handle associated with in sample instance.
Definition: array.hpp:23
Support functor for dds::sub::content read manipulator.
StateFilterManipulatorFunctor(const dds::sub::status::DataState &s)
Support functor for dds::sub::instance read manipulator.
NextInstanceManipulatorFunctor(const dds::core::InstanceHandle &h)
Support functor for dds::sub::max_samples read manipulator.