diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-04-23 14:42:40 +0200 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-04-23 14:42:40 +0200 |
| commit | bcf4c69ca5fdd6489ca1c09890971fc8f647aa1b (patch) | |
| tree | e5fedc350ae9368faf77360ea4fb3c0f6d264210 /lib/CommLayer/CommLayerInner.h | |
| parent | 99047bce024f1d23c953649cf56ff67e754e44ef (diff) | |
| download | abrt-bcf4c69ca5fdd6489ca1c09890971fc8f647aa1b.tar.gz abrt-bcf4c69ca5fdd6489ca1c09890971fc8f647aa1b.tar.xz abrt-bcf4c69ca5fdd6489ca1c09890971fc8f647aa1b.zip | |
Added intercomm layer so plugins can send various information to the daemon.
Diffstat (limited to 'lib/CommLayer/CommLayerInner.h')
| -rw-r--r-- | lib/CommLayer/CommLayerInner.h | 63 |
1 files changed, 63 insertions, 0 deletions
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 <iostream> +#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_ */ |
