diff --git a/include/siadrive_api/debugconsumer.h b/include/siadrive_api/debugconsumer.h new file mode 100644 index 0000000..df1bf62 --- /dev/null +++ b/include/siadrive_api/debugconsumer.h @@ -0,0 +1,21 @@ +#pragma once +#include + +NS_BEGIN(Sia) +NS_BEGIN(Api) + +class CEvent; + +class SIADRIVE_EXPORTABLE CDebugConsumer +{ +public: + CDebugConsumer(); + +public: + ~CDebugConsumer(); + +private: + void ProcessEvent(const CEvent& eventData); +}; + +NS_END(2); diff --git a/include/siadrive_api/loggingconsumer.h b/include/siadrive_api/loggingconsumer.h new file mode 100644 index 0000000..c341c85 --- /dev/null +++ b/include/siadrive_api/loggingconsumer.h @@ -0,0 +1,20 @@ +#pragma once +#include + +NS_BEGIN(Sia) +NS_BEGIN(Api) + +class CEvent; +class SIADRIVE_EXPORTABLE CLoggingConsumer +{ +public: + CLoggingConsumer(); + +public: + ~CLoggingConsumer(); + +private: + void ProcessEvent(const CEvent& eventData); +}; + +NS_END(2) \ No newline at end of file diff --git a/src/siadrive_api/debugconsumer.cpp b/src/siadrive_api/debugconsumer.cpp new file mode 100644 index 0000000..69727ef --- /dev/null +++ b/src/siadrive_api/debugconsumer.cpp @@ -0,0 +1,19 @@ +#include +#include + +using namespace Sia::Api; + +CDebugConsumer::CDebugConsumer() +{ + CEventSystem::EventSystem.AddEventConsumer([this](const CEvent& event) { this->ProcessEvent(event); }); +} + +CDebugConsumer::~CDebugConsumer() +{ +} + +void CDebugConsumer::ProcessEvent(const CEvent& eventData) +{ + OutputDebugString(eventData.GetSingleLineMessage().str().c_str()); + OutputDebugString(L"\n"); +} diff --git a/src/siadrive_api/loggingconsumer.cpp b/src/siadrive_api/loggingconsumer.cpp new file mode 100644 index 0000000..3ef7b1f --- /dev/null +++ b/src/siadrive_api/loggingconsumer.cpp @@ -0,0 +1,19 @@ +#include +#include + +using namespace Sia::Api; + +CLoggingConsumer::CLoggingConsumer() +{ + CEventSystem::EventSystem.AddEventConsumer([=](const CEvent& event) {this->ProcessEvent(event); }); +} + + +CLoggingConsumer::~CLoggingConsumer() +{ +} + +void CLoggingConsumer::ProcessEvent(const CEvent& eventData) +{ + +} \ No newline at end of file