12#include "ns3/type-name.h"
49template <
typename NUMERIC_TYPE,
typename SIGNED_TYPE>
101 operator NUMERIC_TYPE ()
const
218 static const NUMERIC_TYPE maxValue = std::numeric_limits<NUMERIC_TYPE>::max();
219 static const NUMERIC_TYPE halfMaxValue = std::numeric_limits<NUMERIC_TYPE>::max() / 2;
223 if (diff < halfMaxValue)
225 return static_cast<SIGNED_TYPE
>(diff);
233 return -(
static_cast<SIGNED_TYPE
>(maxValue -
m_value + 1 + other.
m_value));
239 if (diff < halfMaxValue)
245 return -(
static_cast<SIGNED_TYPE
>(diff));
253 return static_cast<SIGNED_TYPE
>(maxValue - other.
m_value + 1 +
m_value);
272 static const NUMERIC_TYPE halfMaxValue = std::numeric_limits<NUMERIC_TYPE>::max() / 2;
305 return (!this->
operator>(other));
315 return (this->
operator>(other) || this->
operator==(other));
334 template <
typename NUMERIC_TYPE2,
typename SIGNED_TYPE2>
344 template <
typename NUMERIC_TYPE2,
typename SIGNED_TYPE2>
388template <
typename NUMERIC_TYPE,
typename SIGNED_TYPE>
403template <
typename NUMERIC_TYPE,
typename SIGNED_TYPE>
427namespace TracedValueCallback
Generic "sequence number" class.
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator%(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator--(int)
Postfix decrement 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+(SIGNED_TYPE delta) const
Addition operator for adding numeric value to 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.
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator++(int)
Postfix increment operator.
bool operator&&(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & operator+=(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &)=delete
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & operator-=(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &)=delete
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator|(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator-(SIGNED_TYPE delta) const
Subtraction operator for subtracting numeric value from sequence number.
bool operator<=(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
Less than or equal operator for comparing sequence numbers.
bool operator!() const =delete
bool operator!=(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
Inequality operator for comparing sequence numbers.
SequenceNumber(NUMERIC_TYPE value)
Constructs a SequenceNumber with the given value.
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=(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &value)
Constructs a SequenceNumber from an assignment of another sequence number.
bool operator==(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
Equality operator for comparing sequence number.
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator^(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & operator-=(SIGNED_TYPE value)
Minus equals operator.
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & operator+=(SIGNED_TYPE value)
Plus equals operator.
friend std::ostream & operator<<(std::ostream &os, const SequenceNumber< NUMERIC_TYPE2, SIGNED_TYPE2 > &val)
For printing sequence number.
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & operator=(NUMERIC_TYPE value)
Constructs a SequenceNumber from an assignment of given value.
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
NUMERIC_TYPE GetValue() const
Extracts the numeric value of the sequence number.
bool 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.
friend std::istream & operator>>(std::istream &is, const SequenceNumber< NUMERIC_TYPE2, SIGNED_TYPE2 > &val)
For loading sequence number from input streams.
SequenceNumber(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &value)
Constructs a SequenceNumber from a copy.
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator>>(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &) const =delete
NUMERIC_TYPE m_value
Sequence number value.
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator--()
Prefix decrement operator.
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator++()
Prefix increment operator.
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator~() const =delete
bool operator>=(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
Greater than or equal operator for comparing sequence numbers.
#define TYPENAMEGET_DEFINE(T)
Macro that defines a template specialization for TypeNameGet<T>() .
SequenceNumber< uint8_t, int8_t > SequenceNumber8
8 bit Sequence number.
SequenceNumber< uint32_t, int32_t > SequenceNumber32
32 bit Sequence number.
SequenceNumber< uint16_t, int16_t > SequenceNumber16
16 bit Sequence number.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
std::istream & operator>>(std::istream &is, Angles &a)