summaryrefslogtreecommitdiffstats
path: root/lib/CommLayer/CommLayerInner.h
diff options
context:
space:
mode:
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_ */