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.h102
1 files changed, 52 insertions, 50 deletions
diff --git a/lib/CommLayer/CommLayerInner.h b/lib/CommLayer/CommLayerInner.h
index 2cca935..7edd257 100644
--- a/lib/CommLayer/CommLayerInner.h
+++ b/lib/CommLayer/CommLayerInner.h
@@ -4,60 +4,62 @@
#include <iostream>
#include "Observer.h"
-class CDebug
+namespace CommLayerInner
{
- 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 CDebug
+ {
+ private:
+ CObserver *m_pObs;
+ public:
+ CDebug(CObserver *pObs) :
+ m_pObs(pObs)
+ {}
+ void Message(const std::string& pMsg)
+ {
+ if(m_pObs)
+ m_pObs->Debug(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 CWarning
+ {
+ private:
+ CObserver *m_pObs;
+ public:
+ CWarning(CObserver *pObs) :
+ m_pObs(pObs)
+ {}
+ void Message(const std::string& pMsg)
+ {
+ if(m_pObs)
+ m_pObs->Warning(pMsg);
+ }
+ };
+
+ class CStatus
+ {
+ private:
+ CObserver *m_pObs;
+ public:
+ CStatus(CObserver *pObs) :
+ m_pObs(pObs)
+ {}
+ void Message(const std::string& pMsg)
+ {
+ if(m_pObs)
+ m_pObs->Status(pMsg);
+ }
+ };
+
+
+ void init_debug(CObserver* pObserver);
+ void init_warning(CObserver* pObserver);
+ void init_status(CObserver* pObserver);
-class CCommLayerInner{
- private:
- CObserver *m_pObs;
- public:
- CDebug DEBUGINFO;
- CWarning WARNING;
- CStatusUpdate STATUS;
- CCommLayerInner(CObserver *pObs);
- ~CCommLayerInner();
- CDebug& Debug();
- CWarning& Warning();
- CStatusUpdate& Status();
+ void debug(const std::string& pMessage);
+ void warning(const std::string& pMessage);
+ void status(const std::string& pMessage);
};
#endif /* COMMLAYERINNER_H_ */