1 #ifndef __XN_DUMP_WRITERS_H__
2 #define __XN_DUMP_WRITERS_H__
39 class XnDumpWriterBase
42 XnDumpWriterBase() : m_bRegistered(
FALSE)
44 m_cObject.pCookie =
this;
45 m_cObject.OpenFile = OpenFileCallback;
46 m_cObject.Write = WriteCallback;
47 m_cObject.CloseFile = CloseFileCallback;
50 virtual ~XnDumpWriterBase()
81 m_bRegistered =
FALSE;
87 inline XnBool IsRegistered() {
return m_bRegistered; }
89 virtual XnDumpWriterFileHandle OpenFile(
const XnChar* strDumpName, XnBool bSessionDump,
const XnChar* strFileName) = 0;
99 virtual void OnRegister() {}
100 virtual void OnUnregister() {}
103 static XnDumpWriterFileHandle XN_CALLBACK_TYPE OpenFileCallback(
void* pCookie,
const XnChar* strDumpName, XnBool bSessionDump,
const XnChar* strFileName)
105 XnDumpWriterBase* pThis = (XnDumpWriterBase*)pCookie;
106 return pThis->OpenFile(strDumpName, bSessionDump, strFileName);
109 static void XN_CALLBACK_TYPE WriteCallback(
void* pCookie,
XnDumpWriterFileHandle hFile,
const void* pBuffer, XnUInt32 nBufferSize)
111 XnDumpWriterBase* pThis = (XnDumpWriterBase*)pCookie;
112 return pThis->Write(hFile, pBuffer, nBufferSize);
117 XnDumpWriterBase* pThis = (XnDumpWriterBase*)pCookie;
118 return pThis->CloseFile(hFile);
122 XnBool m_bRegistered;
XN_C_API void XN_C_DECL xnDumpUnregisterWriter(XnDumpWriter *pWriter)
struct XnDumpWriter XnDumpWriter
XN_C_API XnStatus XN_C_DECL xnDumpSetFilesOutput(XnBool bOn)
struct XnDumpWriterFileHandle XnDumpWriterFileHandle
XN_C_API XnStatus XN_C_DECL xnDumpRegisterWriter(XnDumpWriter *pWriter)
XnUInt32 XnStatus
Definition: XnStatus.h:34
#define XN_STATUS_OK
Definition: XnStatus.h:37
Definition: XnDumpWriters.h:13
void * pInternal
Definition: XnDumpWriters.h:14
Definition: XnDumpWriters.h:18
void(* CloseFile)(void *pCookie, XnDumpWriterFileHandle hFile)
Definition: XnDumpWriters.h:22
XnDumpWriterFileHandle(* OpenFile)(void *pCookie, const XnChar *strDumpName, XnBool bSessionDump, const XnChar *strFileName)
Definition: XnDumpWriters.h:20
void * pCookie
Definition: XnDumpWriters.h:19
void(* Write)(void *pCookie, XnDumpWriterFileHandle hFile, const void *pBuffer, XnUInt32 nBufferSize)
Definition: XnDumpWriters.h:21