DDS-PSM-C++  1.0
ISO C++ API for OpenSplice DDS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
TWaitSet.hpp
Go to the documentation of this file.
1 #ifndef OMG_TDDS_CORE_WAIT_SET_HPP_
2 #define OMG_TDDS_CORE_WAIT_SET_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 <vector>
23 
24 #include <dds/core/types.hpp>
26 
27 namespace dds {
28  namespace core {
29  namespace cond {
30  template <typename DELEGATE>
31  class TWaitSet;
32  }
33  }
34 }
35 
36 
45 template <typename DELEGATE>
47 public:
48  typedef std::vector<dds::core::cond::Condition> ConditionSeq;
49 
50 public:
52 
53 public:
57  TWaitSet();
58 
59  ~TWaitSet();
60 
61 public:
90  const ConditionSeq wait(const dds::core::Duration& timeout);
91 
120  const ConditionSeq wait();
121 
150  ConditionSeq& wait(ConditionSeq& triggered,
151  const dds::core::Duration& timeout);
152 
181  ConditionSeq& wait(ConditionSeq& triggered);
182 
183 public:
189  void dispatch();
190 
196  void dispatch(const dds::core::Duration& timeout);
197 
198 public:
202  WaitSet& operator +=(const dds::core::cond::Condition& cond);
203 
207  WaitSet& operator -=(const dds::core::cond::Condition& cond);
208 
219  WaitSet& attach_condition(const dds::core::cond::Condition& cond);
220 
229  bool detach_condition(const dds::core::cond::Condition& cond);
230 
236  const ConditionSeq conditions();
237 
243  ConditionSeq& conditions(ConditionSeq& conds) const;
244 };
245 
246 #endif /* OMG_TDDS_CORE_WAIT_SET_HPP_ */
247