Production Node Info List
C Reference

## Functions

XN_C_API XnStatus XN_C_DECL | xnNodeInfoListAllocate (XnNodeInfoList **ppList)
XN_C_API void XN_C_DECL | xnNodeInfoListFree (XnNodeInfoList *pList)
XN_C_API XnStatus XN_C_DECL | xnNodeInfoListAdd (XnNodeInfoList *pList, const XnProductionNodeDescription *pDescription, const XnChar *strCreationInfo, XnNodeInfoList *pNeededNodes)
XN_C_API XnStatus XN_C_DECL | xnNodeInfoListAddEx (XnNodeInfoList *pList, const XnProductionNodeDescription *pDescription, const XnChar *strCreationInfo, XnNodeInfoList *pNeededNodes, const void *pAdditionalData, XnFreeHandler pFreeHandler)
XN_C_API XnStatus XN_C_DECL | xnNodeInfoListAddNode (XnNodeInfoList *pList, XnNodeInfo *pNode)
XN_C_API XnStatus XN_C_DECL | xnNodeInfoListAddNodeFromList (XnNodeInfoList *pList, XnNodeInfoListIterator otherListIt)
XN_C_API XnStatus XN_C_DECL | xnNodeInfoListRemove (XnNodeInfoList *pList, XnNodeInfoListIterator it)
XN_C_API XnStatus XN_C_DECL | xnNodeInfoListClear (XnNodeInfoList *pList)
XN_C_API XnStatus XN_C_DECL | xnNodeInfoListAppend (XnNodeInfoList *pList, XnNodeInfoList *pOther)
XN_C_API XnBool XN_C_DECL | xnNodeInfoListIsEmpty (XnNodeInfoList *pList)
XN_C_API XnNodeInfoListIterator XN_C_DECL | xnNodeInfoListGetFirst (XnNodeInfoList *pList)
XN_C_API XnNodeInfoListIterator XN_C_DECL | xnNodeInfoListGetLast (XnNodeInfoList *pList)
XN_C_API XnBool XN_C_DECL | xnNodeInfoListIteratorIsValid (XnNodeInfoListIterator it)
XN_C_API XnNodeInfo *XN_C_DECL | xnNodeInfoListGetCurrent (XnNodeInfoListIterator it)
XN_C_API XnNodeInfoListIterator XN_C_DECL | xnNodeInfoListGetNext (XnNodeInfoListIterator it)
XN_C_API XnNodeInfoListIterator XN_C_DECL | xnNodeInfoListGetPrevious (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);
XnNodeInfoList
struct XnNodeInfoList XnNodeInfoList
Definition XnTypes.h:187
xnNodeInfoListAllocate
XN_C_API XnStatus XN_C_DECL xnNodeInfoListAllocate(XnNodeInfoList **ppList)
xnNodeInfoListAdd
XN_C_API XnStatus XN_C_DECL xnNodeInfoListAdd(XnNodeInfoList *pList, const XnProductionNodeDescription *pDescription, const XnChar *strCreationInfo, XnNodeInfoList *pNeededNodes)

# Enumeration

Forward Iteration:

for (XnNodeInfoListIterator it = xnNodeInfoListGetFirst(pList);
xnNodeInfoListIteratorIsValid(it);
it = xnNodeInfoListGetNext(it))
{
XnNodeInfo* pCurrent = xnNodeInfoListGetCurrent(it);
...
}
XnNodeInfo
struct XnNodeInfo XnNodeInfo
Definition XnTypes.h:177
xnNodeInfoListIteratorIsValid
XN_C_API XnBool XN_C_DECL xnNodeInfoListIteratorIsValid(XnNodeInfoListIterator it)
xnNodeInfoListGetNext
XN_C_API XnNodeInfoListIterator XN_C_DECL xnNodeInfoListGetNext(XnNodeInfoListIterator it)
xnNodeInfoListGetCurrent
XN_C_API XnNodeInfo *XN_C_DECL xnNodeInfoListGetCurrent(XnNodeInfoListIterator it)
xnNodeInfoListGetFirst
XN_C_API XnNodeInfoListIterator XN_C_DECL xnNodeInfoListGetFirst(XnNodeInfoList *pList)
XnNodeInfoListIterator
Definition XnTypes.h:193

Backwards Iteration:

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

## Function Documentation

## xnNodeInfoListAdd()

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

Creates and adds a single XnNodeInfo object to the list. See also xnNodeInfoListAddEx().

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.

