MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / xnLockNodeForChanges

Function xnLockNodeForChanges

Source/OpenNI/XnOpenNI.cpp:3272–3299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3270}
3271
3272XN_C_API XnStatus xnLockNodeForChanges(XnNodeHandle hInstance, XnLockHandle* phLock)
3273{
3274 XnStatus nRetVal = XN_STATUS_OK;
3275
3276 XN_VALIDATE_INPUT_PTR(hInstance);
3277
3278 if (hInstance->LockData.nCurrentLock != 0)
3279 {
3280 return (XN_STATUS_NODE_IS_LOCKED);
3281 }
3282
3283 // lock it
3284 if (xnIsCapabilitySupported(hInstance, XN_CAPABILITY_LOCK_AWARE))
3285 {
3286 nRetVal = xnSetLockStateImpl(hInstance, TRUE);
3287 XN_IS_STATUS_OK(nRetVal);
3288 }
3289
3290 // give it a unique lock handle
3291 XnUInt32 nLockID = ++hInstance->pContext->nLastLockID;
3292
3293 hInstance->LockData.nCurrentLock = nLockID;
3294
3295 // return to user
3296 *phLock = nLockID;
3297
3298 return (XN_STATUS_OK);
3299}
3300
3301XN_C_API XnStatus xnUnlockNodeForChanges(XnNodeHandle hInstance, XnLockHandle hLock)
3302{

Callers 4

LockForChangesMethod · 0.85
AddNodeMethod · 0.85
xnConfigureNodeFromXmlFunction · 0.85

Calls 2

xnIsCapabilitySupportedFunction · 0.85
xnSetLockStateImplFunction · 0.85

Tested by

no test coverage detected