orxonox::packet::Packet Class Reference

#include <src/network/packet/Packet.h>

Inheritance diagram for orxonox::packet::Packet:

orxonox::packet::Acknowledgement orxonox::packet::Chat orxonox::packet::ClassID orxonox::packet::DeleteObjects orxonox::packet::FunctionCalls orxonox::packet::FunctionIDs orxonox::packet::Gamestate orxonox::packet::Welcome

List of all members.

Public Member Functions

int getClientID ()
virtual unsigned char * getData ()
uint32_t getFlags ()
virtual unsigned int getSize () const =0
 Packet (const Packet &p)
virtual bool process ()=0
bool send ()
void setClientID (int id)
virtual ~Packet ()
 Destroys a packet completely.

Static Public Member Functions

static PacketcreatePacket (ENetPacket *packet, ENetPeer *peer)
static void deletePacket (ENetPacket *packet)
 ENet calls this method whenever it wants to destroy a packet that contains data we allocated ourselves.

Protected Member Functions

bool isDataENetAllocated () const
 Packet (uint8_t *data, unsigned int clientID)
 Packet ()

Protected Attributes

bool bDataENetAllocated_
unsigned int clientID_
uint8_t * data_
uint32_t flags_
Direction::Value packetDirection_

Private Attributes

ENetPacketenetPacket_

Static Private Attributes

static std::map< size_t, Packet * > packetMap_


Detailed Description

Author:
Oliver Scheuss <scheusso [at] ee.ethz.ch>

Constructor & Destructor Documentation

orxonox::packet::Packet::Packet ( const Packet p  ) 

orxonox::packet::Packet::~Packet (  )  [virtual]

Destroys a packet completely.

That also means destroying the ENetPacket if one exists. There

References bDataENetAllocated_, data_, and enetPacket_.

orxonox::packet::Packet::Packet (  )  [protected]

orxonox::packet::Packet::Packet ( uint8_t *  data,
unsigned int  clientID 
) [protected]


Member Function Documentation

Packet * orxonox::packet::Packet::createPacket ( ENetPacket packet,
ENetPeer peer 
) [static]

void orxonox::packet::Packet::deletePacket ( ENetPacket packet  )  [static]

ENet calls this method whenever it wants to destroy a packet that contains data we allocated ourselves.

References COUT, and packetMap_.

Referenced by send().

int orxonox::packet::Packet::getClientID (  )  [inline]

virtual unsigned char* orxonox::packet::Packet::getData (  )  [inline, virtual]

Reimplemented in orxonox::packet::Welcome.

Referenced by send().

uint32_t orxonox::packet::Packet::getFlags (  )  [inline]

Referenced by send().

virtual unsigned int orxonox::packet::Packet::getSize (  )  const [pure virtual]

bool orxonox::packet::Packet::isDataENetAllocated (  )  const [inline, protected]

virtual bool orxonox::packet::Packet::process (  )  [pure virtual]

bool orxonox::packet::Packet::send (  ) 

void orxonox::packet::Packet::setClientID ( int  id  )  [inline]


Member Data Documentation

Tells whether data_ was allocated by ENet or ourselves. data_ might no correlate with enetPacket_->data.

Referenced by createPacket(), orxonox::packet::Gamestate::decompressData(), Packet(), and ~Packet().

unsigned int orxonox::packet::Packet::clientID_ [protected]

uint8_t* orxonox::packet::Packet::data_ [protected]

Referenced by createPacket(), Packet(), send(), and ~Packet().

uint32_t orxonox::packet::Packet::flags_ [protected]

std::map< size_t, Packet * > orxonox::packet::Packet::packetMap_ [static, private]

Referenced by deletePacket(), and send().


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

Generated on Tue Jul 28 16:23:24 2009 for Orxonox by  doxygen 1.5.6