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

Function xnFindExistingRefNodeByType

Source/OpenNI/XnOpenNI.cpp:2932–2958  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2930}
2931
2932XN_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
2960XN_C_API XnStatus xnFindExistingNodeByType(XnContext* pContext, XnProductionNodeType type, XnNodeHandle* phNode)
2961{

Callers 5

FindExistingNodeFunction · 0.85
xnPlayRecordingFunction · 0.85
xnFindExistingNodeByTypeFunction · 0.85
mainFunction · 0.85

Calls 4

xnNodeInfoListFreeFunction · 0.85
xnNodeInfoListGetCurrentFunction · 0.85

Tested by

no test coverage detected