Cyclone ISO C++ API Reference Guide
State.hpp
Go to the documentation of this file.
1 #ifndef OMG_DDS_CORE_STATUS_STATE_HPP_
2 #define OMG_DDS_CORE_STATUS_STATE_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 <bitset>
23 #include <dds/core/macros.hpp>
24 #include <dds/core/types.hpp>
25 
26 
27 namespace dds
28 {
29 namespace core
30 {
31 namespace status
32 {
33 
40 class OMG_DDS_API SampleRejectedState : public std::bitset<OMG_DDS_STATE_BIT_COUNT>
41 {
42 public:
46  typedef std::bitset<OMG_DDS_STATE_BIT_COUNT> MaskType;
47 
48 public:
53 
62 
68  SampleRejectedState(const MaskType& src);
69 
70 public:
80  {
81  return SampleRejectedState(0u);
82  }
83 
95  {
96  return SampleRejectedState(0x0001 << 1u);
97  }
98 
110  {
111  return SampleRejectedState(0x0001 << 0u);
112  }
113 
125  {
126  return SampleRejectedState(0x0001 << 2u);
127  }
128 
129 private:
130  SampleRejectedState(uint32_t s);
131 };
132 
144 class OMG_DDS_API StatusMask : public std::bitset<OMG_DDS_STATUS_COUNT>
145 {
146 public:
150  typedef std::bitset<OMG_DDS_STATUS_COUNT> MaskType;
151 
152 public:
156  StatusMask();
157 
163  explicit StatusMask(uint32_t mask);
164 
172  StatusMask(const StatusMask& other);
173 
175  ~StatusMask();
178 public:
185  {
186  *this |= mask;
187  return *this;
188  }
189 
195  inline static StatusMask all()
196  {
197  return StatusMask(0x80007fe7u);
198  }
199 
205  inline static StatusMask none()
206  {
207  return StatusMask(0u);
208  }
209 
210 public:
217  {
218  return StatusMask(0x00000001 << 0u);
219  }
220 
227  {
228  return StatusMask(0x00000001 << 1u);
229  }
230 
237  {
238  return StatusMask(0x00000001 << 2u);
239  }
240 
247  {
248  return StatusMask(0x00000001 << 5u);
249  }
250 
257  {
258  return StatusMask(0x00000001 << 6u);
259  }
260 
266  inline static StatusMask sample_lost()
267  {
268  return StatusMask(0x00000001 << 7u);
269  }
270 
276  inline static StatusMask sample_rejected()
277  {
278  return StatusMask(0x00000001 << 8u);
279  }
280 
286  inline static StatusMask data_on_readers()
287  {
288  return StatusMask(0x00000001 << 9u);
289  }
290 
296  inline static StatusMask data_available()
297  {
298  return StatusMask(0x00000001 << 10u);
299  }
300 
306  inline static StatusMask liveliness_lost()
307  {
308  return StatusMask(0x00000001 << 11u);
309  }
310 
317  {
318  return StatusMask(0x00000001 << 12u);
319  }
320 
327  {
328  return StatusMask(0x00000001 << 13u);
329  }
330 
337  {
338  return StatusMask(0x00000001 << 14u);
339  }
340 
341 };
342 
343 }
344 }
345 } /* namespace dds / core / status*/
346 
347 
348 #endif /* OMG_DDS_CORE_STATUS_STATE_HPP_ */
dds::core::status::StatusMask::liveliness_lost
static StatusMask liveliness_lost()
Definition: State.hpp:306
dds::core::status::StatusMask::sample_lost
static StatusMask sample_lost()
Definition: State.hpp:266
dds::core::status::SampleRejectedState::MaskType
std::bitset< OMG_DDS_STATE_BIT_COUNT > MaskType
Definition: State.hpp:46
dds::core::status::SampleRejectedState::not_rejected
static SampleRejectedState not_rejected()
Definition: State.hpp:79
types.hpp
dds::core::status::StatusMask::data_available
static StatusMask data_available()
Definition: State.hpp:296
dds::core::status::StatusMask::MaskType
std::bitset< OMG_DDS_STATUS_COUNT > MaskType
Definition: State.hpp:150
dds::core::status::StatusMask
StatusMask is a bitmap or bitset field.
Definition: State.hpp:144
dds::core::status::SampleRejectedState::rejected_by_samples_limit
static SampleRejectedState rejected_by_samples_limit()
Definition: State.hpp:94
dds::core::status::StatusMask::publication_matched
static StatusMask publication_matched()
Definition: State.hpp:326
dds::core::status::StatusMask::sample_rejected
static StatusMask sample_rejected()
Definition: State.hpp:276
dds::core::status::StatusMask::subscription_matched
static StatusMask subscription_matched()
Definition: State.hpp:336
dds::core::status::StatusMask::none
static StatusMask none()
Definition: State.hpp:205
dds::core::status::StatusMask::data_on_readers
static StatusMask data_on_readers()
Definition: State.hpp:286
dds::core::status::SampleRejectedState
Class to contain the statistics about samples that have been rejected.
Definition: State.hpp:40
OMG_DDS_API
#define OMG_DDS_API
Definition: macros.hpp:52
dds::core::status::StatusMask::all
static StatusMask all()
Definition: State.hpp:195
operator<<
std::ostream & operator<<(std::ostream &os, const dds::sub::status::DataState &s)
dds::core::status::StatusMask::liveliness_changed
static StatusMask liveliness_changed()
Definition: State.hpp:316
dds
Definition: array.hpp:30
dds::core::status::StatusMask::requested_incompatible_qos
static StatusMask requested_incompatible_qos()
Definition: State.hpp:256
macros.hpp
dds::core::status::SampleRejectedState::rejected_by_samples_per_instance_limit
static SampleRejectedState rejected_by_samples_per_instance_limit()
Definition: State.hpp:124
dds::core::status::StatusMask::offered_deadline_missed
static StatusMask offered_deadline_missed()
Definition: State.hpp:226
dds::core::status::StatusMask::requested_deadline_missed
static StatusMask requested_deadline_missed()
Definition: State.hpp:236
dds::core::status::StatusMask::inconsistent_topic
static StatusMask inconsistent_topic()
Definition: State.hpp:216
dds::core::status::StatusMask::offered_incompatible_qos
static StatusMask offered_incompatible_qos()
Definition: State.hpp:246
dds::core::status::SampleRejectedState::rejected_by_instances_limit
static SampleRejectedState rejected_by_instances_limit()
Definition: State.hpp:109