summaryrefslogtreecommitdiffstats
path: root/tests/manual/kinectsurface/QtKinectWrapper/OpenNI/Include/XnEnumerationErrors.h
blob: 4a1d77ce9c3702d25890ce940a310c5b420a59d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/****************************************************************************
*                                                                           *
*  OpenNI 1.x Alpha                                                         *
*  Copyright (C) 2011 PrimeSense Ltd.                                       *
*                                                                           *
*  This file is part of OpenNI.                                             *
*                                                                           *
*  OpenNI is free software: you can redistribute it and/or modify           *
*  it under the terms of the GNU Lesser General Public License as published *
*  by the Free Software Foundation, either version 3 of the License, or     *
*  (at your option) any later version.                                      *
*                                                                           *
*  OpenNI is distributed in the hope that it will be useful,                *
*  but WITHOUT ANY WARRANTY; without even the implied warranty of           *
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the             *
*  GNU Lesser General Public License for more details.                      *
*                                                                           *
*  You should have received a copy of the GNU Lesser General Public License *
*  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.           *
*                                                                           *
****************************************************************************/
#ifndef __XN_ENUMERATION_ERRORS_H__
#define __XN_ENUMERATION_ERRORS_H__

//---------------------------------------------------------------------------
// Includes
//---------------------------------------------------------------------------
#include <XnTypes.h>

/**
 * @ingroup cref
 * @defgroup enum_errors Enumeration Errors
 * This page details functions for managing an Enumeration Errors object.
 *
 * @section enum Enumeration
 *
 * The following code iterates over an enumeration errors object:
 * @code
for (XnEnumerationErrorsIterator it = xnEnumerationErrorsGetFirst(pList); 
	xnEnumerationErrorsIteratorIsValid(it); 
	it = xnEnumerationErrorsGetNext(it))
{
	const XnProductionNodeDescription* pCurrDesc = xnEnumerationErrorsGetCurrentDescription(it);
	XnStatus nCurrError = xnEnumerationErrorsGetCurrentError(it);
	...
}
 * @endcode
 * @{
 */

//---------------------------------------------------------------------------
// Types
//---------------------------------------------------------------------------
/**
 * Represents an iterator for an @ref XnEnumerationErrors object.
 */
typedef struct XnModuleError* XnEnumerationErrorsIterator;

//---------------------------------------------------------------------------
// Functions
//---------------------------------------------------------------------------


/**
 * Allocates an enumeration errors object.
 *
 * @param	ppErrors		[out]	The allocated object
 */
XN_C_API XnStatus XN_C_DECL xnEnumerationErrorsAllocate(XnEnumerationErrors** ppErrors);

/**
 * Frees an enumeration errors object
 *
 * @param	pErrors		[in]	Parameter description
 */
XN_C_API void XN_C_DECL xnEnumerationErrorsFree(const XnEnumerationErrors* pErrors);

/**
 * Adds an error to the object.
 *
 * @param	pErrors		[in]	Enumeration Errors object.
 * @param	pDesc		[in]	Description of the failing module.
 * @param	nError		[in]	The enumeration error that occurred.
 */
XN_C_API XnStatus XN_C_DECL xnEnumerationErrorsAdd(XnEnumerationErrors* pErrors, const XnProductionNodeDescription* pDesc, XnStatus nError);

/**
 * Returns a string representation of the Enumeration Errors object.
 *
 * @param	pErrors		[in]	Enumeration Errors object.
 * @param	csBuffer	[in]	A char buffer to be filled.
 * @param	nSize		[in]	Size of the char buffer.
 */
XN_C_API XnStatus XN_C_DECL xnEnumerationErrorsToString(const XnEnumerationErrors* pErrors, XnChar* csBuffer, XnUInt32 nSize);

/**
 * Clears an Enumeration Errors object from all errors in it.
 *
 * @param	pErrors		[in]	Enumeration Errors object.
 */
XN_C_API XnStatus XN_C_DECL xnEnumerationErrorsClear(XnEnumerationErrors* pErrors);

/**
 * Gets an iterator to the first error in the object.
 *
 * @param	pErrors		[in]	Enumeration Errors object.
 */
XN_C_API XnEnumerationErrorsIterator XN_C_DECL xnEnumerationErrorsGetFirst(const XnEnumerationErrors* pErrors);

/**
 * Gets an iterator to the next error in the object.
 *
 * @param	it		[in]	An iterator to an error in the object.
 */
XN_C_API XnEnumerationErrorsIterator XN_C_DECL xnEnumerationErrorsGetNext(XnEnumerationErrorsIterator it);

/**
 * Checks if an iterator is valid (i.e. points to a real error)
 *
 * @param	it		[in]	The iterator to check.
 */
XN_C_API XnBool XN_C_DECL xnEnumerationErrorsIteratorIsValid(XnEnumerationErrorsIterator it);

/**
 * Gets the description of the node from current error.
 *
 * @param	it		[in]	The iterator to the error.
 */
XN_C_API const XnProductionNodeDescription* XN_C_DECL xnEnumerationErrorsGetCurrentDescription(XnEnumerationErrorsIterator it);

/**
 * Gets the enumeration error caused when enumerating the node.
 *
 * @param	it		[in]	The iterator to the error.
 */
XN_C_API XnStatus XN_C_DECL xnEnumerationErrorsGetCurrentError(XnEnumerationErrorsIterator it);

/**
 * @}
 */

#endif // __XN_ENUMERATION_ERRORS_H__