Drag[en]gine Game Engine
1.21
|
Network Message Class. More...
#include <deNetworkMessage.h>
Public Types | |
typedef deTObjectReference< deNetworkMessage > | Ref |
Type holding strong reference. More... | |
Public Types inherited from deObject | |
typedef deTObjectReference< deObject > | Ref |
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... | |
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.
Type holding strong reference.
deNetworkMessage::deNetworkMessage | ( | ) |
Create network message object.
|
protectedvirtual |
Clean up network message object.
void deNetworkMessage::Clear | ( | ) |
Clear message data.
|
inline |
Buffer data.
|
inline |
Length of the message data.
|
inline |
Time stamp.
void deNetworkMessage::SetDataLength | ( | int | dataLength | ) |
Set length of the message data.
void deNetworkMessage::SetTimeStamp | ( | TIME_SYSTEM | timeStamp | ) |
Set time stamp.