OpenDDS  Snapshot(2023/04/28-20:55)
DisjointSequence.inl
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
9 
10 namespace OpenDDS {
11 namespace DCPS {
12 
13 ACE_INLINE SequenceNumber
15 {
16  return sequences_.begin()->first;
17 }
18 
21 {
22  return sequences_.rbegin()->second;
23 }
24 
27 {
28  return sequences_.empty()
30  : sequences_.begin()->second;
31 }
32 
35 {
36  return sequences_.empty()
38  : sequences_.rbegin()->first;
39 }
40 
41 ACE_INLINE bool
43 {
44  return sequences_.empty();
45 }
46 
47 ACE_INLINE bool
49 {
50  return sequences_.size() > 1;
51 }
52 
55 {
56 }
57 
58 ACE_INLINE void
60 {
61  sequences_.clear();
62 }
63 
64 ACE_INLINE bool
66 {
67  return insert_i(SequenceRange(value, value));
68 }
69 
70 ACE_INLINE bool
72 {
73  return insert_i(range);
74 }
75 
76 ACE_INLINE bool
79 {
80  return insert_i(range, &gaps);
81 }
82 
83 ACE_INLINE bool
85 {
86  for (SequenceNumber i = range.first; i <= range.second; ++i) {
87  if (filter.contains(i) && !insert(i)) {
88  return false;
89  }
90  }
91  return true;
92 }
93 
95 DisjointSequence::present_sequence_ranges() const
96 {
99  return present;
100 }
101 
102 ACE_INLINE bool
104 {
105  return sequences_.has(value);
106 }
107 
108 ACE_INLINE bool
110 {
111  return sequences_.has_any(range);
112 }
113 
114 } // namespace DCPS
115 } // namespace OpenDDS
116 
const LogLevel::Value value
Definition: debug.cpp:61
SequenceBackInsertIterator< Sequence > back_inserter(Sequence &seq)
SequenceNumber cumulative_ack() const
bool insert_i(const SequenceRange &range, OPENDDS_VECTOR(SequenceRange) *gaps=0)
OPENDDS_VECTOR(SequenceRange) missing_sequence_ranges() const
Returns missing ranges of SequenceNumbers (internal gaps in the sequence)
bool insert_filtered(const SequenceRange &range, const DisjointSequence &filter)
Insert the intersection of range and filter.
bool contains_any(const SequenceRange &range) const
SequenceNumber last_ack() const
bool contains(SequenceNumber value) const
bool insert(const SequenceRange &range, OPENDDS_VECTOR(SequenceRange)&added)
std::pair< SequenceNumber, SequenceNumber > SequenceRange
Sequence number abstraction. Only allows positive 64 bit values.
static SequenceNumber SEQUENCENUMBER_UNKNOWN()
DDS::ReturnCode_t copy(DDS::DynamicData_ptr dest, DDS::DynamicData_ptr src)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
#define ACE_INLINE
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28