Public Member Functions

sp::network::NetworkPacket Class Reference
[Network System]

#include <spNetworkPacket.hpp>

List of all members.

Public Member Functions

 NetworkPacket (u32 Descriptor=0)
 NetworkPacket (const NetworkPacket &Other)
 NetworkPacket (const void *Buffer, u32 BufferSize, u32 Descriptor=0, bool isSetLowLevel=false)
 NetworkPacket (const io::stringc &String, u32 Descriptor=0)
 ~NetworkPacket ()
io::stringc getString () const
 Returns the packet as a string but only if this packet is a null-terminated string.
bool compareString (const io::stringc &Str) const
 Returns true if the given string equals the network packet data as string.
void setDescriptor (u32 Descriptor)
 Sets the descriptor. The descriptor is used to identify the purpose of the packet when received by another network member.
u32 getDescriptor () const
 Returns the descriptor.
void setReceiverAddress (u32 IPAddress)
 Sets the receiver IP address. This is only used for a client/server model.
u32 getReceiverAddress () const
 Returns the receiver IP address. This is only used for a client/server model.
c8getBuffer ()
 Returns a byte (or rather char) pointer to the packet data.
const c8getBuffer () const
const c8getRealBuffer () const
u32 getRealBufferSize () const
u32 getBufferSize () const
 Returns the local buffer size. This is the size (in bytes) of the packet data field.

Detailed Description

NetworkPacket is used as wrapping class around a packet which can be send and/or received over the network.


Constructor & Destructor Documentation

sp::network::NetworkPacket::NetworkPacket ( u32  Descriptor = 0  ) 
sp::network::NetworkPacket::NetworkPacket ( const NetworkPacket Other  ) 
sp::network::NetworkPacket::NetworkPacket ( const void *  Buffer,
u32  BufferSize,
u32  Descriptor = 0,
bool  isSetLowLevel = false 
)
sp::network::NetworkPacket::NetworkPacket ( const io::stringc String,
u32  Descriptor = 0 
)
sp::network::NetworkPacket::~NetworkPacket (  ) 

Member Function Documentation

bool sp::network::NetworkPacket::compareString ( const io::stringc Str  )  const

Returns true if the given string equals the network packet data as string.

const c8* sp::network::NetworkPacket::getBuffer (  )  const [inline]
c8* sp::network::NetworkPacket::getBuffer (  )  [inline]

Returns a byte (or rather char) pointer to the packet data.

u32 sp::network::NetworkPacket::getBufferSize (  )  const [inline]

Returns the local buffer size. This is the size (in bytes) of the packet data field.

u32 sp::network::NetworkPacket::getDescriptor (  )  const

Returns the descriptor.

const c8* sp::network::NetworkPacket::getRealBuffer (  )  const [inline]

Returns a constant pointer to the real buffer. This is used internally and should not be used to get the buffer of transmitted network data. use "getBuffer" instead.

See also:
getBuffer
u32 sp::network::NetworkPacket::getRealBufferSize (  )  const [inline]

Returns the real buffer size. This is the size (in bytes) of the actual network packet (including protocol information). This is used internally and should not be used to get the buffer size of send network data.

See also:
getBufferSize
u32 sp::network::NetworkPacket::getReceiverAddress (  )  const

Returns the receiver IP address. This is only used for a client/server model.

io::stringc sp::network::NetworkPacket::getString (  )  const

Returns the packet as a string but only if this packet is a null-terminated string.

void sp::network::NetworkPacket::setDescriptor ( u32  Descriptor  ) 

Sets the descriptor. The descriptor is used to identify the purpose of the packet when received by another network member.

void sp::network::NetworkPacket::setReceiverAddress ( u32  IPAddress  ) 

Sets the receiver IP address. This is only used for a client/server model.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines