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

Method RemoveNode

Source/Modules/nimRecorder/RecorderNode.cpp:569–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

567
568
569XnStatus RecorderNode::RemoveNode(const XnChar* strNodeName)
570{
571 RecordedNodeInfo recordedNodeInfo;
572 XnChar strNodeNameCopy[XN_MAX_NAME_LENGTH];
573 //We copy the node name cuz when we'll remove it from the hash it will be freed, but we need it later.
574 XnStatus nRetVal = xnOSStrCopy(strNodeNameCopy, strNodeName, sizeof(strNodeNameCopy));
575 XN_IS_STATUS_OK(nRetVal);
576
577 RecordedNodesInfo::ConstIterator it = m_recordedNodesInfo.Find(strNodeName);
578 if (it == m_recordedNodesInfo.End())
579 {
580 return XN_STATUS_NO_MATCH;
581 }
582
583 recordedNodeInfo = it->Value();
584
585 nRetVal = m_recordedNodesInfo.Remove(it);
586 XN_IS_STATUS_OK(nRetVal);
587
588 NodeRemovedRecord record(m_pRecordBuffer, RECORD_MAX_SIZE, FALSE);
589 record.SetNodeID(recordedNodeInfo.nNodeID);
590 record.SetUndoRecordPos(recordedNodeInfo.nNodeAddedPos);
591
592 nRetVal = record.Encode();
593 if (nRetVal != XN_STATUS_OK)
594 {
595 xnLogWarning(XN_MASK_OPEN_NI, "Failed to encode Node Removed record: %s", xnGetStatusString(nRetVal));
596 XN_ASSERT(FALSE);
597 return nRetVal;
598 }
599
600 nRetVal = WriteRecordToStream(strNodeNameCopy, record);
601 if (nRetVal != XN_STATUS_OK)
602 {
603 xnLogWarning(XN_MASK_OPEN_NI, "Failed to write Node Removed record to file: %s", xnGetStatusString(nRetVal));
604 XN_ASSERT(FALSE);
605 return nRetVal;
606 }
607
608 nRetVal = UpdateNodeSeekInfo(strNodeNameCopy, recordedNodeInfo);
609 XN_IS_STATUS_OK(nRetVal);
610
611 recordedNodeInfo.codec.Release();
612 return XN_STATUS_OK;
613}
614
615
616XnStatus RecorderNode::UpdateNodePropInfo(const XnChar* strNodeName, const XnChar* strPropName,

Callers

nothing calls this directly

Calls 10

xnGetStatusStringFunction · 0.85
SetNodeIDMethod · 0.80
SetUndoRecordPosMethod · 0.80
EncodeMethod · 0.80
xnOSStrCopyFunction · 0.50
FindMethod · 0.45
EndMethod · 0.45
ValueMethod · 0.45
RemoveMethod · 0.45
ReleaseMethod · 0.45

Tested by

no test coverage detected