Subversion Repositories HomeAutomation

Rev

Rev 1326 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1326 Rev 1403
Line 15... Line 15...
15
#include "log/Logger.h"
15
#include "log/Logger.h"
16
#include "message/Variable.h"
16
#include "message/Variable.h"
17
#include "message/Header.h"
17
#include "message/Header.h"
18
#include "protocol/Protocol.h"
18
#include "protocol/Protocol.h"
19
#include "utils/convert.h"
19
#include "utils/convert.h"
20
 
-
 
21
using namespace std;
-
 
22
 
20
 
23
namespace atom {
21
namespace atom {
24
namespace message {
-
 
25
 
22
 
26
using namespace boost::algorithm;
23
//using namespace boost::algorithm;
27
 
24
 
28
class Message
25
class Message
29
{
26
{
30
    typedef std::map<std::string, Variable> variableMap;
-
 
31
    typedef std::vector<std::string> responseList;
-
 
32
 
-
 
33
public:
27
public:
34
    typedef boost::shared_ptr<Message> pointer;
28
    typedef boost::shared_ptr<Message> Pointer;
35
 
29
 
36
    Message(Header header);
30
    Message(const void *origin);
37
    Message();
31
    Message();
38
    virtual ~Message();
32
    virtual ~Message();
39
 
33
 
40
    void setOrigin(const void *origin);
34
    const void *GetOrigin() const;
41
    bool isOrigin(const void *origin);
-
 
42
 
35
 
43
    Header & getHeader();
36
    Header & getHeader();
44
    Variable & getVariable(string name);
37
    Variable & getVariable(string name);
45
    variableMap & getVariables();
38
    variableMap & getVariables();
46
    responseList getResponses();
39
    responseList getResponses();
47
 
-
 
48
    void readBits(BitBuffer & buffer);
-
 
49
    void writeBits(BitBuffer & buffeer);
-
 
50
 
40
 
51
    string toString();
41
    string toString();
52
 
42
 
53
private:
43
private:
-
 
44
    typedef std::map<std::string, Variable> variableMap;
-
 
45
    typedef std::vector<std::string> responseList;
-
 
46
 
-
 
47
 
54
    log::Logger LOG;
48
    log::Logger LOG;
55
 
49
 
56
    const void *myOrigin;
50
    const void *myOrigin;
57
 
51
 
58
    Header myHeader;
52
    Header myHeader;
59
    variableMap myVariables;
53
    variableMap myVariables;
60
    responseList myResponses;
54
    responseList myResponses;
61
};
55
};
62
 
56
 
63
}
-
 
64
}
57
} // namespace atom
65
 
58
 
66
#endif /* MESSAGE_H_ */
59
#endif /* MESSAGE_H_ */