Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

TCPSegment Class Reference

#include <TCPSegment.h>

Inheritance diagram for TCPSegment:

TCPSegment_Base List of all members.

Detailed Description

Represents a TCP segment. More info in the TCPSegment.msg file (and the documentation generated from it).


Public Member Functions

 TCPSegment (const char *name=NULL, int kind=0)
 TCPSegment (const TCPSegment &other)
TCPSegmentoperator= (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 TCPPayloadMessagepayload (unsigned int k)
virtual void addPayloadMessage (cMessage *msg, uint32 endSequenceNo)
virtual cMessage * removeFirstPayloadMessage (uint32 &outEndSequenceNo)

Protected Attributes

std::list< TCPPayloadMessagepayloadList


Constructor & Destructor Documentation

TCPSegment::TCPSegment const char *  name = NULL,
int  kind = 0
[inline]
 

00037 : TCPSegment_Base(name,kind) {}

TCPSegment::TCPSegment const TCPSegment other  )  [inline]
 

00038 : TCPSegment_Base(other.name()) {operator=(other);}


Member Function Documentation

void TCPSegment::addPayloadMessage cMessage *  msg,
uint32  endSequenceNo
[virtual]
 

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 }

virtual cObject* TCPSegment::dup  )  const [inline, virtual]
 

Reimplemented from TCPSegment_Base.

00040 {return new TCPSegment(*this);}

TCPSegment & TCPSegment::operator= const TCPSegment other  ) 
 

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 }

TCPPayloadMessage & TCPSegment::payload unsigned int  k  )  [virtual]
 

Returns the kth payload message in this TCP segment

Implements TCPSegment_Base.

00046 {
00047     std::list<TCPPayloadMessage>::iterator i = payloadList.begin();
00048     while (k>0 && i!=payloadList.end())
00049         (++i, --k);
00050     return *i;
00051 }

unsigned int TCPSegment::payloadArraySize  )  const [virtual]
 

Returns the number of payload messages in this TCP segment

Implements TCPSegment_Base.

00041 {
00042     return payloadList.size();
00043 }

cMessage * TCPSegment::removeFirstPayloadMessage uint32 outEndSequenceNo  )  [virtual]
 

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 }

void TCPSegment::setPayload unsigned int  k,
const TCPPayloadMessage payload_var
[virtual]
 

Generated but unused method, should not be called.

Implements TCPSegment_Base.

00054 {
00055     throw new cException(this, "setPayload() not supported, use addPayloadMessage()");
00056 }

void TCPSegment::setPayloadArraySize unsigned int  size  )  [virtual]
 

Generated but unused method, should not be called.

Implements TCPSegment_Base.

00036 {
00037     throw new cException(this, "setPayloadArraySize() not supported, use addPayloadMessage()");
00038 }


Member Data Documentation

std::list<TCPPayloadMessage> TCPSegment::payloadList [protected]
 


The documentation for this class was generated from the following files:
Generated on Thu Oct 19 18:22:31 2006 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.0