#include <DataBlock.h>
Inheritance diagram for RNReplicaNet::DataBlock:
Public Types | |
enum | ContinuityBreakTypes { kStop = 1, kSuddenChange = 2, kTeleport = 4 } |
Public Member Functions | |
DataBlock () | |
virtual | ~DataBlock () |
virtual void | Poll (DataBlockReason *reason=0) |
virtual void | ParseMessage (MessageHelper *message) |
void | SetVariableName (const char *name=0) |
void | BindReplicaNet (ReplicaNet *current) |
void | BindReplicaObject (ReplicaObject *object) |
void | SetReliableFlag (bool reliable=false) |
bool | GetReliableFlag (void) |
void | SetCertainFlag (bool certain=false) |
bool | GetCertainFlag (void) |
void | SetAutomaticUpdatesFlag (bool automatic=true) |
bool | GetAutomaticUpdatesFlag (void) |
virtual void | GiveDeltaHint (void *pdata, int dataLen) |
void | GiveDeltaHint (float delta) |
virtual void | ContinuityBreak (unsigned char breakTypes) |
virtual bool | IsAttached (void *data) |
virtual bool | IsAllocated (void) const |
void | SetIsAllocated (const bool isAllocated=true) |
void | SetUpdateDelayMinimum (const float delay=0.0f) |
float | GetUpdateDelayMinimum (void) const |
void | SetForceSendMaximumUpdates (const int updates=0) |
int | GetForceSendMaximumUpdates (void) const |
void | SetForceSendTimeDelay (const float delay=0.0f) |
float | GetForceSendTimeDelay (void) const |
Protected Member Functions | |
void | SetID (int id) |
const char * | GetROName (ReplicaObject *from=0) |
void | EmitBaseDebugInfo (const char *name, const char *className, DataBlockReason *reason) |
void | EmitBaseDebugInfoUpdates (const char *name, const char *className, DataBlockReason *reason) |
std::string | GetVariableName (void) |
Protected Attributes | |
short | mID |
ReplicaNet * | mBoundReplicaNet |
ReplicaObject * | mBoundObject |
bool | mReliable |
bool | mCertain |
bool | mAutomaticUpdates |
bool | mIsAllocated |
bool | mDebugOn |
char * | mDebugText |
float | mUpdateDelayMinimum |
int | mForceSendMaximumUpdates |
float | mForceSendTimeDelay |
char * | mVariableName |
Friends | |
class | ReplicaObject |
|
Enums for the continuity break function |
|
The ctor performs some basic initialisation |
|
The dtor makes sure everything is tidy |
|
Bind this data block with the ReplicaNet pointer. This is called from ReplicaObject::RegisterDataBlock()
|
|
Bind this data block with the ReplicaObject pointer. This is called from ReplicaObject::RegisterDataBlock()
|
|
This is used to set a continuity break for the data set and provides useful information to the extrapolation algorithm
Reimplemented in RNReplicaNet::DataBlock_Predict_Float. |
|
Gets the automatic update flag for a particular data set
|
|
Gets the reliable flag for a particular data set
|
|
This function returns the value set by SetUpdateDelayMaximum()
|
|
This function returns the value set by SetUpdateDelayMaximum()
|
|
Gets the reliable flag for a particular data set
|
|
This function returns the value set by SetUpdateDelayMinimum()
|
|
This is a feedback function that enables an application to give a delta hint to a DataBlock. This float type call maps to the opaque data type call
Reimplemented in RNReplicaNet::DataBlock_Predict_Float. |
|
This is a feedback function that enables an application to give a delta hint to a DataBlock
Reimplemented in RNReplicaNet::DataBlock_Predict_Float. |
|
This virtual function allows the DataBlock to say how is was allocated.
|
|
Given a data pointer this function identifies if this data block is attached to the pointer.
Reimplemented in RNReplicaNet::DataBlock_Function, RNReplicaNet::DataBlock_NData, and RNReplicaNet::DataBlock_Predict_Float. |
|
This parses a message for the derived class of this data block
Reimplemented in RNReplicaNet::DataBlock_Function, RNReplicaNet::DataBlock_NData, and RNReplicaNet::DataBlock_Predict_Float. |
|
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.
Reimplemented in RNReplicaNet::DataBlock_Function, RNReplicaNet::DataBlock_NData, and RNReplicaNet::DataBlock_Predict_Float. |
|
Sets the automatic update flag for a particular data set. By default a datablock will calculate the best time to create an update for a particular set of data. If the automatic updates are switched off then the datablock relies on hints from the user to calculate updates.
|
|
Sets the certain flag for a particular data set
|
|
This sets the maximum number of consecutive force updates that can be sent from this DataBlock to each ReplicaObject. Forced updates are sent for this DataBlock to a ReplicaObject if the time since the last update, either due to the update filter policy or due to a forced update, is greater than the time set by SetForceSendTimeDelay(). Usually the best possible approximation of the DataBlock change calculated at the time is used. If a normal DataBlock update is sent, in other words an update falls within the DataBlock update filter policy, then the trigger for forced updates is set allowing consecutive forced updates to be started. This feature is useful for unreliable updates where DataBlocks that do not change often usually causing fewer DataBlock updates can be refreshed or force updated. It is a good idea, but not required, to set SetForceSendTimeDelay() before setting this value to be anything greater than 0 because the default value of 0.0f for SetForceSendTimeDelay() could cause many quick consecutive updates to be sent. This can be changed by the user at any time. The default value is 0 which disables this mechanism. The actual mechanism is implemented by the derived DataBlock. For user extended DataBlocks this mechanism can be ignored if the DataBlock filter policy method does not require this functionality. |
|
This sets a time delay from the previous DataBlock update to a ReplicaObject before another forced send update is required. Setting this to be 0.2f causes a forced send update to be sent if the time since the last DataBlock update is more than 0.2f seconds. Therefore if SetForceSendTimeDelay(0.3f) and SetForceSendMaximumUpdates(3) is used, then a DataBlock that stops changing will get 3 extra updates with a delay of 0.3f of a second between each update. This setting for forced updates overrides the SetUpdateDelayMaximum() setting. This can be changed by the user at any time. The default value is 0.0f which then causes delays to be sent every internal ReplicaNet poll as required by SetMaximumForceSendUpdates() The actual mechanism is implemented by the derived DataBlock. For user extended DataBlocks this mechanism can be ignored if the DataBlock filter policy method does not require this functionality. |
|
This sets the ID of the data block when it is used in a ReplicaObject. This function is called from ReplicaObject::RegisterDataBlock() |
|
Defines how the DataBlock was allocated.
|
|
Sets the reliable flag for a particular data set
|
|
This sets the minimum possible delay between each update, due to a DataBlock filter condition being met, for this datablock to each ReplicaObject. This allows the bandwidth for this DataBlock to be fine tuned. A value of 1.0f will mean a maximum of 1 update per second to each ReplicaObject. A value of 0.2f will mean a maximum possible 5 updates due to filter conditions per second, one every 0.2 seconds, to each ReplicaObject. This setting is separate from SetForceSendTimeDelay() This can be changed by the user at any time. The default value is 0.0f which disables this mechanism. The actual mechanism is implemented by the derived DataBlock. For user extended DataBlocks this mechanism can be ignored if the DataBlock filter policy method does not require this functionality.
|
|
Sets the name of the variable attached to this DataBlock which is then used to output extended debugging information using the registered DebugHandler if available. The default value for the variable name is null. This function is used by ReplicaNet and the standard DataBlocks added to objects using the ROL Language if the preprocessor define REPLICANET_VISUALDEBUGGER is used. For user allocated DataBlocks this function can be used to set extra debugging information, such as the variable name, useful to the author. Each DataBlock implementation can choose to not output debug information if there is no name set. The standard DataBlocks included with ReplicaNet output the DataBlock class name with a unique hex number identifier prefixed with "<Unknown>" if the variable name is null.
|