OpenSplice ISO C++ 2 DCPS  v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
SubscriberImpl.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_TSUBSCRIBER_IMPL_HPP_
22 #define OSPL_DDS_SUB_TSUBSCRIBER_IMPL_HPP_
23 
28 /*
29  * OMG PSM class declaration
30  */
31 #include <dds/sub/Subscriber.hpp>
32 
33 // Implementation
34 
35 namespace dds
36 {
37 namespace sub
38 {
39 
40 
41 Subscriber::Subscriber(const ::dds::domain::DomainParticipant& dp)
42  : ::dds::core::Reference(new DELEGATE(dp,
43  dp.default_subscriber_qos(),
44  NULL,
45  dds::core::status::StatusMask::none()))
46 {
47  ISOCPP_REPORT_STACK_DDS_BEGIN(dp);
48 
49  this->delegate()->init(this->impl_);
50 }
51 
52 
53 Subscriber::Subscriber(const ::dds::domain::DomainParticipant& dp,
57  : ::dds::core::Reference(new DELEGATE(dp, qos, listener, mask))
58 {
59  ISOCPP_REPORT_STACK_DDS_BEGIN(dp);
60 
61  this->delegate()->init(this->impl_);
62 }
63 
64 
65 Subscriber::~Subscriber() {}
66 
67 
69 {
70  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
71 
72  this->delegate()->notify_datareaders();
73 }
74 
75 
77  const dds::core::status::StatusMask& event_mask)
78 {
79  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
80 
81  return this->delegate()->listener(listener, event_mask);
82 }
83 
84 
86 {
87  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
88 
89  return this->delegate()->listener();
90 }
91 
92 
93 
95 {
96  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
97 
98  return this->delegate()->qos();
99 }
100 
101 
103 {
104  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
105 
106  this->delegate()->qos(sqos);
107 }
108 
109 
111 {
112  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
113 
114  return this->delegate()->default_datareader_qos();
115 }
116 
117 
120 {
121  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
122 
123  this->delegate()->default_datareader_qos(qos);
124  return *this;
125 }
126 
127 
129 {
130  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
131 
132  return this->delegate()->participant();
133 }
134 
135 
137 {
138  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
139 
140  this->qos(qos);
141  return *this;
142 }
143 
144 
146 {
147  ISOCPP_REPORT_STACK_DDS_BEGIN(*this);
148 
149  qos = this->qos();
150  return *this;
151 }
152 
153 }
154 }
155 // End of implementation
156 
157 #endif /* OSPL_DDS_SUB_TSUBSCRIBER_IMPL_HPP_ */
A Subscriber is the object responsible for the actual reception of the data resulting from its subscr...
Definition: Subscriber.hpp:53
Listener * listener() const
Reference(dds::core::null_type &)
const dds::domain::DomainParticipant & participant() const
This class provides the basic mechanism for an application to specify Quality of Service attributes f...
dds::sub::qos::DataReaderQos default_datareader_qos() const
Subscriber & operator<<(const dds::sub::qos::SubscriberQos &qos)
Subscriber(const ::dds::domain::DomainParticipant &dp)
A DomainParticipant represents the local membership of the application in a Domain.
Subscriber events Listener.
Definition: array.hpp:23
StatusMask is a bitmap or bitset field.
Definition: State.hpp:144
const Subscriber & operator>>(dds::sub::qos::SubscriberQos &qos) const
const dds::sub::qos::SubscriberQos & qos() const
This class provides the basic mechanism for an application to specify Quality of Service attributes f...