OpenNI 1.0.0
|
00001 /***************************************************************************** 00002 * * 00003 * OpenNI 1.0 Alpha * 00004 * Copyright (C) 2010 PrimeSense Ltd. * 00005 * * 00006 * This file is part of OpenNI. * 00007 * * 00008 * OpenNI is free software: you can redistribute it and/or modify * 00009 * it under the terms of the GNU Lesser General Public License as published * 00010 * by the Free Software Foundation, either version 3 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * OpenNI is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public License * 00019 * along with OpenNI. If not, see <http://www.gnu.org/licenses/>. * 00020 * * 00021 *****************************************************************************/ 00022 00023 00024 00025 00026 #ifndef __XN_OPEN_NITE_STATUS_H__ 00027 #define __XN_OPEN_NITE_STATUS_H__ 00028 00029 #include "XnPlatform.h" 00030 00031 //--------------------------------------------------------------------------- 00032 // Types 00033 //--------------------------------------------------------------------------- 00034 00038 typedef XnUInt32 XnStatus; 00039 00041 static const XnStatus XN_STATUS_OK = 0; 00042 00043 //--------------------------------------------------------------------------- 00044 // API 00045 //--------------------------------------------------------------------------- 00046 00054 XN_C_API const XnChar* xnGetStatusString(const XnStatus Status); 00055 00063 XN_C_API const XnChar* xnGetStatusName(const XnStatus Status); 00064 00072 XN_C_API void xnPrintError(const XnStatus Status, const XnChar* csUserMessage); 00073 00074 //--------------------------------------------------------------------------- 00075 // Enums 00076 //--------------------------------------------------------------------------- 00078 typedef enum XnErrorGroup 00079 { 00080 XN_ERROR_GROUP_NI = 1, 00081 XN_ERROR_GROUP_OS = 2, 00082 XN_ERROR_GROUP_PRIMESENSE = 3, 00083 } XnErrorGroup; 00084 00086 #define XN_STATUS_MAKE(group, code) ((group << 16) | code) 00087 00089 #define XN_STATUS_GROUP(status) (status >> 16) 00090 00092 #define XN_STATUS_CODE(status) (status & 0x0000FFFF) 00093 00095 #define XN_STATUS_MESSAGE_MAP_START_FROM(group, first) \ 00096 enum _##group##first##Errors \ 00097 { \ 00098 group##first##_OK = XN_STATUS_MAKE(group, first), 00099 00100 #define XN_STATUS_MESSAGE_MAP_START(group) \ 00101 XN_STATUS_MESSAGE_MAP_START_FROM(group, 0) 00102 00104 #define XN_STATUS_MESSAGE(csName, csMessage) \ 00105 csName, 00106 00108 #define XN_STATUS_MESSAGE_MAP_END_FROM(group, first) \ 00109 }; 00110 00111 #define XN_STATUS_MESSAGE_MAP_END(group) \ 00112 XN_STATUS_MESSAGE_MAP_END_FROM(group, 0) 00113 00114 #endif // __XN_OPEN_NITE_STATUS_H__