itpp::Sequence_Number Class Reference

`#include <itpp/protocol/tcp.h>`

## Public Member Functions

| Sequence_Number ()
| Default constructor.
| Sequence_Number (const Sequence_Number &n)
| ADD DOCUMENTATION HERE.
Sequence_Number & | operator= (const Sequence_Number &n)
| ADD DOCUMENTATION HERE.
Sequence_Number & | operator= (const int &rep)
| ADD DOCUMENTATION HERE.
bool | operator== (const Sequence_Number &n) const
| ADD DOCUMENTATION HERE.
bool | operator!= (const Sequence_Number &n) const
| ADD DOCUMENTATION HERE.
bool | operator> (const Sequence_Number &n) const
| ADD DOCUMENTATION HERE.
bool | operator>= (const Sequence_Number &n) const
| ADD DOCUMENTATION HERE.
bool | operator< (const Sequence_Number &n) const
| ADD DOCUMENTATION HERE.
bool | operator<= (const Sequence_Number &n) const
| ADD DOCUMENTATION HERE.
Sequence_Number | operator+ (const int n) const
| ADD DOCUMENTATION HERE.
Sequence_Number & | operator+= (const int n)
| ADD DOCUMENTATION HERE.
Sequence_Number | operator- (const int n) const
| ADD DOCUMENTATION HERE.
Sequence_Number & | operator-= (const int n)
| ADD DOCUMENTATION HERE.
int | operator- (const Sequence_Number &n) const
| ADD DOCUMENTATION HERE.
int | value () const
| Access to internal representation.

## Protected Member Functions

| Sequence_Number (int n)
| ADD DOCUMENTATION HERE.

## Protected Attributes

int | seq
| ADD DOCUMENTATION HERE.

## Friends

Sequence_Number | operator+ (const int n1, const Sequence_Number &n2)
| ADD DOCUMENTATION HERE.
std::ostream & | operator<< (std::ostream &os, const Sequence_Number &n)
| ADD DOCUMENTATION HERE.

## Detailed Description

TSequenceNumber represents a sequence number in a byte stream. As simulations may get quite long sequence numbers based on 32 bit integers may overflow. This is not a major problem as long as this overflow is considered when comparing sequence numbers. TSequenceNumber defines relational operators base on subtraction instead of using built-in int relational operators. This approach works well for arbitrary long simulations as long as the "real" sequence numbers (i.e. the numbers seen without overflow) compared to each other do not differ by more than 2^31-1 (INT_MAX) which is not a serious restriction in a realistic TCP scenario.

See also
  TTCPSegment

Author
  Bodamer

Definition at line 71 of file tcp.h.

## Constructor & Destructor Documentation

## Sequence_Number() [1/3]

itpp::Sequence_Number::Sequence_Number | ( |  | ) |

inline

Default constructor.

Definition at line 75 of file tcp.h.

References seq.

Referenced by operator!=(), operator+(), operator+, operator+=(), operator-(), operator-(), operator-=(), operator<(), operator<<, operator<=(), operator=(), operator=(), operator==(), operator>(), operator>=(), and Sequence_Number().

## Sequence_Number() [2/3]

itpp::Sequence_Number::Sequence_Number | ( | const Sequence_Number & | n | ) |

inline

ADD DOCUMENTATION HERE.

Definition at line 77 of file tcp.h.

References seq, and Sequence_Number().

## Sequence_Number() [3/3]

itpp::Sequence_Number::Sequence_Number | ( | int | n | ) |

inline protected

ADD DOCUMENTATION HERE.

Definition at line 119 of file tcp.h.

References seq.

## Member Function Documentation

## operator=() [1/2]

Sequence_Number & itpp::Sequence_Number::operator= | ( | const Sequence_Number & | n | ) |

inline

ADD DOCUMENTATION HERE.

Definition at line 79 of file tcp.h.

References seq, and Sequence_Number().

## operator=() [2/2]

Sequence_Number & itpp::Sequence_Number::operator= | ( | const int & | rep | ) |

inline

ADD DOCUMENTATION HERE.

Definition at line 81 of file tcp.h.

References seq, and Sequence_Number().

## operator==()

bool itpp::Sequence_Number::operator== | ( | const Sequence_Number & | n | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 85 of file tcp.h.

References seq, and Sequence_Number().

## operator!=()

bool itpp::Sequence_Number::operator!= | ( | const Sequence_Number & | n | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 87 of file tcp.h.

References seq, and Sequence_Number().

## operator>()

bool itpp::Sequence_Number::operator> | ( | const Sequence_Number & | n | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 89 of file tcp.h.

References seq, and Sequence_Number().

## operator>=()

bool itpp::Sequence_Number::operator>= | ( | const Sequence_Number & | n | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 91 of file tcp.h.

References seq, and Sequence_Number().

## operator<()

bool itpp::Sequence_Number::operator< | ( | const Sequence_Number & | n | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 93 of file tcp.h.

References seq, and Sequence_Number().

## operator<=()

bool itpp::Sequence_Number::operator<= | ( | const Sequence_Number & | n | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 95 of file tcp.h.

References seq, and Sequence_Number().

## operator+()

Sequence_Number itpp::Sequence_Number::operator+ | ( | const int | n | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 99 of file tcp.h.

References seq, and Sequence_Number().

## operator+=()

Sequence_Number & itpp::Sequence_Number::operator+= | ( | const int | n | ) |

inline

ADD DOCUMENTATION HERE.

Definition at line 101 of file tcp.h.

References seq, and Sequence_Number().

## operator-() [1/2]

Sequence_Number itpp::Sequence_Number::operator- | ( | const int | n | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 103 of file tcp.h.

References seq, and Sequence_Number().

## operator-=()

Sequence_Number & itpp::Sequence_Number::operator-= | ( | const int | n | ) |

inline

ADD DOCUMENTATION HERE.

Definition at line 105 of file tcp.h.

References seq, and Sequence_Number().

## operator-() [2/2]

int itpp::Sequence_Number::operator- | ( | const Sequence_Number & | n | ) | const

inline

ADD DOCUMENTATION HERE.

Definition at line 107 of file tcp.h.

References seq, and Sequence_Number().

## value()

int itpp::Sequence_Number::value | ( |  | ) | const

inline

Access to internal representation.

Definition at line 110 of file tcp.h.

References seq.

## Friends And Related Symbol Documentation

## operator+

Sequence_Number operator+ | ( | const int | n1,
|  | const Sequence_Number & | n2 )

friend

ADD DOCUMENTATION HERE.

Definition at line 113 of file tcp.h.

References seq, and Sequence_Number().

## operator<<

std::ostream & operator<< | ( | std::ostream & | os,
|  | const Sequence_Number & | n )

friend

ADD DOCUMENTATION HERE.

Definition at line 115 of file tcp.h.

References seq, and Sequence_Number().

## Member Data Documentation

## seq

int itpp::Sequence_Number::seq

protected

ADD DOCUMENTATION HERE.

Definition at line 121 of file tcp.h.

Referenced by operator!=(), operator+(), operator+, operator+=(), operator-(), operator-(), operator-=(), operator<(), operator<<, operator<=(), operator=(), operator=(), operator==(), operator>(), operator>=(), Sequence_Number(), Sequence_Number(), Sequence_Number(), and value().

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

- itpp/protocol/tcp.h

Generated on for IT++ by Doxygen 1.15.0