NetPacket Class Reference

#include <NetPacket.h>

Inheritance diagram for NetPacket:

Packet List of all members.

Public Member Functions

 NetPacket (const char *data, Uint32 size)
char * getData ()
virtual ~NetPacket ()

Public Attributes

char * data
Uint32 len

Detailed Description

Represents a packet that will successively be sent trought network.

Definition at line 12 of file NetPacket.h.


Constructor & Destructor Documentation

NetPacket::NetPacket const char *  data,
Uint32  size
 

Constructs a packet that will be sent throught a Connection.

The data passed as the first parameter of this constructor must have been previuosly prepared. This ensure abstraction from the network protocol we will choose.

Author:
stonedz
Since:
pre-alpha
Parameters:
data Pre-formatted data as a char array.
lenght Data lenght.

Definition at line 4 of file NetPacket.cpp.

00005         :data(new char[size]),
00006         len(size)
00007 {
00008     memcpy(this->data, data, size);
00009 }

NetPacket::~NetPacket  )  [virtual]
 

Cleans memory and destroys packet.

Author:
stonedz
Since:
pre-alpha

Definition at line 11 of file NetPacket.cpp.

00011                      {
00012         delete[] data;
00013 }


Member Function Documentation

char * NetPacket::getData  ) 
 

Returns current packet's data.

Author:
stonedz
Since:
pre-alpha
Deprecated:

Definition at line 15 of file NetPacket.cpp.

00015                         {       
00016         return this->data;
00017 }


Member Data Documentation

char* NetPacket::data
 

Packet's data

Definition at line 47 of file NetPacket.h.

Referenced by Connection::putMessage(), and MessageIn::readString().


The documentation for this class was generated from the following files:
Generated on Mon Dec 3 04:30:14 2007 for lo-testserver by  doxygen 1.3.9.1