summaryrefslogtreecommitdiffstats
path: root/lib/CommLayer/CommLayerInner.h
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-04-23 14:42:40 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2009-04-23 14:42:40 +0200
commitbcf4c69ca5fdd6489ca1c09890971fc8f647aa1b (patch)
treee5fedc350ae9368faf77360ea4fb3c0f6d264210 /lib/CommLayer/CommLayerInner.h
parent99047bce024f1d23c953649cf56ff67e754e44ef (diff)
downloadabrt-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.h63
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_ */