51 template<
typename NUMERIC_TYPE,
typename SIGNED_TYPE>
88 operator NUMERIC_TYPE ()
const
162 static const NUMERIC_TYPE maxValue = std::numeric_limits<NUMERIC_TYPE>::max ();
163 static const NUMERIC_TYPE halfMaxValue = std::numeric_limits<NUMERIC_TYPE>::max () / 2;
167 if (diff < halfMaxValue)
169 return static_cast<SIGNED_TYPE
> (diff);
177 return -(
static_cast<SIGNED_TYPE
> (maxValue -
m_value + 1 + other.
m_value));
183 if (diff < halfMaxValue)
189 return -(
static_cast<SIGNED_TYPE
> (diff));
197 return static_cast<SIGNED_TYPE
> (maxValue - other.
m_value + 1 +
m_value);
214 static const NUMERIC_TYPE halfMaxValue = std::numeric_limits<NUMERIC_TYPE>::max () / 2;
230 bool operator <= (const SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> &other)
const
232 return (!this->
operator> (other));
237 return (this->
operator> (other) || this->
operator== (other));
240 bool operator < (const SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> &other)
const
246 template<
typename NUMERIC_TYPE2,
typename SIGNED_TYPE2>
247 friend std::ostream & operator<< (std::ostream& os, const SequenceNumber<NUMERIC_TYPE2, SIGNED_TYPE2> &val);
249 template<
typename NUMERIC_TYPE2,
typename SIGNED_TYPE2>
275 template<
typename NUMERIC_TYPE,
typename SIGNED_TYPE>
277 operator<< (std::ostream& os, const SequenceNumber<NUMERIC_TYPE, SIGNED_TYPE> &val)
283 template<
typename NUMERIC_TYPE,
typename SIGNED_TYPE>
bool operator!=(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
std::istream & operator>>(std::istream &is, Angles &a)
NUMERIC_TYPE GetValue() const
Extracts the numeric value of the sequence number.
bool operator&&(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &b) const
bool operator||(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &b) const
bool operator==(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
bool operator>(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator/(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &b) const
SequenceNumber< uint32_t, int32_t > SequenceNumber32
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator&(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &b) const
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator^(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &b) const
bool operator>=(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator+(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &other) const
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & operator=(NUMERIC_TYPE value)
SequenceNumber(SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > const &value)
Generic "sequence number" class.
SequenceNumber< uint16_t, int16_t > SequenceNumber16
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & operator+=(SIGNED_TYPE value)
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator|(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &b) const
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator%(const SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > &b) const
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator++()
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator~() const
friend std::istream & operator>>(std::istream &is, const SequenceNumber< NUMERIC_TYPE2, SIGNED_TYPE2 > &val)
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator--()
SequenceNumber(NUMERIC_TYPE value)
Constructs a SequenceNumber with the given value.
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > & operator-=(SIGNED_TYPE value)
SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE > operator-(SIGNED_TYPE delta) const