Rev 1323 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 1323 | Rev 1326 | ||
|---|---|---|---|
| Line 9... | Line 9... | ||
| 9 | #define MESSAGE_H_ |
9 | #define MESSAGE_H_ |
| 10 | 10 | ||
| 11 | #include <string> |
11 | #include <string> |
| 12 | #include <vector> |
12 | #include <vector> |
| 13 | #include <map> |
13 | #include <map> |
| - | 14 | #include <boost/algorithm/string/trim.hpp> |
|
| 14 | #include "log/Logger.h" |
15 | #include "log/Logger.h" |
| 15 | #include "message/Variable.h" |
16 | #include "message/Variable.h" |
| 16 | #include "message/Header.h" |
17 | #include "message/Header.h" |
| 17 | #include "protocol/Protocol.h" |
18 | #include "protocol/Protocol.h" |
| 18 | #include "utils/convert.h" |
19 | #include "utils/convert.h" |
| 19 | 20 | ||
| 20 | using namespace std; |
21 | using namespace std; |
| 21 | 22 | ||
| 22 | namespace atom { |
23 | namespace atom { |
| 23 | namespace message { |
24 | namespace message { |
| - | 25 | ||
| - | 26 | using namespace boost::algorithm; |
|
| 24 | 27 | ||
| 25 | class Message |
28 | class Message |
| 26 | { |
29 | { |
| 27 | typedef std::map<std::string, Variable> variableMap; |
30 | typedef std::map<std::string, Variable> variableMap; |
| 28 | typedef std::vector<std::string> responseList; |
31 | typedef std::vector<std::string> responseList; |
| 29 | 32 | ||
| 30 | public: |
33 | public: |
| 31 | typedef boost::shared_ptr<Message> pointer; |
34 | typedef boost::shared_ptr<Message> pointer; |
| 32 | 35 | ||
| 33 | Message(Header header); |
36 | Message(Header header); |
| 34 | Message(); |
37 | Message(); |
| 35 | virtual ~Message(); |
38 | virtual ~Message(); |
| 36 | 39 | ||
| 37 | void setOrigin(const void *origin); |
40 | void setOrigin(const void *origin); |
| 38 | bool isOrigin(const void *origin); |
41 | bool isOrigin(const void *origin); |
| 39 | 42 | ||
| 40 | Header & getHeader(); |
43 | Header & getHeader(); |
| 41 | Variable & getVariable(string name); |
44 | Variable & getVariable(string name); |
| - | 45 | variableMap & getVariables(); |
|
| 42 | responseList getResponses(); |
46 | responseList getResponses(); |
| 43 | 47 | ||
| 44 | void readBits(BitBuffer & buffer); |
48 | void readBits(BitBuffer & buffer); |
| 45 | void writeBits(BitBuffer & buffeer); |
49 | void writeBits(BitBuffer & buffeer); |
| - | 50 | ||
| - | 51 | string toString(); |
|
| 46 | 52 | ||
| 47 | private: |
53 | private: |
| 48 | log::Logger LOG; |
54 | log::Logger LOG; |
| 49 | 55 | ||
| 50 | const void *myOrigin; |
56 | const void *myOrigin; |