XnStatus.h
Go to the documentation of this file.
/****************************************************************************
* *
* 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_OPEN_NI_STATUS_H__
#define __XN_OPEN_NI_STATUS_H__
#include "XnPlatform.h"
//---------------------------------------------------------------------------
// Types
//---------------------------------------------------------------------------
typedef XnUInt32 XnStatus;
#define XN_STATUS_OK ((XnStatus)0)
//---------------------------------------------------------------------------
// API
//---------------------------------------------------------------------------
XN_C_API const XnChar* XN_C_DECL xnGetStatusString(const XnStatus Status);
XN_C_API const XnChar* XN_C_DECL xnGetStatusName(const XnStatus Status);
XN_C_API void XN_C_DECL xnPrintError(const XnStatus Status, const XnChar* csUserMessage);
//---------------------------------------------------------------------------
// Enums
//---------------------------------------------------------------------------
typedef enum XnErrorGroup
{
XN_ERROR_GROUP_NI = 1,
XN_ERROR_GROUP_OS = 2,
XN_ERROR_GROUP_PRIMESENSE = 3,
} XnErrorGroup;
#define XN_STATUS_MAKE(group, code) ((group << 16) | code)
#define XN_STATUS_GROUP(status) XnUInt16(status >> 16)
#define XN_STATUS_CODE(status) XnUInt16(status & 0x0000FFFF)
#define XN_STATUS_MESSAGE_MAP_START_FROM(group, first) \
enum _##group##first##Errors \
{ \
group##first##_OK = XN_STATUS_MAKE(group, first),
#define XN_STATUS_MESSAGE_MAP_START(group) \
XN_STATUS_MESSAGE_MAP_START_FROM(group, 0)
#define XN_STATUS_MESSAGE(csName, csMessage) \
csName,
#define XN_STATUS_MESSAGE_MAP_END_FROM(group, first) \
};
#define XN_STATUS_MESSAGE_MAP_END(group) \
XN_STATUS_MESSAGE_MAP_END_FROM(group, 0)
#endif // __XN_OPEN_NITE_STATUS_H__
XnPlatform.h
XN_C_API
#define XN_C_API
Definition XnPlatform.h:132
xnPrintError
XN_C_API void XN_C_DECL xnPrintError(const XnStatus Status, const XnChar *csUserMessage)
XnErrorGroup
XnErrorGroup
Definition XnStatus.h:75
XN_ERROR_GROUP_NI
@ XN_ERROR_GROUP_NI
Definition XnStatus.h:76
XN_ERROR_GROUP_OS
@ XN_ERROR_GROUP_OS
Definition XnStatus.h:77
XN_ERROR_GROUP_PRIMESENSE
@ XN_ERROR_GROUP_PRIMESENSE
Definition XnStatus.h:78
XnStatus
XnUInt32 XnStatus
Definition XnStatus.h:34
xnGetStatusName
XN_C_API const XnChar *XN_C_DECL xnGetStatusName(const XnStatus Status)
xnGetStatusString
XN_C_API const XnChar *XN_C_DECL xnGetStatusString(const XnStatus Status)