From bcf4c69ca5fdd6489ca1c09890971fc8f647aa1b Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Thu, 23 Apr 2009 14:42:40 +0200 Subject: Added intercomm layer so plugins can send various information to the daemon. --- lib/CommLayer/CommLayerInner.h | 63 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 lib/CommLayer/CommLayerInner.h (limited to 'lib/CommLayer/CommLayerInner.h') diff --git a/lib/CommLayer/CommLayerInner.h b/lib/CommLayer/CommLayerInner.h new file mode 100644 index 0000000..2cca935 --- /dev/null +++ b/lib/CommLayer/CommLayerInner.h @@ -0,0 +1,63 @@ +#ifndef COMMLAYERINNER_H_ +#define COMMLAYERINNER_H_ + +#include +#include "Observer.h" + +class CDebug +{ + private: + CObserver *m_pObs; + public: + CDebug(CObserver *pObs){ m_pObs = pObs; } + + void operator << (const std::string& pMsg) + { + if(m_pObs) + m_pObs->Debug(pMsg); + } +}; + +class CWarning +{ + private: + CObserver *m_pObs; + public: + CWarning(CObserver *pObs){ m_pObs = pObs; } + + void operator << (const std::string& pMsg) + { + if(m_pObs) + m_pObs->Warning(pMsg); + } +}; + +class CStatusUpdate +{ + private: + CObserver *m_pObs; + public: + CStatusUpdate(CObserver *pObs){ m_pObs = pObs; } + + void operator << (const std::string& pMsg) + { + if(m_pObs) + m_pObs->StatusUpdate(pMsg); + } +}; + +class CCommLayerInner{ + private: + CObserver *m_pObs; + public: + CDebug DEBUGINFO; + CWarning WARNING; + CStatusUpdate STATUS; + CCommLayerInner(CObserver *pObs); + ~CCommLayerInner(); + CDebug& Debug(); + CWarning& Warning(); + CStatusUpdate& Status(); +}; + +#endif /* COMMLAYERINNER_H_ */ -- cgit