21#ifndef __XN_DUMP_WRITERS_H__
22#define __XN_DUMP_WRITERS_H__
62 XnDumpWriterBase() : m_bRegistered(
FALSE)
64 m_cObject.pCookie =
this;
65 m_cObject.OpenFile = OpenFileCallback;
66 m_cObject.Write = WriteCallback;
67 m_cObject.CloseFile = CloseFileCallback;
70 virtual ~XnDumpWriterBase()
101 m_bRegistered =
FALSE;
107 inline XnBool IsRegistered() {
return m_bRegistered; }
109 virtual XnDumpWriterFileHandle OpenFile(
const XnChar* strDumpName, XnBool bSessionDump,
const XnChar* strFileName) = 0;
119 virtual void OnRegister() {}
120 virtual void OnUnregister() {}
123 static XnDumpWriterFileHandle XN_CALLBACK_TYPE OpenFileCallback(
void* pCookie,
const XnChar* strDumpName, XnBool bSessionDump,
const XnChar* strFileName)
125 XnDumpWriterBase* pThis = (XnDumpWriterBase*)pCookie;
126 return pThis->OpenFile(strDumpName, bSessionDump, strFileName);
129 static void XN_CALLBACK_TYPE WriteCallback(
void* pCookie,
XnDumpWriterFileHandle hFile,
const void* pBuffer, XnUInt32 nBufferSize)
131 XnDumpWriterBase* pThis = (XnDumpWriterBase*)pCookie;
132 return pThis->Write(hFile, pBuffer, nBufferSize);
137 XnDumpWriterBase* pThis = (XnDumpWriterBase*)pCookie;
138 return pThis->CloseFile(hFile);
142 XnBool m_bRegistered;
XN_C_API void XN_C_DECL xnDumpUnregisterWriter(XnDumpWriter *pWriter)
XN_C_API XnStatus XN_C_DECL xnDumpSetFilesOutput(XnBool bOn)
XN_C_API XnStatus XN_C_DECL xnDumpRegisterWriter(XnDumpWriter *pWriter)
XnUInt32 XnStatus
Definition XnStatus.h:33
#define XN_STATUS_OK
Definition XnStatus.h:36
Definition XnDumpWriters.h:33
void * pInternal
Definition XnDumpWriters.h:34
Definition XnDumpWriters.h:38
void(* CloseFile)(void *pCookie, XnDumpWriterFileHandle hFile)
Definition XnDumpWriters.h:42
XnDumpWriterFileHandle(* OpenFile)(void *pCookie, const XnChar *strDumpName, XnBool bSessionDump, const XnChar *strFileName)
Definition XnDumpWriters.h:40
void * pCookie
Definition XnDumpWriters.h:39
void(* Write)(void *pCookie, XnDumpWriterFileHandle hFile, const void *pBuffer, XnUInt32 nBufferSize)
Definition XnDumpWriters.h:41