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.cpp | |
| 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.cpp')
| -rw-r--r-- | lib/CommLayer/CommLayerInner.cpp | 69 |
1 files changed, 49 insertions, 20 deletions
diff --git a/lib/CommLayer/CommLayerInner.cpp b/lib/CommLayer/CommLayerInner.cpp index 41fd3c1..a7c5123 100644 --- a/lib/CommLayer/CommLayerInner.cpp +++ b/lib/CommLayer/CommLayerInner.cpp @@ -1,28 +1,57 @@ #include "CommLayerInner.h" -CCommLayerInner::CCommLayerInner(CObserver *pObs) -: DEBUGINFO(pObs), - WARNING(pObs), - STATUS(pObs) +namespace CommLayerInner { - m_pObs = pObs; -} -CCommLayerInner::~CCommLayerInner() -{ -} + static CDebug* g_pDebug = NULL; + static CWarning* g_pWarning = NULL; + static CStatus* g_pStatus = NULL; -CDebug& CCommLayerInner::Debug() -{ - return DEBUGINFO; -} -CWarning& CCommLayerInner::Warning() -{ - return WARNING; -} + void init_debug(CObserver* pObserver) + { + if (!g_pDebug) + { + g_pDebug = new CDebug(pObserver); + } + } -CStatusUpdate& CCommLayerInner::Status() -{ - return STATUS; + void init_warning(CObserver* pObserver) + { + if (!g_pWarning) + { + g_pWarning = new CWarning(pObserver); + } + } + + void init_status(CObserver* pObserver) + { + if (!g_pStatus) + { + g_pStatus = new CStatus(pObserver); + } + } + + void debug(const std::string& pMessage) + { + if (g_pDebug) + { + g_pDebug->Message(pMessage); + } + } + void warning(const std::string& pMessage) + { + if (g_pWarning) + { + g_pWarning->Message(pMessage); + } + } + + void status(const std::string& pMessage) + { + if (g_pStatus) + { + g_pStatus->Message(pMessage); + } + } } |
