SourceMod::IDataPack Class Reference

Specifies a data pack that can only be written. More...

#include <public/IDataPack.h>

Inherits SourceMod::IDataReader.

Inheritance diagram for SourceMod::IDataPack:

[legend]
Collaboration diagram for SourceMod::IDataPack:
[legend]
List of all members.

Public Member Functions

virtual void ResetSize ()=0
 Resets the used size of the stream back to zero.
virtual void PackCell (cell_t cell)=0
 Packs one cell into the data stream.
virtual void PackFloat (float val)=0
 Packs one float into the data stream.
virtual void PackString (const char *string)=0
 Packs one string into the data stream. The length is recorded as well for buffer overrun protection.
virtual size_t CreateMemory (size_t size, void **addr)=0
 Creates a generic block of memory in the stream.

Detailed Description

Specifies a data pack that can only be written.

Definition at line 121 of file IDataPack.h.


Member Function Documentation

virtual void SourceMod::IDataPack::PackCell ( cell_t  cell  )  [pure virtual]

Packs one cell into the data stream.

Parameters:
cell Cell value to write.

virtual void SourceMod::IDataPack::PackFloat ( float  val  )  [pure virtual]

Packs one float into the data stream.

Parameters:
val Float value to write.

virtual void SourceMod::IDataPack::PackString ( const char *  string  )  [pure virtual]

Packs one string into the data stream. The length is recorded as well for buffer overrun protection.

Parameters:
string String to write.

virtual size_t SourceMod::IDataPack::CreateMemory ( size_t  size,
void **  addr 
) [pure virtual]

Creates a generic block of memory in the stream.

Note that the pointer it returns can be invalidated on further writing, since the stream size may grow. You may need to double back and fetch the pointer again.

Parameters:
size Size of the memory to create in the stream.
addr Optional pointer to store the relocated memory address.
Returns:
Current position of the stream beforehand.


The documentation for this class was generated from the following file:
Generated on Thu Aug 28 22:10:20 2008 for SourceMod SDK by  doxygen 1.5.1