A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > Class Template Reference

Generic "sequence number" class. More...

#include "sequence-number.h"

+ Inheritance diagram for ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >:
+ Collaboration diagram for ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >:

Public Member Functions

 SequenceNumber ()
 
 SequenceNumber (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &value)
 Constructs a SequenceNumber from a copy.
 
 SequenceNumber (NUMERIC_TYPE value)
 Constructs a SequenceNumber with the given value.
 
NUMERIC_TYPE GetValue () const
 Extracts the numeric value of the sequence number.
 
bool operator! () const =delete
 
bool operator!= (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
 Inequality operator for comparing sequence numbers.
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator% (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator& (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
 
bool operator&& (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
 
int operator* ()=delete
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator* (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator+ (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
 Operator defining addition of two sequence numbers.
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator+ (SIGNED_TYPE delta) const
 Addition operator for adding numeric value to sequence number.
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator++ ()
 Prefix increment operator.
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator++ (int)
 Postfix increment operator.
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & operator+= (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &)=delete
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & operator+= (SIGNED_TYPE value)
 Plus equals operator.
 
SIGNED_TYPE operator- (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
 Subtraction operator for subtracting sequence number from sequence number.
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator- (SIGNED_TYPE delta) const
 Subtraction operator for subtracting numeric value from sequence number.
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator-- ()
 Prefix decrement operator.
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator-- (int)
 Postfix decrement operator.
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & operator-= (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &)=delete
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & operator-= (SIGNED_TYPE value)
 Minus equals operator.
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator/ (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
 
bool operator< (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
 Less than operator for comparing sequence numbers.
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator<< (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
 
bool operator<= (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
 Less than or equal operator for comparing sequence numbers.
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & operator= (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &value)
 Constructs a SequenceNumber from an assignment of another sequence number.
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & operator= (NUMERIC_TYPE value)
 Constructs a SequenceNumber from an assignment of given value.
 
bool operator== (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
 Equality operator for comparing sequence number.
 
bool operator> (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
 Here is the critical part, how the comparison is made taking into account wrap-around.
 
bool operator>= (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
 Greater than or equal operator for comparing sequence numbers.
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator>> (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator^ (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator| (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
 
bool operator|| (const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
 
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator~ () const =delete
 

Private Attributes

NUMERIC_TYPE m_value
 Sequence number value.
 

Friends

template<typename NUMERIC_TYPE2 , typename SIGNED_TYPE2 >
std::ostream & operator<< (std::ostream &os, const SequenceNumber< NUMERIC_TYPE2, SIGNED_TYPE2 > &val)
 For printing sequence number.
 
template<typename NUMERIC_TYPE2 , typename SIGNED_TYPE2 >
std::istream & operator>> (std::istream &is, const SequenceNumber< NUMERIC_TYPE2, SIGNED_TYPE2 > &val)
 For loading sequence number from input streams.
 

Detailed Description

template<typename NUMERIC_TYPE, typename SIGNED_TYPE>
class ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >

Generic "sequence number" class.

This class can be used to handle sequence numbers. In networking protocols, sequence numbers are fixed precision integer numbers that are used to order events relative to each other. A sequence number is expected to increase over time but, since it has a limited number of bits, the number will "wrap around" from the maximum value that can represented with the given number of bits back to zero. For this reason, comparison of two sequence numbers, and subtraction, is non-trivial. The SequenceNumber class behaves like a number, with the usual arithmetic operators implemented, but knows how to correctly compare and subtract sequence numbers.

This is a templated class. To use it you need to supply two fundamental types as template parameters: NUMERIC_TYPE and SIGNED_TYPE. For instance, SequenceNumber<uint32_t, int32_t> gives you a 32-bit sequence number, while SequenceNumber<uint16_t, int16_t> is a 16-bit one. For your convenience, these are typedef'ed as SequenceNumber32 and SequenceNumber16, respectively.

Definition at line 50 of file sequence-number.h.

Constructor & Destructor Documentation

◆ SequenceNumber() [1/3]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::SequenceNumber ( )
inline

Definition at line 53 of file sequence-number.h.

Referenced by ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator+(), ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator+(), and ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator-().

+ Here is the caller graph for this function:

◆ SequenceNumber() [2/3]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::SequenceNumber ( NUMERIC_TYPE value)
inlineexplicit

Constructs a SequenceNumber with the given value.

Parameters
valuethe sequence number value

Definition at line 62 of file sequence-number.h.

◆ SequenceNumber() [3/3]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::SequenceNumber ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & value)
inline

Constructs a SequenceNumber from a copy.

Parameters
valuesequence number to copy

Definition at line 71 of file sequence-number.h.

Member Function Documentation

◆ GetValue()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
NUMERIC_TYPE ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::GetValue ( ) const
inline

Extracts the numeric value of the sequence number.

Returns
the sequence number value

Definition at line 111 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

Referenced by ns3::OpenFlowSwitchNetDevice::BufferFromPacket(), ns3::TcpTxBuffer::CopyFromSequence(), SequenceNumberTestCase::DoRun(), TcpFastRetrTest::FinalChecks(), ns3::TcpSocketBase::IsPacingEnabled(), ns3::lrwpan::LrWpanMac::McpsDataRequest(), ns3::lrwpan::LrWpanMac::MlmeAssociateResponse(), ns3::lrwpan::LrWpanMac::MlmeOrphanResponse(), ns3::lrwpan::LrWpanMac::MlmePollRequest(), ns3::TcpTxBuffer::NextSeg(), ns3::zigbee::ZigbeeNwk::NldeDataRequest(), ns3::zigbee::ZigbeeNwk::NlmeRouteDiscoveryRequest(), TcpFastRetrTest::ProcessedAck(), TcpFastRetrTest::RcvAck(), ns3::zigbee::ZigbeeNwk::ReceiveRREP(), TcpFastRetrTest::Rx(), TcpPktsAckedOpenTest::Rx(), TcpSlowStartNormalTest::Rx(), ns3::lrwpan::LrWpanMac::SendAssocRequestCommand(), ns3::lrwpan::LrWpanMac::SendBeaconRequestCommand(), ns3::zigbee::ZigbeeNwk::SendDataBcst(), ns3::lrwpan::LrWpanMac::SendDataRequestCommand(), ns3::zigbee::ZigbeeNwk::SendDataUcst(), ns3::TcpSocketSmallAcks::SendEmptyPacket(), ns3::lrwpan::LrWpanMac::SendOneBeacon(), ns3::lrwpan::LrWpanMac::SendOrphanNotificationCommand(), ns3::zigbee::ZigbeeNwk::SendRREP(), ns3::zigbee::ZigbeeNwk::SendRREQ(), ns3::TcpHeader::Serialize(), ns3::TcpOptionSack::Serialize(), TcpTxBufferTestCase::TestNextSeg(), anonymous_namespace{traced-value-callback-typedef-test-suite.cc}::TracedValueCbSink< SequenceNumber32 >(), TcpFastRetrTest::Tx(), and TcpTimeRtoTest::Tx().

+ Here is the caller graph for this function:

◆ operator!()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
bool ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator! ( ) const
delete

◆ operator!=()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
bool ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator!= ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & other) const
inline

Inequality operator for comparing sequence numbers.

Parameters
othersequence number to compare to this sequence number
Returns
true if the sequence numbers are not equal

Definition at line 293 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

◆ operator%()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator% ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ) const
delete

◆ operator&()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator& ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ) const
delete

◆ operator&&()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
bool ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator&& ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ) const
delete

◆ operator*() [1/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
int ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator* ( )
delete

◆ operator*() [2/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator* ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ) const
delete

◆ operator+() [1/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator+ ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & other) const
inline

Operator defining addition of two sequence numbers.

Parameters
othersequence number added to this
Returns
sequence number representing sum

Definition at line 185 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::SequenceNumber(), and ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

+ Here is the call graph for this function:

◆ operator+() [2/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator+ ( SIGNED_TYPE delta) const
inline

Addition operator for adding numeric value to sequence number.

Parameters
deltavalue to add to sequence number
Returns
sequence number representing sum

Definition at line 196 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::SequenceNumber(), and ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

+ Here is the call graph for this function:

◆ operator++() [1/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator++ ( )
inline

Prefix increment operator.

Returns
incremented sequence number

Definition at line 120 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

◆ operator++() [2/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator++ ( int )
inline

Postfix increment operator.

Returns
incremented sequence number

Definition at line 130 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

◆ operator+=() [1/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator+= ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & )
delete

◆ operator+=() [2/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator+= ( SIGNED_TYPE value)
inline

Plus equals operator.

Parameters
valuevalue to add to sequence number
Returns
incremented sequence number

Definition at line 163 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

◆ operator-() [1/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SIGNED_TYPE ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator- ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & other) const
inline

Subtraction operator for subtracting sequence number from sequence number.

Parameters
othersequence number to subtract from this sequence number
Returns
numeric value representing the difference

Definition at line 216 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

◆ operator-() [2/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator- ( SIGNED_TYPE delta) const
inline

Subtraction operator for subtracting numeric value from sequence number.

Parameters
deltavalue to subtract from sequence number
Returns
sequence number representing difference

Definition at line 206 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::SequenceNumber(), and ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

+ Here is the call graph for this function:

◆ operator--() [1/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator-- ( )
inline

Prefix decrement operator.

Returns
decremented sequence number

Definition at line 141 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

◆ operator--() [2/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator-- ( int )
inline

Postfix decrement operator.

Returns
decremented sequence number

Definition at line 151 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

◆ operator-=() [1/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator-= ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & )
delete

◆ operator-=() [2/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator-= ( SIGNED_TYPE value)
inline

Minus equals operator.

Parameters
valuevalue to subtract from sequence number
Returns
decremented sequence number

Definition at line 174 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

◆ operator/()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator/ ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ) const
delete

◆ operator<()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
bool ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator< ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & other) const
inline

Less than operator for comparing sequence numbers.

Parameters
othersequence number to compare to this sequence number
Returns
true if this sequence number is less than other

Definition at line 323 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value, and ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator>().

+ Here is the call graph for this function:

◆ operator<<()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator<< ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ) const
delete

◆ operator<=()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
bool ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator<= ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & other) const
inline

Less than or equal operator for comparing sequence numbers.

Parameters
othersequence number to compare to this sequence number
Returns
true if this sequence number is less than or equal to other

Definition at line 303 of file sequence-number.h.

◆ operator=() [1/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator= ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & value)
inline

Constructs a SequenceNumber from an assignment of another sequence number.

Parameters
valuesequence number to copy
Returns
reference to the assignee

Definition at line 92 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

◆ operator=() [2/2]

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator= ( NUMERIC_TYPE value)
inline

Constructs a SequenceNumber from an assignment of given value.

Parameters
valuesequence number to copy
Returns
reference to the assignee

Definition at line 81 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

◆ operator==()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
bool ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator== ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & other) const
inline

Equality operator for comparing sequence number.

Parameters
othersequence number to compare to this sequence number
Returns
true if the sequence numbers are equal

Definition at line 283 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

◆ operator>()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
bool ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator> ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & other) const
inline

Here is the critical part, how the comparison is made taking into account wrap-around.

From RFC 3626:

The sequence number S1 is said to be "greater than" the sequence number S2 if: S1 > S2 AND S1 - S2 <= MAXVALUE/2 OR S2 > S1 AND S2 - S1 > MAXVALUE/2

Parameters
othersequence number to compare to this one
Returns
true if this sequence number is greater than other

Definition at line 270 of file sequence-number.h.

References ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::m_value.

Referenced by ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator<().

+ Here is the caller graph for this function:

◆ operator>=()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
bool ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator>= ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & other) const
inline

Greater than or equal operator for comparing sequence numbers.

Parameters
othersequence number to compare to this sequence number
Returns
true if this sequence number is greater than or equal to other

Definition at line 313 of file sequence-number.h.

◆ operator>>()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator>> ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ) const
delete

◆ operator^()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator^ ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ) const
delete

◆ operator|()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator| ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ) const
delete

◆ operator||()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
bool ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator|| ( const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & ) const
delete

◆ operator~()

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::operator~ ( ) const
delete

Friends And Related Symbol Documentation

◆ operator<<

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
template<typename NUMERIC_TYPE2 , typename SIGNED_TYPE2 >
std::ostream & operator<< ( std::ostream & os,
const SequenceNumber< NUMERIC_TYPE2, SIGNED_TYPE2 > & val )
friend

For printing sequence number.

Parameters
osoutput stream
valsequence number to display
Returns
output stream os

◆ operator>>

template<typename NUMERIC_TYPE , typename SIGNED_TYPE >
template<typename NUMERIC_TYPE2 , typename SIGNED_TYPE2 >
std::istream & operator>> ( std::istream & is,
const SequenceNumber< NUMERIC_TYPE2, SIGNED_TYPE2 > & val )
friend

For loading sequence number from input streams.

Parameters
isinput stream
valsequence number to load
Returns
input stream is

Member Data Documentation

◆ m_value


The documentation for this class was generated from the following file: