OpenNI 1.5.7
XnStatus.h
Go to the documentation of this file.
1/*****************************************************************************
2* *
3* OpenNI 1.x Alpha *
4* Copyright (C) 2012 PrimeSense Ltd. *
5* *
6* This file is part of OpenNI. *
7* *
8* Licensed under the Apache License, Version 2.0 (the "License"); *
9* you may not use this file except in compliance with the License. *
10* You may obtain a copy of the License at *
11* *
12* http://www.apache.org/licenses/LICENSE-2.0 *
13* *
14* Unless required by applicable law or agreed to in writing, software *
15* distributed under the License is distributed on an "AS IS" BASIS, *
16* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
17* See the License for the specific language governing permissions and *
18* limitations under the License. *
19* *
20*****************************************************************************/
21#ifndef __XN_OPEN_NI_STATUS_H__
22#define __XN_OPEN_NI_STATUS_H__
23
24#include "XnPlatform.h"
25
26//---------------------------------------------------------------------------
27// Types
28//---------------------------------------------------------------------------
29
33typedef XnUInt32 XnStatus;
34
36#define XN_STATUS_OK ((XnStatus)0)
37
38//---------------------------------------------------------------------------
39// API
40//---------------------------------------------------------------------------
41
49XN_C_API const XnChar* XN_C_DECL xnGetStatusString(const XnStatus Status);
50
58XN_C_API const XnChar* XN_C_DECL xnGetStatusName(const XnStatus Status);
59
67XN_C_API void XN_C_DECL xnPrintError(const XnStatus Status, const XnChar* csUserMessage);
68
69//---------------------------------------------------------------------------
70// Enums
71//---------------------------------------------------------------------------
79
81#define XN_STATUS_MAKE(group, code) ((group << 16) | code)
82
84#define XN_STATUS_GROUP(status) XnUInt16(status >> 16)
85
87#define XN_STATUS_CODE(status) XnUInt16(status & 0x0000FFFF)
88
90#define XN_STATUS_MESSAGE_MAP_START_FROM(group, first) \
91 enum _##group##first##Errors \
92 { \
93 group##first##_OK = XN_STATUS_MAKE(group, first),
94
95#define XN_STATUS_MESSAGE_MAP_START(group) \
96 XN_STATUS_MESSAGE_MAP_START_FROM(group, 0)
97
99#define XN_STATUS_MESSAGE(csName, csMessage) \
100 csName,
101
103#define XN_STATUS_MESSAGE_MAP_END_FROM(group, first) \
104 };
105
106#define XN_STATUS_MESSAGE_MAP_END(group) \
107 XN_STATUS_MESSAGE_MAP_END_FROM(group, 0)
108
109#endif // __XN_OPEN_NITE_STATUS_H__
#define XN_C_API
Definition XnPlatform.h:121
XN_C_API void XN_C_DECL xnPrintError(const XnStatus Status, const XnChar *csUserMessage)
XnErrorGroup
Definition XnStatus.h:74
@ XN_ERROR_GROUP_NI
Definition XnStatus.h:75
@ XN_ERROR_GROUP_OS
Definition XnStatus.h:76
@ XN_ERROR_GROUP_PRIMESENSE
Definition XnStatus.h:77
XnUInt32 XnStatus
Definition XnStatus.h:33
XN_C_API const XnChar *XN_C_DECL xnGetStatusName(const XnStatus Status)
XN_C_API const XnChar *XN_C_DECL xnGetStatusString(const XnStatus Status)