NITE 1.5.1 - API Reference

XnVMessage.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002 *                                                                              *
00003 *   PrimeSense NITE 1.3                                                        *
00004 *   Copyright (C) 2010 PrimeSense Ltd.                                         *
00005 *                                                                              *
00006 *******************************************************************************/
00007 
00008 
00009 #ifndef _XNV_MESSAGE_H_
00010 #define _XNV_MESSAGE_H_
00011 
00012 #include "XnVNiteDefs.h"
00013 
00014 // Macros to get a specific part of the Message, if such a specific part exists
00015 #define XNV_GET_SPECIFIC_MESSAGE_BY_TYPE(pMessage, SpecificType, strTypeDescription) \
00016     dynamic_cast<SpecificType*>((*pMessage)[strTypeDescription])
00017 
00018 #define XNV_GET_SPECIFIC_MESSAGE(pMessage, SpecificType) \
00019     XNV_GET_SPECIFIC_MESSAGE_BY_TYPE(pMessage, SpecificType, SpecificType::ms_strType)
00020 
00025 class XNV_NITE_API XnVMessage
00026 {
00027 public:
00034     XnVMessage(const XnChar* strType, void* pData);
00035     virtual ~XnVMessage();
00036 
00042     void* GetData();
00043 
00052     virtual XnVMessage* operator[](const XnChar* strType);
00053 
00059     const XnChar* GetType() const;
00065     virtual XnVMessage* Clone() const = 0;
00066 protected:
00067     XnChar* m_strType;
00068     void* m_pData;
00069 
00070     XnBool m_bFreeOnDestruction;
00071 };
00072 
00073 #endif // _XNV_MESSAGE_H_