Subversion Repositories HomeAutomation

Rev

Rev 1326 | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. /*
  2.  * Message.h
  3.  *
  4.  *  Created on: Apr 25, 2009
  5.  *      Author: Mattias Runge
  6.  */
  7.  
  8. #ifndef MESSAGE_H_
  9. #define MESSAGE_H_
  10.  
  11. #include <string>
  12. #include <vector>
  13. #include <map>
  14. #include <boost/algorithm/string/trim.hpp>
  15. #include "log/Logger.h"
  16. #include "message/Variable.h"
  17. #include "message/Header.h"
  18. #include "protocol/Protocol.h"
  19. #include "utils/convert.h"
  20.  
  21. namespace atom {
  22.  
  23. //using namespace boost::algorithm;
  24.  
  25. class Message
  26. {
  27. public:
  28.     typedef boost::shared_ptr<Message> Pointer;
  29.  
  30.     Message(const void *origin);
  31.     Message();
  32.     virtual ~Message();
  33.  
  34.     const void *GetOrigin() const;
  35.  
  36.     Header & getHeader();
  37.     Variable & getVariable(string name);
  38.     variableMap & getVariables();
  39.     responseList getResponses();
  40.  
  41.     string toString();
  42.  
  43. private:
  44.     typedef std::map<std::string, Variable> variableMap;
  45.     typedef std::vector<std::string> responseList;
  46.  
  47.  
  48.     log::Logger LOG;
  49.  
  50.     const void *myOrigin;
  51.  
  52.     Header myHeader;
  53.     variableMap myVariables;
  54.     responseList myResponses;
  55. };
  56.  
  57. } // namespace atom
  58.  
  59. #endif /* MESSAGE_H_ */
  60.