## xnNodeInfoListAddEx()

XN_C_API XnStatus XN_C_DECL xnNodeInfoListAddEx | ( | XnNodeInfoList * | pList,
|  | const XnProductionNodeDescription * | pDescription,
|  | const XnChar * | strCreationInfo,
|  | XnNodeInfoList * | pNeededNodes,
|  | const void * | pAdditionalData,
|  | XnFreeHandler | pFreeHandler )

Creates and adds a single XnNodeInfo object to the list, with additional data. This data can be later extracted using the xnNodeInfoGetAdditionalData(). Before the node info object is freed, the pFreeHandler callback will be called, so it could free the additional data object.

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.
  pAdditionalData | [in] Additional data, which is specific to this node.
  pFreeHandler | [in] Optional. A callback function for freeing the additional data.

## xnNodeInfoListAddNode()

XN_C_API XnStatus XN_C_DECL xnNodeInfoListAddNode | ( | XnNodeInfoList * | pList,
|  | XnNodeInfo * | pNode )

Adds a single XnNodeInfo object to the list.

Parameters

  pList | [in] The list.
  pNode | [in] The node to add.

## xnNodeInfoListAddNodeFromList()

XN_C_API XnStatus XN_C_DECL xnNodeInfoListAddNodeFromList | ( | XnNodeInfoList * | pList,
|  | XnNodeInfoListIterator | otherListIt )

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.

## xnNodeInfoListAllocate()

XN_C_API XnStatus XN_C_DECL xnNodeInfoListAllocate | ( | XnNodeInfoList ** | ppList | ) |

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

Parameters

  ppList | [out] The list.

## xnNodeInfoListAppend()

XN_C_API XnStatus XN_C_DECL xnNodeInfoListAppend | ( | XnNodeInfoList * | pList,
|  | XnNodeInfoList * | pOther )

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.

## xnNodeInfoListClear()

XN_C_API XnStatus XN_C_DECL xnNodeInfoListClear | ( | XnNodeInfoList * | pList | ) |

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

Parameters

  pList | [in] The list to be freed.

## xnNodeInfoListFree()

XN_C_API void XN_C_DECL xnNodeInfoListFree | ( | XnNodeInfoList * | pList | ) |

Frees a XnNodeInfoList object previously allocated with xnNodeInfoListAllocate().

Parameters

  pList | [out] The list.

## xnNodeInfoListGetCurrent()

XN_C_API XnNodeInfo *XN_C_DECL xnNodeInfoListGetCurrent | ( | XnNodeInfoListIterator | it | ) |

Gets current element from an iterator.

Parameters

  it | [in] An iterator.

Returns
  an XnNodeInfo pointer.

## xnNodeInfoListGetFirst()

XN_C_API XnNodeInfoListIterator XN_C_DECL xnNodeInfoListGetFirst | ( | XnNodeInfoList * | pList | ) |

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.

## xnNodeInfoListGetLast()

XN_C_API XnNodeInfoListIterator XN_C_DECL xnNodeInfoListGetLast | ( | XnNodeInfoList * | pList | ) |

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.

## xnNodeInfoListGetNext()

XN_C_API XnNodeInfoListIterator XN_C_DECL xnNodeInfoListGetNext | ( | XnNodeInfoListIterator | it | ) |

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

Parameters

  it | [in] An iterator.

Returns
  an iterator to the next element.

## xnNodeInfoListGetPrevious()

XN_C_API XnNodeInfoListIterator XN_C_DECL xnNodeInfoListGetPrevious | ( | XnNodeInfoListIterator | it | ) |

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

Parameters

  it | [in] An iterator.

Returns
  an iterator to the previous element.

## xnNodeInfoListIsEmpty()

XN_C_API XnBool XN_C_DECL xnNodeInfoListIsEmpty | ( | XnNodeInfoList * | pList | ) |

Checks if the given list is empty

Parameters

  pList | [in] A list.

## xnNodeInfoListIteratorIsValid()

XN_C_API XnBool XN_C_DECL xnNodeInfoListIteratorIsValid | ( | XnNodeInfoListIterator | it | ) |

Checks if the current iterator points to a valid location.

Parameters

  it | [in] An iterator.

## xnNodeInfoListRemove()

XN_C_API XnStatus XN_C_DECL xnNodeInfoListRemove | ( | XnNodeInfoList * | pList,
|  | XnNodeInfoListIterator | it )

Removes an element from the list, and frees it.

Parameters

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