blob: 7edd2578110c6d9e8c971db208199dce8ef34fc0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
#ifndef COMMLAYERINNER_H_
#define COMMLAYERINNER_H_
#include <iostream>
#include "Observer.h"
namespace CommLayerInner
{
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 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);
void debug(const std::string& pMessage);
void warning(const std::string& pMessage);
void status(const std::string& pMessage);
};
#endif /* COMMLAYERINNER_H_ */
|