Main Page | Class Hierarchy | Class List | Directories | Class Members

object Class Reference

List of all members.

Public Member Functions

 datablock (name)
 datablockcustom (name)
 addinclude (name)
 extern (...)
 ApproveMigration ()
 ApproveFault ()
 Reliable ()
 Certain ()
 Unreliable ()
 SetLoadBalancing (bool enable)
 SetLoadBalancingDefault (bool defaultValue)
 SetLoadScore (float load)
 SetLoadScoreDefault (float defaultLoad)
 SetPropagateToSessionDistance (float distance)
 SetPropagateToSessionDistanceDefault (float distance)
 RealInclude (char *includeFile)
 AddHeaderInclude (char *includeFile)
 SetOpaqueType (char *baseClassType)

Detailed Description

The object class defines the object class framework to use. For example if a C++ class looks like this:
class ATestClass
{
    ATestClass() {};
    virtual ~ATestClass() {};
public:
    int mObjectHealth;      // This is going to be shared to all networked objects
};
If the class member variable is to be shared over the network then create a file called _RO_ATestClass.rol containing similar to code this:
object ATestClass
{
	datablock NData;

	networking
	{
		NData mObjectHealth;
	}
}
Then you can compile this file with the RNROLCompiler. The generated C++ files should then be included in your project. The C++ class definition should be changed to look like this:
class ATestClass : _RO_DO_PUBLIC_RO(ATestClass)
{
...
This is so your C++ class inherits from the generated RO class (Replicated Object) which is now aware of the network.
An alternative would be to not use the _RO_DO_PUBLIC_RO() macro and use this format instead:
class ATestClass : public _RO_ATestClass
{
...
Note that the name used in the ROL file for the class has '_RO_' added to the start of the name.


Member Function Documentation

object::AddHeaderInclude char *  includeFile  ) 
 

Parameters:
includeFile the filename of the include file for a header file. This command is most useful as a pre-ctor stage command. For example in an ROL file:
object > AddHeaderInclude("ATypeInclude.h") Test
Adds the header file "ATypeInclude.h" to the header file of the compiled ROL output.

object::addinclude name   ) 
 

This keyword add an include file to the ReplicaObject.

Parameters:
name the name of the include file with or without path to add to the object. This then adds the include "xxxx" to the ReplicaObject derived class cpp file where xxxx is the name and optional path of the datablock used.

object::ApproveFault  ) 
 

Makes this object fault tolerant

object::ApproveMigration  ) 
 

Makes this object approve migration requests

object::Certain  ) 
 

Makes the object update use the certain method

object::datablock name   ) 
 

This keyword defines a datablock that is used in the object.

Parameters:
name the name of the datablock used in this object. This then adds the include "RNReplicaNet/Inc/DataBlock_xxxx.h" to the ReplicaObject derived class cpp file where xxxx is the name of the datablock used.

object::datablockcustom name   ) 
 

This keyword defines a custom datablock that is used in the object.

Parameters:
name the name of the datablock used in this object. This then adds the include "DataBlock_xxxx.h" to the ReplicaObject derived class cpp file where xxxx is the name of the datablock used.

object::extern   ...  ) 
 

This keyword defined a function prototype used in the C++ class that you want to be able to call across the network.

Parameters:
... The parameter prototype for a function used in a C++ class. For example you would use:
	extern AMemberFunction(int,float);
Which would correspond to a function is a C++ class such as:
    void AMemberFunction(int aParameter,float anotherParameter);

object::RealInclude char *  includeFile  ) 
 

Parameters:
includeFile the filename of the include file for the real class. This command is most useful as a pre-ctor stage command. For example in an ROL file:
object > RealInclude("RealTestObjectInclude.h") Test
Creates an object from an object called Test but uses the file name given as the include file for the real class include. Usually the object name is used as a hint for the real object include name.

object::Reliable  ) 
 

Makes the object update use the reliable method

object::SetLoadBalancing bool  enable  ) 
 

Enables or disables load balancing for this ReplicaObject.

Parameters:
enable set this to true to enable load balancing. The default is false

object::SetLoadBalancingDefault bool  defaultValue  ) 
 

This sets the default value that the load balancing uses. Setting the default value in the object constructor to the same value that is set for the load balancing will result in a smaller data packet being sent.

Parameters:
defaultValue the value that is the default value. The default is false to match the parameter to SetLoadBalancing()

object::SetLoadScore float  load  ) 
 

Sets the object load unit score.. The definition of "load" units is left to the user. The default return value is 0.0f

Parameters:
load A "load" score for this object.

object::SetLoadScoreDefault float  defaultLoad  ) 
 

This sets the default value that the load balancing score uses. Setting the default value in the object constructor to the same value that is set for the load balancing will result in a smaller data packet being sent.

Parameters:
defaultLoad the value that is the default value. The default is 0.0f to match the parameter to SetLoadScore()

object::SetOpaqueType char *  baseClassType  ) 
 

Parameters:
baseClassType the base class of the class object. Instead of using ReplicaObject::SetOpaquePointer() or overriding ReplicaObject::GetOpaquePointer() to pass back an opaque pointer, you can use this method in the ROL file. For example if your game class called MonsterObject inherits from a base class called BaseGameObject you could use SetOpaqueType(BaseGameObject).
As long as the opaque pointer has not been set elsewhere in your code and the GetOpaquePointer() function has not been overridden then when you call ReplicaObject::GetOpaquePointer() the pointer returned will be a valid pointer for this class as if it had been cast to (BaseGameObject *). In effect it is the same as overriding ReplicaObject::GetOpaquePointer() to do { return (BaseGameObject*) ((MonsterObject*) this); };

object::SetPropagateToSessionDistance float  distance  ) 
 

This functions sets the distance that an object has to be within for it to be propagated relative to a session observer. If a session has an observer and the CalculateDistanceToObject() result is greater than the value specified then the session will not receive object updates. If a session has no registered observer then the object will always be propagated to that session. The default value for a ReplicaObject is to have this distance set to kReplicaObject_InfiniteDistance, which means that the object will always be propogated to a session. This function can only be used if the ReplicaObject is a master.

Parameters:
distance the distance to set, kReplicaObject_InfiniteDistance is the default value

object::SetPropagateToSessionDistanceDefault float  distance  ) 
 

This sets the default value that the propagate distance uses. Setting the default value in the object constructor to the same value that is set for the distance will result in a smaller data packet being sent when an object is published.

Parameters:
distance the value that is the default value. The default is kReplicaObject_InfiniteDistance to match the parameter to SetPropagateToSessionDistance()

object::Unreliable  ) 
 

Makes the object update use the unreliable method


The documentation for this class was generated from the following file:
Generated on Sun Oct 30 01:12:39 2005 for ROLCompiler by  doxygen 1.4.1