DataBlock_NData Class Reference

#include <DataBlock_NData.h>

Inheritance diagram for DataBlock_NData:

Inheritance graph
[legend]
Collaboration diagram for DataBlock_NData:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 DataBlock_NData ()
virtual ~DataBlock_NData ()
virtual void Poll (DataBlockReason *reason)
virtual void ParseMessage (MessageHelper *message)
void RegisterInClassPointer (void *const data, const int size)
void SetDefaultData (const void *data)
bool IsAttached (void *data)
void SetEndianTest (const bool test=true)
bool GetEndianTest (void) const

Static Public Member Functions

static DataBlock_NDataRegister (void *const data, const int size)

Protected Attributes

void * mData
int mSize
RegistryManagerMap
< int,
SessionBlock_NData > 
mPerSessionData
void * mDefaultData
bool mDisableEndian

Classes

struct  SessionBlock_NData


Detailed Description

This DataBlock derived class scans the registered area for changes and if needed creates a packet detailing those changes
This DataBlock does not do any lag compensation or prediction. It just informs each replica of a change when one is made. By default the DataBlock will preserve the endian format of the data. To disable the endian check, an example would be for string data, then SetEndianTest(false) or the ROL command DisableEndianTest();

Constructor & Destructor Documentation

DataBlock_NData (  ) 

The ctor performs some basic initialisation

virtual ~DataBlock_NData (  )  [virtual]

The dtor makes sure everything is tidy


Member Function Documentation

virtual void Poll ( DataBlockReason reason  )  [virtual]

A poll function that is called by ReplicaNet to check for updates to this particular data block. If this virtual method is implemented by a derived class this base class method should be called before a data packet is created. Processing for this function may occur during the thread context of ReplicaNet so processing time used by this function should be kept to a minimum to avoid performance issues.

Parameters:
reason the reason code that is passed in to this class to enable a response to be calculated

Reimplemented from DataBlock.

virtual void ParseMessage ( MessageHelper message  )  [virtual]

This parses a message for the derived class of this data block. Processing for this function may occur during the thread context of ReplicaNet so processing time used by this function should be kept to a minimum to avoid performance issues.

Parameters:
message The current message buffer that contains the packet data

Reimplemented from DataBlock.

static DataBlock_NData* Register ( void *const   data,
const int  size 
) [static]

This registers the memory area with this data block type and returns a new pointer

Parameters:
data the start of the memory to check
size the size of the data block
Returns:
Returns a pointer that can be used to attach to a ReplicaObject

void RegisterInClassPointer ( void *const   data,
const int  size 
) [inline]

This registers the memory area with this data block type. This is used when the memory is in datablocks that are allocated as part of a bigger class.

Parameters:
data the start of the memory to check
size the size of the data block

void SetDefaultData ( const void *  data  ) 

This allows a block of memory to be passed in that shows a default state of the data block. This default memory state is copied so it can be temporary. When a session joins or an object is created, the datablock states are serialised. By setting a default state the user can avoid the extra data being sent out for the datablock state.

Parameters:
data the pointer to the memory.

bool IsAttached ( void *  data  )  [virtual]

Given a data pointer this function identifies if this data block is attached to the pointer.

Returns:
returns true if the data pointer is attached to this data block.

Reimplemented from DataBlock.


Generated on Sat Jun 28 22:02:22 2008 for ReplicaNet and RNLobby by  doxygen 1.5.3