RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_SharedObject类 参考abstract
+ 类 vrpn_SharedObject 继承关系图:
+ vrpn_SharedObject 的协作图:

struct  deferredUpdateCallbackEntry
 

Public 成员函数

 vrpn_SharedObject (const char *name, const char *tname, vrpn_int32 mode)
 
const char * name (void) const
 
vrpn_bool isSerializer (void) const
 
virtual void bindConnection (vrpn_Connection *)
 
void useLamportClock (vrpn_LamportClock *)
 
void becomeSerializer (void)
 
vrpn_bool registerDeferredUpdateCallback (vrpnDeferredUpdateCallback, void *userdata)
 

Protected 成员函数

virtual vrpn_bool shouldSendUpdate (vrpn_bool isLocalSet, vrpn_bool acceptedUpdate)
 
int yankCallbacks (vrpn_bool isLocal)
 must set d_lastUpdate BEFORE calling yankCallbacks()
 
int yankDeferredUpdateCallbacks (void)
 returns -1 on error (i.e. nonzero return by a callback)
 
void serverPostBindCleanup (void)
 
void remotePostBindCleanup (void)
 
virtual void sendUpdate (void)=0
 Should invoke default sendUpdate() for this derived type.
 
virtual int handleUpdate (vrpn_HANDLERPARAM)=0
 

静态 Protected 成员函数

static int VRPN_CALLBACK handle_requestSerializer (void *, vrpn_HANDLERPARAM)
 
static int VRPN_CALLBACK handle_grantSerializer (void *, vrpn_HANDLERPARAM)
 
static int VRPN_CALLBACK handle_assumeSerializer (void *, vrpn_HANDLERPARAM)
 
static int VRPN_CALLBACK handle_gotConnection (void *, vrpn_HANDLERPARAM)
 
static int VRPN_CALLBACK handle_update (void *, vrpn_HANDLERPARAM)
 

Protected 属性

char * d_name
 
vrpn_int32 d_mode
 
timeval d_lastUpdate
 
char * d_typename
 
vrpn_Connectiond_connection
 
vrpn_int32 d_serverId
 
vrpn_int32 d_remoteId
 
vrpn_int32 d_myId
 
vrpn_int32 d_peerId
 
vrpn_int32 d_update_type
 
vrpn_int32 d_requestSerializer_type
 Sent to the serializer to assume its duties.
 
vrpn_int32 d_grantSerializer_type
 Sent by the serializer to grant a request.
 
vrpn_int32 d_assumeSerializer_type
 
vrpn_int32 d_lamportUpdate_type
 
vrpn_bool d_isSerializer
 default to vrpn_TRUE for servers, FALSE for remotes
 
vrpn_bool d_isNegotiatingSerializer
 
vrpn_bool d_queueSets
 
vrpn_LamportClockd_lClock
 
vrpn_LamportTimestampd_lastLamportUpdate
 
deferredUpdateCallbackEntryd_deferredUpdateCallbacks
 

成员函数说明

◆ becomeSerializer()

void becomeSerializer ( void )

Requests that this instance of the shared object becomes the serializer (i.e. lock-arbitrator), and we can then use setSerializerPolicy to imitate a complete lock. Does nothing if we already are the serializer (isSerializer() returns true); otherwise initiates a 3-phase request protocol with the current serializer. There currently isn't any provision for notification of success (or failure).

◆ bindConnection()

virtual void bindConnection ( vrpn_Connection * )
virtual

Every derived class should call this, do what it needs to, and ALSO call {server,remote}PostBindCleanup() to get myId and peerId set up and to get standard handlers registered.

vrpn_Shared_float64_Remote, vrpn_Shared_float64_Server, vrpn_Shared_int32_Remote, vrpn_Shared_int32_Server, vrpn_Shared_String_Remote , 以及 vrpn_Shared_String_Server 重载.

◆ handle_gotConnection()

static int VRPN_CALLBACK handle_gotConnection ( void * ,
vrpn_HANDLERPARAM  )
staticprotected

Register this handler in postBindCleanup(); it calls sendUpdate() to make sure the remote has the correct value on first connection.

◆ handle_update()

static int VRPN_CALLBACK handle_update ( void * ,
vrpn_HANDLERPARAM  )
staticprotected

Passes arguments to handleUpdate() for this type; registered in postBindCleanup();

◆ registerDeferredUpdateCallback()

vrpn_bool registerDeferredUpdateCallback ( vrpnDeferredUpdateCallback ,
void * userdata )

The specified function will be passed userdata when this particular shared object defers an update (receives a local update but is not the serializer and so sends the update off to the serializer). Intended to allow insertion of timing code for those times when you really want to know how long every little thing is taking.

◆ sendUpdate()

virtual void sendUpdate ( void )
protectedpure virtual

Should invoke default sendUpdate() for this derived type.

vrpn_Shared_float64, vrpn_Shared_int32 , 以及 vrpn_Shared_String 内被实现.

◆ useLamportClock()

void useLamportClock ( vrpn_LamportClock * )

Lamport Clocks are NOT currently integrated. They should provide serialization (virtual timestamps) that work even when the clocks of the computers communicating are not roughly synchronized.

◆ yankCallbacks()

int yankCallbacks ( vrpn_bool isLocal)
protected

must set d_lastUpdate BEFORE calling yankCallbacks()

◆ yankDeferredUpdateCallbacks()

int yankDeferredUpdateCallbacks ( void )
protected

returns -1 on error (i.e. nonzero return by a callback)

类成员变量说明

◆ d_assumeSerializer_type

vrpn_int32 d_assumeSerializer_type
protected

Sent by a new serializer once it has been notified that its request has been granted.

◆ d_grantSerializer_type

vrpn_int32 d_grantSerializer_type
protected

Sent by the serializer to grant a request.

◆ d_isNegotiatingSerializer

vrpn_bool d_isNegotiatingSerializer
protected

As long as we have inorder delivery, this should be sufficient to keep us from getting many at once.

◆ d_isSerializer

vrpn_bool d_isSerializer
protected

default to vrpn_TRUE for servers, FALSE for remotes

◆ d_queueSets

vrpn_bool d_queueSets
protected

If this is true, no set()s are processed; instead, they are queued for later execution. NOT IMPLEMENTED

◆ d_requestSerializer_type

vrpn_int32 d_requestSerializer_type
protected

Sent to the serializer to assume its duties.


该类的文档由以下文件生成: