6#include "vrpn_Configure.h"
32 vrpn_int32 d_requestIndex_type;
33 vrpn_int32 d_requestMutex_type;
34 vrpn_int32 d_release_type;
35 vrpn_int32 d_releaseNotification_type;
36 vrpn_int32 d_grantRequest_type;
37 vrpn_int32 d_denyRequest_type;
38 vrpn_int32 d_initialize_type;
40 void sendRequest(vrpn_int32 index);
41 void sendRelease(
void);
42 void sendReleaseNotification(
void);
43 void sendGrantRequest(vrpn_int32 index);
44 void sendDenyRequest(vrpn_int32 index);
54 enum state { HELD, FREE };
66 static int VRPN_CALLBACK
112 void requestIndex(
void);
114 enum state { OURS, REQUESTING, AVAILABLE, HELD_REMOTELY };
117 vrpn_int32 d_myIndex;
118 vrpn_bool d_requestBeforeInit;
122 static int VRPN_CALLBACK
129 void triggerGrantCallbacks(
void);
130 void triggerDenyCallbacks(
void);
131 void triggerTakeCallbacks(
void);
132 void triggerReleaseCallbacks(
void);
220 int numPeers(
void)
const;
251 enum state { OURS, REQUESTING, AVAILABLE, HELD_REMOTELY };
271 vrpn_uint32 d_myPort;
272 vrpn_uint32 d_holderIP;
273 vrpn_int32 d_holderPort;
276 vrpn_int32 d_request_type;
277 vrpn_int32 d_release_type;
278 vrpn_int32 d_grantRequest_type;
279 vrpn_int32 d_denyRequest_type;
292 vrpn_uint32 PortNumber);
294 vrpn_uint32 PortNumber);
296 void triggerGrantCallbacks(
void);
297 void triggerDenyCallbacks(
void);
298 void triggerTakeCallbacks(
void);
299 void triggerReleaseCallbacks(
void);
301 void checkGrantMutex(
void);
303 void init(
const char *name);
317 vrpn_uint32 IPaddress;
319 vrpn_bool grantedLock;
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
vrpn_bool isAvailable(void) const
vrpn_bool isHeldLocally(void) const
vrpn_bool addTakeCallback(void *userdata, int(*)(void *))
These callbacks are triggered when ANY peer gets the mutex.
vrpn_bool isHeldRemotely(void) const
vrpn_bool addRequestDeniedCallback(void *userdata, int(*)(void *))
These callbacks are triggered when OUR request is denied.
vrpn_bool addReleaseCallback(void *userdata, int(*)(void *))
vrpn_bool addRequestGrantedCallback(void *userdata, int(*)(void *))
These callbacks are triggered when OUR request is granted.
vrpn_int32 d_remoteIndex
Counts remotes who have had IDs issued to them.
定义 vrpn_Mutex.h:58
vrpn_bool isAvailable(void) const
~vrpn_PeerMutex(void)
If isHeldLocally(), calls release().
int d_numConnectionsAllocated
Dynamic array size for d_peer and d_peerGrantedLock.
定义 vrpn_Mutex.h:267
vrpn_bool isHeldLocally(void) const
vrpn_PeerMutex(const char *name, vrpn_Connection *c)
vrpn_Connection * d_server
Receive on this connection.
定义 vrpn_Mutex.h:261
int d_numPeersGrantingLock
定义 vrpn_Mutex.h:257
vrpn_bool addPeer(const char *stationName)
Takes a VRPN station name of the form "<host>:<port>".
peerData * d_peerData
定义 vrpn_Mutex.h:322
vrpn_bool addTakeCallback(void *userdata, int(*)(void *))
vrpn_bool isHeldRemotely(void) const
vrpn_bool addRequestDeniedCallback(void *userdata, int(*)(void *))
These callbacks are triggered when OUR request is denied.
vrpn_bool addReleaseCallback(void *userdata, int(*)(void *))
vrpn_bool addRequestGrantedCallback(void *userdata, int(*)(void *))
These callbacks are triggered when OUR request is granted.
vrpn_Connection ** d_peer
Send on these connections to other Mutex's well-known-ports.
定义 vrpn_Mutex.h:263
vrpn_PeerMutex(const char *name, int port, const char *NICaddress=NULL)
This constructor opens a new connection/port for the mutex.
This structure is what is passed to a vrpn_Connection message callback.
定义 vrpn_Connection.h:41