![]() |
RflySimSDK v3.05
RflySimSDK说明文档
|
类 | |
struct | mutexCallback |
Public 成员函数 | |
vrpn_Mutex_Remote (const char *name, vrpn_Connection *=NULL) | |
vrpn_bool | isAvailable (void) const |
vrpn_bool | isHeldLocally (void) const |
vrpn_bool | isHeldRemotely (void) const |
void | request (void) |
void | release (void) |
vrpn_bool | addRequestGrantedCallback (void *userdata, int(*)(void *)) |
These callbacks are triggered when OUR request is granted. | |
vrpn_bool | addRequestDeniedCallback (void *userdata, int(*)(void *)) |
These callbacks are triggered when OUR request is denied. | |
vrpn_bool | addTakeCallback (void *userdata, int(*)(void *)) |
These callbacks are triggered when ANY peer gets the mutex. | |
vrpn_bool | addReleaseCallback (void *userdata, int(*)(void *)) |
![]() | |
vrpn_Mutex (const char *name, vrpn_Connection *=NULL) | |
void | mainloop (void) |
Protected 类型 | |
enum | state { OURS , REQUESTING , AVAILABLE , HELD_REMOTELY } |
Protected 成员函数 | |
void | requestIndex (void) |
void | triggerGrantCallbacks (void) |
void | triggerDenyCallbacks (void) |
void | triggerTakeCallbacks (void) |
void | triggerReleaseCallbacks (void) |
![]() | |
void | sendRequest (vrpn_int32 index) |
void | sendRelease (void) |
void | sendReleaseNotification (void) |
void | sendGrantRequest (vrpn_int32 index) |
void | sendDenyRequest (vrpn_int32 index) |
静态 Protected 成员函数 | |
static int VRPN_CALLBACK | handle_grantRequest (void *, vrpn_HANDLERPARAM) |
static int VRPN_CALLBACK | handle_denyRequest (void *, vrpn_HANDLERPARAM) |
static int VRPN_CALLBACK | handle_releaseNotification (void *, vrpn_HANDLERPARAM) |
static int VRPN_CALLBACK | handle_initialize (void *, vrpn_HANDLERPARAM) |
static int VRPN_CALLBACK | handle_gotConnection (void *, vrpn_HANDLERPARAM) |
Protected 属性 | |
state | d_state |
vrpn_int32 | d_myIndex |
vrpn_bool | d_requestBeforeInit |
mutexCallback * | d_reqGrantedCB |
mutexCallback * | d_reqDeniedCB |
mutexCallback * | d_takeCB |
mutexCallback * | d_releaseCB |
![]() | |
vrpn_Connection * | d_connection |
vrpn_int32 | d_myId |
vrpn_int32 | d_requestIndex_type |
vrpn_int32 | d_requestMutex_type |
vrpn_int32 | d_release_type |
vrpn_int32 | d_releaseNotification_type |
vrpn_int32 | d_grantRequest_type |
vrpn_int32 | d_denyRequest_type |
vrpn_int32 | d_initialize_type |
vrpn_bool addReleaseCallback | ( | void * | userdata, |
int(* | )(void *) ) |
These callbacks are triggered when ANY peer releases the mutex.
vrpn_bool addRequestDeniedCallback | ( | void * | userdata, |
int(* | )(void *) ) |
These callbacks are triggered when OUR request is denied.
vrpn_bool addRequestGrantedCallback | ( | void * | userdata, |
int(* | )(void *) ) |
These callbacks are triggered when OUR request is granted.
vrpn_bool addTakeCallback | ( | void * | userdata, |
int(* | )(void *) ) |
These callbacks are triggered when ANY peer gets the mutex.
vrpn_bool isAvailable | ( | void | ) | const |
vrpn_bool isHeldLocally | ( | void | ) | const |
True from when RequestGranted callbacks are triggered until release() is called.
vrpn_bool isHeldRemotely | ( | void | ) | const |
True from when we grant the lock to another process in response to its request message until we receive a release message from another process.
void release | ( | void | ) |
Release the distributed lock. Does nothing if !isHeldLocally() and there isn't a request pending.
void request | ( | void | ) |
Request the distributed lock. Does not request the lock if !isAvailable(), instead automatically triggering DeniedCallbacks.