OpenNI 1.5.4
XnStatus.h
Go to the documentation of this file.
1/****************************************************************************
2* *
3* OpenNI 1.x Alpha *
4* Copyright (C) 2011 PrimeSense Ltd. *
5* *
6* This file is part of OpenNI. *
7* *
8* OpenNI is free software: you can redistribute it and/or modify *
9* it under the terms of the GNU Lesser General Public License as published *
10* by the Free Software Foundation, either version 3 of the License, or *
11* (at your option) any later version. *
12* *
13* OpenNI is distributed in the hope that it will be useful, *
14* but WITHOUT ANY WARRANTY; without even the implied warranty of *
15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16* GNU Lesser General Public License for more details. *
17* *
18* You should have received a copy of the GNU Lesser General Public License *
19* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
20* *
21****************************************************************************/
22#ifndef __XN_OPEN_NI_STATUS_H__
23#define __XN_OPEN_NI_STATUS_H__
24
25#include "XnPlatform.h"
26
27//---------------------------------------------------------------------------
28// Types
29//---------------------------------------------------------------------------
30
34typedef XnUInt32 XnStatus;
35
37#define XN_STATUS_OK ((XnStatus)0)
38
39//---------------------------------------------------------------------------
40// API
41//---------------------------------------------------------------------------
42
50XN_C_API const XnChar* XN_C_DECL xnGetStatusString(const XnStatus Status);
51
59XN_C_API const XnChar* XN_C_DECL xnGetStatusName(const XnStatus Status);
60
68XN_C_API void XN_C_DECL xnPrintError(const XnStatus Status, const XnChar* csUserMessage);
69
70//---------------------------------------------------------------------------
71// Enums
72//---------------------------------------------------------------------------
74typedef enum XnErrorGroup
75{
80
82#define XN_STATUS_MAKE(group, code) ((group << 16) | code)
83
85#define XN_STATUS_GROUP(status) XnUInt16(status >> 16)
86
88#define XN_STATUS_CODE(status) XnUInt16(status & 0x0000FFFF)
89
91#define XN_STATUS_MESSAGE_MAP_START_FROM(group, first) \
92 enum _##group##first##Errors \
93 { \
94 group##first##_OK = XN_STATUS_MAKE(group, first),
95
96#define XN_STATUS_MESSAGE_MAP_START(group) \
97 XN_STATUS_MESSAGE_MAP_START_FROM(group, 0)
98
100#define XN_STATUS_MESSAGE(csName, csMessage) \
101 csName,
102
104#define XN_STATUS_MESSAGE_MAP_END_FROM(group, first) \
105 };
106
107#define XN_STATUS_MESSAGE_MAP_END(group) \
108 XN_STATUS_MESSAGE_MAP_END_FROM(group, 0)
109
110#endif // __XN_OPEN_NITE_STATUS_H__
#define XN_C_API
Definition: XnPlatform.h:129
XN_C_API void XN_C_DECL xnPrintError(const XnStatus Status, const XnChar *csUserMessage)
XnErrorGroup
Definition: XnStatus.h:75
@ XN_ERROR_GROUP_NI
Definition: XnStatus.h:76
@ XN_ERROR_GROUP_OS
Definition: XnStatus.h:77
@ XN_ERROR_GROUP_PRIMESENSE
Definition: XnStatus.h:78
XnUInt32 XnStatus
Definition: XnStatus.h:34
XN_C_API const XnChar *XN_C_DECL xnGetStatusName(const XnStatus Status)
XN_C_API const XnChar *XN_C_DECL xnGetStatusString(const XnStatus Status)