OpenNI 1.5.4: XnStatus.h Source File

OpenNI

OpenNI 1.5.4
XnStatus.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 *                                                                           *
00003 *  OpenNI 1.x Alpha                                                         *
00004 *  Copyright (C) 2011 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 #ifndef __XN_OPEN_NI_STATUS_H__
00023 #define __XN_OPEN_NI_STATUS_H__
00024 
00025 #include "XnPlatform.h"
00026 
00027 //---------------------------------------------------------------------------
00028 // Types
00029 //---------------------------------------------------------------------------
00030 
00034 typedef XnUInt32 XnStatus;
00035 
00037 #define XN_STATUS_OK ((XnStatus)0)
00038 
00039 //---------------------------------------------------------------------------
00040 // API
00041 //---------------------------------------------------------------------------
00042 
00050 XN_C_API const XnChar* XN_C_DECL xnGetStatusString(const XnStatus Status);
00051 
00059 XN_C_API const XnChar* XN_C_DECL xnGetStatusName(const XnStatus Status);
00060 
00068 XN_C_API void XN_C_DECL xnPrintError(const XnStatus Status, const XnChar* csUserMessage);
00069 
00070 //---------------------------------------------------------------------------
00071 // Enums
00072 //---------------------------------------------------------------------------
00074 typedef enum XnErrorGroup
00075 {
00076     XN_ERROR_GROUP_NI = 1,
00077     XN_ERROR_GROUP_OS = 2,
00078     XN_ERROR_GROUP_PRIMESENSE = 3,
00079 } XnErrorGroup;
00080 
00082 #define XN_STATUS_MAKE(group, code)     ((group << 16) | code)
00083 
00085 #define XN_STATUS_GROUP(status)         XnUInt16(status >> 16)
00086 
00088 #define XN_STATUS_CODE(status)          XnUInt16(status & 0x0000FFFF)
00089 
00091 #define XN_STATUS_MESSAGE_MAP_START_FROM(group, first)      \
00092     enum _##group##first##Errors                            \
00093     {                                                       \
00094         group##first##_OK = XN_STATUS_MAKE(group, first),
00095 
00096 #define XN_STATUS_MESSAGE_MAP_START(group)                  \
00097     XN_STATUS_MESSAGE_MAP_START_FROM(group, 0)
00098 
00100 #define XN_STATUS_MESSAGE(csName, csMessage)    \
00101         csName,
00102 
00104 #define XN_STATUS_MESSAGE_MAP_END_FROM(group, first)    \
00105     };
00106 
00107 #define XN_STATUS_MESSAGE_MAP_END(group)    \
00108     XN_STATUS_MESSAGE_MAP_END_FROM(group, 0)
00109 
00110 #endif // __XN_OPEN_NITE_STATUS_H__
Generated on Wed May 16 2012 10:16:05 for OpenNI 1.5.4 by   doxygen 1.7.5.1