| 2930 | } |
| 2931 | |
| 2932 | XN_C_API XnStatus xnFindExistingRefNodeByType(XnContext* pContext, XnProductionNodeType type, XnNodeHandle* phNode) |
| 2933 | { |
| 2934 | XnStatus nRetVal = XN_STATUS_OK; |
| 2935 | |
| 2936 | XN_VALIDATE_INPUT_PTR(pContext); |
| 2937 | XN_VALIDATE_OUTPUT_PTR(phNode); |
| 2938 | |
| 2939 | XnNodeInfoList* pList; |
| 2940 | nRetVal = xnEnumerateExistingNodesByType(pContext, type, &pList); |
| 2941 | XN_IS_STATUS_OK(nRetVal); |
| 2942 | |
| 2943 | // take first |
| 2944 | XnNodeInfoListIterator it = xnNodeInfoListGetFirst(pList); |
| 2945 | |
| 2946 | // make sure it's valid |
| 2947 | if (!xnNodeInfoListIteratorIsValid(it)) |
| 2948 | { |
| 2949 | xnNodeInfoListFree(pList); |
| 2950 | return XN_STATUS_NO_MATCH; |
| 2951 | } |
| 2952 | |
| 2953 | XnNodeInfo* pNodeInfo = xnNodeInfoListGetCurrent(it); |
| 2954 | *phNode = xnNodeInfoGetRefHandle(pNodeInfo); |
| 2955 | xnNodeInfoListFree(pList); |
| 2956 | |
| 2957 | return (XN_STATUS_OK); |
| 2958 | } |
| 2959 | |
| 2960 | XN_C_API XnStatus xnFindExistingNodeByType(XnContext* pContext, XnProductionNodeType type, XnNodeHandle* phNode) |
| 2961 | { |
no test coverage detected