OpenSplice ISO C++ 2 DCPS  v7.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
WaitSetImpl.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_CORE_COND_TWAITSET_HPP_
22 #define OSPL_DDS_CORE_COND_TWAITSET_HPP_
23 
28 /*
29  * OMG PSM class declaration
30  */
32 #include <org/opensplice/core/ReportUtils.hpp>
33 
34 // Implementation
35 namespace dds
36 {
37 namespace core
38 {
39 namespace cond
40 {
41 
43 {
44  ISOCPP_REPORT_STACK_NC_BEGIN();
45  this->set_ref(new DELEGATE);
46  this->delegate()->init(this->impl_);
47 }
48 
49 
50 WaitSet::~WaitSet() { }
51 
52 
54 {
55  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
56  ConditionSeq triggered;
57  return this->wait(triggered, timeout);
58 }
59 
60 
62 {
63  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
64  ConditionSeq triggered;
65  return this->wait(triggered, dds::core::Duration::infinite());
66 }
67 
68 
70 {
71  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
72  return this->delegate()->wait(triggered, timeout);
73 }
74 
75 
77 {
78  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
79  return this->wait(triggered, dds::core::Duration::infinite());
80 }
81 
82 
84 {
85  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
87 }
88 
89 
91 {
92  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
93  this->delegate()->dispatch(timeout);
94 }
95 
96 
98 {
99  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
100  this->attach_condition(cond);
101  return *this;
102 }
103 
104 
106 {
107  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
108  this->detach_condition(cond);
109  return *this;
110 }
111 
112 
114 {
115  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
116  this->delegate()->attach_condition(cond);
117  return *this;
118 }
119 
120 
122 {
123  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
124  return this->delegate()->detach_condition(cond.delegate().get());
125 }
126 
127 
129 {
130  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
131  ConditionSeq conds;
132  return this->conditions(conds);
133 }
134 
135 
137 {
138  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
139  return this->delegate()->conditions(conds);
140 }
141 
142 }
143 }
144 }
145 
146 // End of implementation
147 
148 #endif /* OSPL_DDS_CORE_COND_TWAITSET_HPP_ */
static const Duration infinite()
const ConditionSeq conditions() const
bool detach_condition(const dds::core::cond::Condition &cond)
WaitSet & operator+=(const dds::core::cond::Condition &cond)
Definition: WaitSetImpl.hpp:97
Definition: array.hpp:23
const ConditionSeq wait()
Definition: WaitSetImpl.hpp:61
WaitSet & attach_condition(const dds::core::cond::Condition &cond)
A WaitSet object allows an application to wait until one or more of the attached Condition objects ha...
Definition: WaitSet.hpp:111
WaitSet & operator-=(const dds::core::cond::Condition &cond)
This class is the base class for all the conditions that may be attached to a dds::core::cond::WaitSe...
Definition: Condition.hpp:58
std::vector< dds::core::cond::Condition > ConditionSeq
Definition: WaitSet.hpp:114