OpenNI 1.5.4: xn::NodeWrapper Class Reference

OpenNI

#include <XnCppWrapper.h>

Inheritance diagram for xn::NodeWrapper:

List of all members.

Public Member Functions

 NodeWrapper (XnNodeHandle hNode)
 NodeWrapper (const NodeWrapper &other)
NodeWrapperoperator= (const NodeWrapper &other)
 ~NodeWrapper ()
 operator XnNodeHandle () const
XnNodeHandle GetHandle () const
XnBool operator== (const NodeWrapper &other)
XnBool operator!= (const NodeWrapper &other)
XnBool IsValid () const
const XnChar * GetName () const
XnStatus AddRef ()
void Release ()
void SetHandle (XnNodeHandle hNode)
void TakeOwnership (XnNodeHandle hNode)

Friends

class Context

Detailed Description

Purpose: The NodeWrapper class is the base class for all OpenNI production node classes in C++, for example, the xn::ProductionNode class and the xn::Generator class.

The NodeWrapper class is the C++ API wrapper around the OpenNI C XnNodeHandle API.

Remarks:

A fundamental OpenNI concept that is critical to understand about nodes and node creation is that all C++ objects are "smart pointers" to the actual nodes. The reason why OpenNI is designed this way is so that the same node can be used to produce data (or provide information) for more than just one (dependant) node or for more than just one software component.

When instantiating an object of this class, it doesn't point to any actual node. In order to create an actual node, use one of the Create() methods (e.g. DepthGenerator::Create()).


Constructor & Destructor Documentation

xn::NodeWrapper::NodeWrapper ( XnNodeHandle  hNode) [inline]

Ctor

Parameters:
[in]hNodeA node handle.
xn::NodeWrapper::NodeWrapper ( const NodeWrapper other) [inline]
xn::NodeWrapper::~NodeWrapper ( ) [inline]

Member Function Documentation

XnStatus xn::NodeWrapper::AddRef ( ) [inline]

References a production node, increasing its reference count by 1.

For full details and usage, see xnProductionNodeAddRef
XnNodeHandle xn::NodeWrapper::GetHandle ( ) const [inline]

Gets the underlying C handle.

const XnChar* xn::NodeWrapper::GetName ( ) const [inline]
XnBool xn::NodeWrapper::IsValid ( ) const [inline]

This method checks that this object points to an actual node (that has been 'created') and does not point to NULL.

Returns TRUE if the object points to a node, i.e., the node has been 'created'; FALSE otherwise.

Remarks

This method is a very important for managing nodes in the production graph. This check is concerned with the stage before actually creating the node, i.e., before invoking the node's Create() method.

xn::NodeWrapper::operator XnNodeHandle ( ) const [inline]
XnBool xn::NodeWrapper::operator!= ( const NodeWrapper other) [inline]

Checks if two node references do not point to the same actual node.

Parameters:
[in]otherAnother object
NodeWrapper& xn::NodeWrapper::operator= ( const NodeWrapper other) [inline]
XnBool xn::NodeWrapper::operator== ( const NodeWrapper other) [inline]

Checks if two node references point to the same actual node

Parameters:
[in]otherAnother object
void xn::NodeWrapper::Release ( ) [inline]

Unreference a production node, decreasing its reference count by 1. If the reference count reaches zero, the node will be destroyed.

void xn::NodeWrapper::SetHandle ( XnNodeHandle  hNode) [inline]

Replaces the object being pointed.

void xn::NodeWrapper::TakeOwnership ( XnNodeHandle  hNode) [inline]

Friends And Related Function Documentation

friend class Context [friend]

The documentation for this class was generated from the following file:
Generated on Wed May 16 2012 10:16:07 for OpenNI 1.5.4 by   doxygen 1.7.5.1