00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 namespace OpenDDS { 00009 namespace DCPS { 00010 00011 ACE_INLINE SequenceNumber 00012 DisjointSequence::low() const 00013 { 00014 return sequences_.begin()->first; 00015 } 00016 00017 ACE_INLINE SequenceNumber 00018 DisjointSequence::high() const 00019 { 00020 return sequences_.rbegin()->second; 00021 } 00022 00023 ACE_INLINE SequenceNumber 00024 DisjointSequence::cumulative_ack() const 00025 { 00026 return sequences_.empty() 00027 ? SequenceNumber::SEQUENCENUMBER_UNKNOWN() 00028 : sequences_.begin()->second; 00029 } 00030 00031 ACE_INLINE SequenceNumber 00032 DisjointSequence::last_ack() const 00033 { 00034 return sequences_.empty() 00035 ? SequenceNumber::SEQUENCENUMBER_UNKNOWN() 00036 : sequences_.rbegin()->first; 00037 } 00038 00039 ACE_INLINE bool 00040 DisjointSequence::empty() const 00041 { 00042 return sequences_.empty(); 00043 } 00044 00045 ACE_INLINE bool 00046 DisjointSequence::disjoint() const 00047 { 00048 return sequences_.size() > 1; 00049 } 00050 00051 ACE_INLINE 00052 DisjointSequence::DisjointSequence() 00053 : sequences_(SequenceRange_LessThan) 00054 { 00055 } 00056 00057 ACE_INLINE void 00058 DisjointSequence::reset() 00059 { 00060 sequences_.clear(); 00061 } 00062 00063 ACE_INLINE bool 00064 DisjointSequence::insert(SequenceNumber value) 00065 { 00066 return insert_i(SequenceRange(value, value)); 00067 } 00068 00069 ACE_INLINE bool 00070 DisjointSequence::insert(const SequenceRange& range) 00071 { 00072 return insert_i(range); 00073 } 00074 00075 ACE_INLINE bool 00076 DisjointSequence::insert(const SequenceRange& range, 00077 OPENDDS_VECTOR(SequenceRange)& gaps) 00078 { 00079 return insert_i(range, &gaps); 00080 } 00081 00082 } // namespace DCPS 00083 } // namespace OpenDDS