DisjointSequence.inl

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

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1