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

Function xnRegisterToUserReEnter

Source/OpenNI/XnOpenNI.cpp:5540–5569  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5538}
5539
5540XN_C_API XnStatus xnRegisterToUserReEnter(XnNodeHandle hInstance, XnUserHandler handler, void* pCookie, XnCallbackHandle* phCallback)
5541{
5542 XN_VALIDATE_INTERFACE_TYPE(hInstance, XN_NODE_TYPE_USER);
5543 XN_VALIDATE_OUTPUT_PTR(phCallback);
5544 XnUserGeneratorInterfaceContainer* pInterface = (XnUserGeneratorInterfaceContainer*)hInstance->pModuleInstance->pLoaded->pInterface;
5545 XnModuleNodeHandle hModuleNode = hInstance->pModuleInstance->hNode;
5546
5547 // Versions before 1.3.2 didn't have this API. Fabricate it.
5548 if (pInterface->User.RegisterToUserReEnter == NULL)
5549 {
5550
5551 }
5552
5553 UserSingleCookie* pRegCookie;
5554 XN_VALIDATE_ALLOC(pRegCookie, UserSingleCookie);
5555 pRegCookie->handler = handler;
5556 pRegCookie->hNode = hInstance;
5557 pRegCookie->pUserCookie = pCookie;
5558
5559 XnStatus nRetVal = pInterface->User.RegisterToUserReEnter(hModuleNode, xnModuleUserSingle, pRegCookie, &pRegCookie->hCallback);
5560 if (nRetVal != XN_STATUS_OK)
5561 {
5562 xnOSFree(pRegCookie);
5563 return (nRetVal);
5564 }
5565
5566 *phCallback = pRegCookie;
5567
5568 return XN_STATUS_OK;
5569}
5570XN_C_API void xnUnregisterFromUserReEnter(XnNodeHandle hInstance, XnCallbackHandle hCallback)
5571{
5572 XN_VALIDATE_INTERFACE_TYPE_RET(hInstance, XN_NODE_TYPE_USER, );

Calls 2

RegisterToUserReEnterMethod · 0.80
xnOSFreeFunction · 0.50

Tested by

no test coverage detected