Functions
Production Node Info List

Functions

XN_C_API XnStatus xnNodeInfoListAdd (XnNodeInfoList *pList, const XnProductionNodeDescription *pDescription, const XnChar *strCreationInfo, XnNodeInfoList *pNeededNodes)
XN_C_API XnStatus xnNodeInfoListAddNode (XnNodeInfoList *pList, XnNodeInfo *pNode)
XN_C_API XnStatus xnNodeInfoListAddNodeFromList (XnNodeInfoList *pList, XnNodeInfoListIterator otherListIt)
XN_C_API XnStatus xnNodeInfoListAllocate (XnNodeInfoList **ppList)
XN_C_API XnStatus xnNodeInfoListAppend (XnNodeInfoList *pList, XnNodeInfoList *pOther)
XN_C_API XnStatus xnNodeInfoListClear (XnNodeInfoList *pList)
XN_C_API void xnNodeInfoListFree (XnNodeInfoList *pList)
XN_C_API XnNodeInfoxnNodeInfoListGetCurrent (XnNodeInfoListIterator it)
XN_C_API XnNodeInfoListIterator xnNodeInfoListGetFirst (XnNodeInfoList *pList)
XN_C_API XnNodeInfoListIterator xnNodeInfoListGetLast (XnNodeInfoList *pList)
XN_C_API XnNodeInfoListIterator xnNodeInfoListGetNext (XnNodeInfoListIterator it)
XN_C_API XnNodeInfoListIterator xnNodeInfoListGetPrevious (XnNodeInfoListIterator it)
XN_C_API XnBool xnNodeInfoListIsEmpty (XnNodeInfoList *pList)
XN_C_API XnBool xnNodeInfoListIteratorIsValid (XnNodeInfoListIterator it)
XN_C_API XnStatus xnNodeInfoListRemove (XnNodeInfoList *pList, XnNodeInfoListIterator it)

Detailed Description

This page details functions for handling production nodes lists. The lists are implemented as doubly-linked lists, but it's not recommended to access the list members directly. instead, use the provided functions for handling the list.

Adding and Removing Node Info Objects

Nodes can be added to the list using xnNodeInfoListAdd(). Note that once an info object is part of the list, it will be freed if that list is freed. A node can be removed by calling xnNodeInfoListRemove(), which also frees that element.

A short example:

// Start with an empty list
XnNodeInfoList* pList;
nRetVal = xnNodeInfoListAllocate(&pList);
// TODO: check error code

// Add first
pList = xnNodeInfoListAdd(pList, pDescription1, NULL, NULL);

// Add second
pList = xnNodeInfoListAdd(pList, pDescription2, NULL, NULL);

Enumeration

Forward Iteration:

for (XnNodeInfoListIterator it = xnNodeInfoListGetFirst(pList); 
        xnNodeInfoListIteratorIsValid(it); 
        it = xnNodeInfoListGetNext(it))
{
        XnNodeInfo* pCurrent = xnNodeInfoListGetCurrent(it);
        ...
}

Backwards Iteration:

for (XnNodeInfoListIterator it = xnNodeInfoListGetLast(pList); 
        xnNodeInfoListIteratorIsValid(it); 
        it = xnNodeInfoListGetPrevious(it))
{
        XnNodeInfo* pCurrent = xnNodeInfoListGetCurrent(it);
        ...
}

Function Documentation

XN_C_API XnStatus xnNodeInfoListAdd ( XnNodeInfoList pList,
const XnProductionNodeDescription pDescription,
const XnChar strCreationInfo,
XnNodeInfoList pNeededNodes 
)

Creates and adds a single XnNodeInfo object to the list.

Parameters:
pList[in] The list.
pDescription[in] The description of this production node.
strCreationInfo[in] Optional. Additional needed information for instantiation.
pNeededNodes[in] Optional. A list of needed nodes.

Adds a single XnNodeInfo object to the list.

Parameters:
pList[in] The list.
pNode[in] The node to add.

Adds a node from another list to this list (the node is not removed from the other list).

Parameters:
pList[in] The list.
otherListIt[in] An iterator obtained from another list.

Allocates a XnNodeInfoList object. This object should be freed using xnNodeInfoListFree().

Parameters:
ppList[out] The list.

Appends another list at the end of this list. Note that the other list becomes empty, but still needs to be freed.

Parameters:
pList[in] A list.
pOther[in] The list to be appended.

Clears a node info list, freeing all the elements in it.

Parameters:
pList[in] The list to be freed.

Frees a XnNodeInfoList object previously allocated with xnNodeInfoListAllocate().

Parameters:
pList[out] The list.

Gets current element from an iterator.

Parameters:
it[in] An iterator.
Returns:
an XnNodeInfo pointer.

Gets the first element of the list.

Parameters:
pList[in] [Optional] A list.
Returns:
an iterator to the first element of the list, or NULL if the list is empty.

Gets the last element of the list.

Parameters:
pList[in] [Optional] A list.
Returns:
an iterator to the last element of the list, or NULL if the list is empty.

Gets an iterator to the next element from a current iterator.

Parameters:
it[in] An iterator.
Returns:
an iterator to the next element.

Gets an iterator to the previous element from a current iterator.

Parameters:
it[in] An iterator.
Returns:
an iterator to the previous element.

Checks if the given list is empty

Parameters:
pList[in] A list.

Checks if the current iterator points to a valid location.

Parameters:
it[in] An iterator.

Removes an element from the list, and frees it.

Parameters:
pList[in] The list.
it[in] Iterator to the element that should be removed.


nao_openni
Author(s): Bener SUAY
autogenerated on Mon Jan 6 2014 11:27:52