Subversion Repositories HomeAutomation

Rev

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

  1. /*
  2.  * Header.h
  3.  *
  4.  *  Created on: Jul 23, 2009
  5.  *      Author: Mattias Runge
  6.  */
  7.  
  8. #ifndef HEADER_H_
  9. #define HEADER_H_
  10.  
  11. #include <map>
  12. #include <boost/algorithm/string/trim.hpp>
  13. #include "message/Variable.h"
  14. #include "message/BitBuffer.h"
  15. #include "protocol/Protocol.h"
  16. #include "utils/convert.h"
  17. #include "Exception.hpp"
  18. #include "log/Logger.h"
  19.  
  20. namespace atom {
  21. namespace message {
  22.  
  23. using namespace std;
  24. using namespace boost::algorithm;
  25.  
  26. class Header
  27. {
  28.     typedef std::map<std::string, Variable> variableMap;
  29.  
  30. public:
  31.     Header();
  32.     Header(BitBuffer & buffer);
  33.     Header(unsigned long moduleId, string moduleType, string messageType);
  34.     virtual ~Header();
  35.  
  36.     unsigned long getModuleId();
  37.     string getModuleType();
  38.     string getMessageType();
  39.  
  40.     void readBits(BitBuffer & buffer);
  41.     void writeBits(BitBuffer & buffer);
  42.  
  43.     string toString();
  44.  
  45. private:
  46.     log::Logger LOG;
  47.  
  48.     variableMap myVariables;
  49.  
  50.     void loadVariables();
  51. };
  52.  
  53. }
  54. }
  55.  
  56. #endif /* HEADER_H_ */
  57.