* @brief Registers an event handler for the 'User Exit' event. * * @param [in] handler Callback function to be invoked when the event is raised. * @param [in] pCookie User's cookie, to be delivered to the callback. * @param [out] hCallback Handle to the callback to be used for unregistering it. * * For full details and usage of the parameters, see @ref reg_to_events. */
| 7923 | * For full details and usage of the parameters, see @ref reg_to_events. |
| 7924 | */ |
| 7925 | inline XnStatus RegisterToUserExit(UserHandler handler, void* pCookie, XnCallbackHandle& hCallback) |
| 7926 | { |
| 7927 | XnStatus nRetVal = XN_STATUS_OK; |
| 7928 | |
| 7929 | UserSingleCookie* pUserCookie; |
| 7930 | XN_VALIDATE_ALLOC(pUserCookie, UserSingleCookie); |
| 7931 | pUserCookie->handler = handler; |
| 7932 | pUserCookie->pUserCookie = pCookie; |
| 7933 | |
| 7934 | nRetVal = xnRegisterToUserExit(GetHandle(), UserSingleCallback, pUserCookie, &pUserCookie->hCallback); |
| 7935 | if (nRetVal != XN_STATUS_OK) |
| 7936 | { |
| 7937 | xnOSFree(pUserCookie); |
| 7938 | return (nRetVal); |
| 7939 | } |
| 7940 | |
| 7941 | hCallback = pUserCookie; |
| 7942 | |
| 7943 | return (XN_STATUS_OK); |
| 7944 | } |
| 7945 | |
| 7946 | /** |
| 7947 | * @brief Unregisters an event handler for the 'User Exit' event. |
no test coverage detected