Drag[en]gine Game Engine  1.21
deNetworkMessage Class Reference

Network Message Class. More...

#include <deNetworkMessage.h>

Inheritance diagram for deNetworkMessage:
deObject

Public Types

typedef deTObjectReference< deNetworkMessageRef
 Type holding strong reference. More...
 
- Public Types inherited from deObject
typedef deTObjectReference< deObjectRef
 Type holding strong reference. More...
 

Public Member Functions

Management
uint8_t * GetBuffer () const
 Buffer data. More...
 
int GetDataLength () const
 Length of the message data. More...
 
void SetDataLength (int dataLength)
 Set length of the message data. More...
 
void Clear ()
 Clear message data. More...
 
TIME_SYSTEM GetTimeStamp () const
 Time stamp. More...
 
void SetTimeStamp (TIME_SYSTEM timeStamp)
 Set time stamp. More...
 
- Public Member Functions inherited from deObject
int GetRefCount () const
 Reference count. More...
 
void AddReference ()
 Add reference increasing reference count by 1. More...
 
void FreeReference ()
 Decrease reference count by one and delete object if count reaches 0. More...
 
 deObject ()
 Create object with reference count of 1. More...
 

Constructors and Destructors

 deNetworkMessage ()
 Create network message object. More...
 
virtual ~deNetworkMessage ()
 Clean up network message object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from deObject
virtual ~deObject ()
 Clean up object. More...
 

Detailed Description

Network Message Class.

Manages a network message of variable length. Supports reading and writing to the message providing basic data types. Reading and writing is done like with a file stream with a stream position which is the same for reading and writing as well as end of message functions. An exception is raised if an attempt is made to read past the end of the message. The buffer is increased in size if a write attempt is made past the end of the message. This way the buffer can be filled with data making the message grow to the required size to hold all data. To Read data of a given size the SetLength call can be used to resize the buffer to at last a given length before reading the data into the messagchare.

Member Typedef Documentation

◆ Ref

Type holding strong reference.

Constructor & Destructor Documentation

◆ deNetworkMessage()

deNetworkMessage::deNetworkMessage ( )

Create network message object.

◆ ~deNetworkMessage()

virtual deNetworkMessage::~deNetworkMessage ( )
protectedvirtual

Clean up network message object.

Note
Subclasses should set their destructor protected too to avoid users accidently deleting a reference counted object through the object pointer. Only FreeReference() is allowed to delete the object.

Member Function Documentation

◆ Clear()

void deNetworkMessage::Clear ( )

Clear message data.

◆ GetBuffer()

uint8_t* deNetworkMessage::GetBuffer ( ) const
inline

Buffer data.

◆ GetDataLength()

int deNetworkMessage::GetDataLength ( ) const
inline

Length of the message data.

◆ GetTimeStamp()

TIME_SYSTEM deNetworkMessage::GetTimeStamp ( ) const
inline

Time stamp.

◆ SetDataLength()

void deNetworkMessage::SetDataLength ( int  dataLength)

Set length of the message data.

◆ SetTimeStamp()

void deNetworkMessage::SetTimeStamp ( TIME_SYSTEM  timeStamp)

Set time stamp.


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