#include <WindowPosition.h>
Inheritance diagram for WindowPosition::
Public Methods | |
WindowPosition () | |
Create a WindowPosition starting at zero, window size is set to 1. More... | |
WindowPosition (int size, int start=DONT_CARE) | |
Create a WindowPosition with a range of zero to size, starting at the location specified. More... | |
WindowPosition (const WindowPosition &) | |
Copy constructor. More... | |
virtual | ~WindowPosition () |
bool | withinRange (WindowPosition start, WindowPosition end) |
Return true if this WindowPosition is between the two passed in. More... | |
int | distanceTo (WindowPosition end) |
Measures the distance from this WindowPosition to the one specified. More... | |
int | getPosition () |
Returns the current position as an int. More... | |
int | getSeqNum () |
Return the sequence number. More... | |
bool | operator!= (WindowPosition value) |
Return true if the two window positions are not equal. More... | |
bool | operator== (WindowPosition value) |
Return true if the two window positions are equal. More... | |
int | incrementSeqNum () |
Adds one to the window position, and wraps around if necessary. More... | |
int | decrementSeqNum () |
Subtracts one from the window position, and wraps around if necessary. More... | |
WindowPosition | operator= (const WindowPosition &other) |
Same a copy constructor. More... | |
WindowPosition | operator+ (int value) |
Adds the value specified to the window position, and wraps around if necessary. More... | |
WindowPosition | operator- (int value) |
Subtracts the value specified from the window position, and wraps around if necessary. More... | |
virtual void | toStream (std::ostream &) |
Prints current position and size. More... | |
Private Attributes | |
int | m_seqNum |
int | m_seqNumSpace |
int | m_windowSize |
Both of these values are counters that must wrap around at some point, and each has a different value at which it wraps around.
Definition at line 4 of file WindowPosition.h.
|
Create a WindowPosition starting at zero, window size is set to 1.
Definition at line 15 of file WindowPosition.cpp. |
|
Create a WindowPosition with a range of zero to size, starting at the location specified.
Definition at line 26 of file WindowPosition.cpp. |
|
Copy constructor.
Definition at line 48 of file WindowPosition.cpp. |
|
Definition at line 14 of file WindowPosition.h. |
|
Subtracts one from the window position, and wraps around if necessary.
Definition at line 83 of file WindowPosition.cpp. |
|
Measures the distance from this WindowPosition to the one specified.
Definition at line 197 of file WindowPosition.cpp. Referenced by SendWindow::computeEffectiveWindow().
|
|
Returns the current position as an int.
Definition at line 216 of file WindowPosition.cpp. Referenced by SendWindow::addPacket(), ReceiveWindow::addPacket(), ReceiveWindow::calcCredits(), ReceiveWindow::calcMaxAck(), ReceiveWindow::canAdd(), ReceiveWindow::getNext(), SendWindow::onAckRecvd(), SendWindow::reliableSend(), SendWindow::sentPacketTimeoutImpl(), SendWindow::toStream(), and ReceiveWindow::toStream().
|
|
Return the sequence number.
Definition at line 225 of file WindowPosition.cpp. Referenced by ReceiveWindow::calcMaxAck(), SendWindow::computeEffectiveWindow(), ReceiveWindow::getNext(), SendWindow::onAckRecvd(), SendWindow::reliableSend(), ReceiveWindow::sendAck(), SendWindow::sendEmptyPacket(), and SendWindow::sentPacketTimeoutImpl().
|
|
Adds one to the window position, and wraps around if necessary.
Definition at line 71 of file WindowPosition.cpp. Referenced by ReceiveWindow::calcCredits(), ReceiveWindow::calcMaxAck(), and ReceiveWindow::getNext().
|
|
Return true if the two window positions are not equal.
Definition at line 129 of file WindowPosition.cpp. |
|
Adds the value specified to the window position, and wraps around if necessary.
Definition at line 95 of file WindowPosition.cpp. |
|
Subtracts the value specified from the window position, and wraps around if necessary.
Definition at line 110 of file WindowPosition.cpp. |
|
Same a copy constructor.
Definition at line 59 of file WindowPosition.cpp. |
|
Return true if the two window positions are equal.
Definition at line 149 of file WindowPosition.cpp. |
|
Prints current position and size.
Reimplemented from BasicObject. Definition at line 234 of file WindowPosition.cpp. |
|
Return true if this WindowPosition is between the two passed in. The check is inclusive, so that if this WindowPosition falls on a boundary, this will return true. The order of the arguments is very important. If one of the arguments has a DONT_CARE sequence number, this will return true.
Definition at line 163 of file WindowPosition.cpp. Referenced by ReceiveWindow::calcCredits(), and SendWindow::onAckRecvd().
|
|
Definition at line 32 of file WindowPosition.h. |
|
Definition at line 33 of file WindowPosition.h. |
|
Definition at line 34 of file WindowPosition.h. |