From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- .../src/XorayaLogPlugin/CXorayaLogPlugin.h | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Master/Masterarbeit/src/XorayaLogPlugin/CXorayaLogPlugin.h (limited to 'Master/Masterarbeit/src/XorayaLogPlugin/CXorayaLogPlugin.h') diff --git a/Master/Masterarbeit/src/XorayaLogPlugin/CXorayaLogPlugin.h b/Master/Masterarbeit/src/XorayaLogPlugin/CXorayaLogPlugin.h new file mode 100644 index 0000000..da97fd1 --- /dev/null +++ b/Master/Masterarbeit/src/XorayaLogPlugin/CXorayaLogPlugin.h @@ -0,0 +1,67 @@ +/* + * CXorayaLogPlugin.h + * + * Created on: 25.10.2011 + * Author: Eisenhauer + */ + +#ifndef CXORAYALOGPLUGIN_H_ +#define CXORAYALOGPLUGIN_H_ + +#include +#include +#include "bounded_buffer.hpp" +#include "global.h" +#include "plugin_api.h" + +#define nLOG_MSG_BUFFER_SIZE 8192 +#define nINT_BUFF_SIZE 4096 +#define nLOGFILENAME_LENGTH 256 + +class IInterfaceManager; +class IPluginExecutor; + +class CXorayaLogPlugin: public IPlugin { +public: + CXorayaLogPlugin(); + virtual ~CXorayaLogPlugin(); + virtual void vRun(); + virtual tpstCanTxMessage pxGetCanTxMessage( const uint32_t u32MsgIndex ) + { + return NULL; + } + virtual uint32_t u32GetNumOfCanTxMessages( void ) + { + return 0; + } + virtual bool boIsLogger( void ) { return true; } + virtual bool boAutoload( void ) { return true; } + virtual int32_t i32GetCanInterfaceHandle( void ); + virtual tenRetCodes enGetLog(const char*, char*); + virtual void vInit(void* pvExecutor, void* pvIfMan, int32_t i32Interface,uint32_t u32PluginId); + void vStopIOThread(); + void vStop(); + virtual void vLogMessage(const tstLogMessage& stLogMessage); + +private: + IInterfaceManager* m_pxIfMan; + IPluginExecutor* m_pxExec; + uint32_t m_u32PluginId; + bool m_boStopIOThread; + x2e::Mutex m_xStopIOFlagMutex; + x2e::Mutex m_xLogBufferMutex; + int m_iFd; + char m_acLogBuffer[nINT_BUFF_SIZE]; + char m_acLogfileName[nLOGFILENAME_LENGTH]; + uint32_t m_u32LogMsgBufferCounter; + + bounded_buffer m_xLogMsgBuffer; + boost::function m_fctThreadProc; + boost::thread m_xIoThread; + + void vIoThreadProc(); + void vInitLogfile(); + tenRetCodes enRotateLogfile(); +}; + +#endif /* CXORAYALOGPLUGIN_H_ */ -- cgit v1.2.3