#include <DataBlock_Function.h>


Public Types | |
| typedef void( | tDataBlock_Function_funcp )(void *classp, void *data) |
Public Member Functions | |
| DataBlock_Function () | |
| virtual | ~DataBlock_Function () |
| virtual void | Poll (DataBlockReason *reason) |
| virtual void | ParseMessage (MessageHelper *message) |
| void | RegisterInClassPointer (void *classp, tDataBlock_Function_funcp *funcp) |
| void | AddFunctionStateChange (void *data, int len, const char *debug=0) |
| bool | IsAttached (void *data) |
Static Public Member Functions | |
| static DataBlock_Function * | Register (void *classp, tDataBlock_Function_funcp *funcp) |
| static void | SetSessionIDFilter (const int numSessionIDs=0, const int *sessionIDs=0) |
Protected Attributes | |
| void * | mClassp |
| tDataBlock_Function_funcp * | mData |
|
RegistryManagerMap < int, SessionBlock_Function > | mPerSessionFunction |
|
std::list < CombinedDataPacket * > | mFunctionStateChanges |
Static Protected Attributes | |
| static int | mConfiguredNumSessions |
| static int * | mConfiguredSessionIDs |
The ctor performs some basic initialisation
| virtual ~DataBlock_Function | ( | ) | [virtual] |
The dtor makes sure everything is tidy
| 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.
| 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.
| message | The current message buffer that contains the packet data |
Reimplemented from DataBlock.
| static DataBlock_Function* Register | ( | void * | classp, | |
| tDataBlock_Function_funcp * | funcp | |||
| ) | [static] |
This registers the memory area with this data block type and returns a new pointer
| classp | is the pointer to this class that is passed through the message pipeline | |
| funcp | the actual function pointer to call that cracks the message |
| void RegisterInClassPointer | ( | void * | classp, | |
| tDataBlock_Function_funcp * | funcp | |||
| ) | [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.
| classp | is the pointer to this class that is passed through the message pipeline | |
| funcp | the actual function pointer to call that cracks the message |
| static void SetSessionIDFilter | ( | const int | numSessionIDs = 0, |
|
| const int * | sessionIDs = 0 | |||
| ) | [static] |
This configures the next networked function call from a master object to send the function call to the nominated sessionIDs. After the function call is completed all subsequent network function calls are sent without this filter unless this function is used. The NOMINATED_REPLICAS_FUNCTION_CALL() macro also uses this function.
Care must be taken when using this static function that multi-threaded ReplicaObject derived classes do not interrupt calls to this function and the subsequent network function call. The array pointed to by this function must persist until the subsequent network function call.
| numSessionIDs | The number of session IDs in the array. | |
| sessionIDs | An array of session IDs that will receive the next network function call. |
| bool IsAttached | ( | void * | data | ) | [virtual] |
Given a data pointer this function identifies if this data block is attached to the pointer.
Reimplemented from DataBlock.
1.5.3