#include <TCPSegment.h>
Public Member Functions | |
| TCPSegment (const char *name=NULL, int kind=0) | |
| TCPSegment (const TCPSegment &other) | |
| TCPSegment & | operator= (const TCPSegment &other) |
| virtual cObject * | dup () const |
| virtual void | setPayloadArraySize (unsigned int size) |
| virtual void | setPayload (unsigned int k, const TCPPayloadMessage &payload_var) |
| virtual unsigned int | payloadArraySize () const |
| virtual TCPPayloadMessage & | payload (unsigned int k) |
| virtual void | addPayloadMessage (cMessage *msg, uint32 endSequenceNo) |
| virtual cMessage * | removeFirstPayloadMessage (uint32 &outEndSequenceNo) |
Protected Attributes | |
| std::list< TCPPayloadMessage > | payloadList |
|
||||||||||||
|
00037 : TCPSegment_Base(name,kind) {}
|
|
|
00038 : TCPSegment_Base(other.name()) {operator=(other);}
|
|
||||||||||||
|
Adds a message object to the TCP segment. The sequence number+1 of the last byte of the message should be passed as 2nd argument 00059 {
00060 take(msg);
00061
00062 TCPPayloadMessage payload;
00063 payload.endSequenceNo = endSequenceNo;
00064 payload.msg = msg;
00065 payloadList.push_back(payload);
00066 }
|
|
|
00040 {return new TCPSegment(*this);}
|
|
|
00026 {
00027 TCPSegment_Base::operator=(other);
00028
00029 for (std::list<TCPPayloadMessage>::const_iterator i=other.payloadList.begin(); i!=other.payloadList.end(); ++i)
00030 addPayloadMessage((cMessage *)i->msg->dup(), i->endSequenceNo);
00031
00032 return *this;
00033 }
|
|
|
Returns the kth payload message in this TCP segment 00046 {
00047 std::list<TCPPayloadMessage>::iterator i = payloadList.begin();
00048 while (k>0 && i!=payloadList.end())
00049 (++i, --k);
00050 return *i;
00051 }
|
|
|
Returns the number of payload messages in this TCP segment 00041 {
00042 return payloadList.size();
00043 }
|
|
|
Removes and returns the first message object in this TCP segment. It also returns the sequence number+1 of its last octet in outEndSequenceNo. 00069 {
00070 if (payloadList.empty())
00071 return NULL;
00072
00073 cMessage *msg = payloadList.front().msg;
00074 endSequenceNo = payloadList.front().endSequenceNo;
00075 payloadList.pop_front();
00076 drop(msg);
00077 return msg;
00078 }
|
|
||||||||||||
|
Generated but unused method, should not be called. 00054 {
00055 throw new cException(this, "setPayload() not supported, use addPayloadMessage()");
00056 }
|
|
|
Generated but unused method, should not be called. 00036 {
00037 throw new cException(this, "setPayloadArraySize() not supported, use addPayloadMessage()");
00038 }
|
|
|
|
1.4.1