diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-04-24 12:18:31 +0200 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-04-24 12:18:31 +0200 |
| commit | 68ba4945437e12eaa1dead6df27b58ea408f63e8 (patch) | |
| tree | a608d71e76dc82bf9ffdec95452c429d5aec29d2 /lib/CommLayer/CommLayerInner.h | |
| parent | 7b2d4874b7bd992ef3f09124b7ebbc346eba01f4 (diff) | |
| download | abrt-68ba4945437e12eaa1dead6df27b58ea408f63e8.tar.gz abrt-68ba4945437e12eaa1dead6df27b58ea408f63e8.tar.xz abrt-68ba4945437e12eaa1dead6df27b58ea408f63e8.zip | |
final touch on commlayer, minor fixes in exceptions (zprikryl)
Diffstat (limited to 'lib/CommLayer/CommLayerInner.h')
| -rw-r--r-- | lib/CommLayer/CommLayerInner.h | 102 |
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_ */ |
