News SF.net Project Frequently Asked Questions Documentation Downloads Mailing Lists How to Contribute

SourceForge.net Logo

Changing the way games are made and played.

tnlNetObject.h File Reference

tnlNetObject.h File Reference

#include "tnlRPC.h"
#include "tnlNetBase.h"
#include "tnlBitStream.h"

Namespaces

namespace  TNL

Defines

#define TNL_IMPLEMENT_NETOBJECT(className)
 The TNL_IMPLEMENT_NETOBJECT macro should be used for all subclasses of NetObject that will be transmitted with the ghosting system.

#define TNL_IMPLEMENT_NETOBJECT_RPC(className, name, args, argNames, groupMask, guaranteeType, eventDirection, rpcVersion)
 Macro used to declare the implementation of an RPC method on a NetObject subclass.


Define Documentation

#define TNL_IMPLEMENT_NETOBJECT className   ) 
 

Value:

TNL::NetClassRep* className::getClassRep() const { return &className::dynClassRep; } \
   TNL::NetClassRepInstance<className> className::dynClassRep(#className, TNL::NetClassGroupGameMask, TNL::NetClassTypeObject, 0)
The TNL_IMPLEMENT_NETOBJECT macro should be used for all subclasses of NetObject that will be transmitted with the ghosting system.

#define TNL_IMPLEMENT_NETOBJECT_RPC className,
name,
args,
argNames,
groupMask,
guaranteeType,
eventDirection,
rpcVersion   ) 
 

Value:

class RPCEV_##className##_##name : public TNL::NetObjectRPCEvent { \
public: \
   TNL::FunctorDecl<void (className::*)args> mFunctorDecl;\
   RPCEV_##className##_##name(TNL::NetObject *theObject = NULL) : TNL::NetObjectRPCEvent(theObject, guaranteeType, eventDirection), mFunctorDecl(&className::name##_remote) { mFunctor = &mFunctorDecl; } \
   TNL_DECLARE_CLASS( RPCEV_##className##_##name ); \
   bool checkClassType(TNL::Object *theObject) { return dynamic_cast<className *>(theObject) != NULL; } }; \
   TNL_IMPLEMENT_NETEVENT( RPCEV_##className##_##name, groupMask, rpcVersion ); \
   void className::name args { RPCEV_##className##_##name *theEvent = new RPCEV_##className##_##name(this); theEvent->mFunctorDecl.set argNames ; postRPCEvent(theEvent); } \
   TNL::NetEvent * className::name##_construct args { RPCEV_##className##_##name *theEvent = new RPCEV_##className##_##name(this); theEvent->mFunctorDecl.set argNames ; return theEvent; } \
   void className::name##_remote args
Macro used to declare the implementation of an RPC method on a NetObject subclass.

The macro should be used in place of a member function parameter declaration, with the body code (to be executed on the remote side of the RPC) immediately following the TNL_IMPLEMENT_NETOBJECT_RPC macro call.