Subversion Repositories HomeAutomation

Rev

Rev 1323 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. /*
  2.  * Variable.h
  3.  *
  4.  *  Created on: Jul 21, 2009
  5.  *      Author: Mattias Runge
  6.  */
  7.  
  8. #ifndef VARIABLE_H_
  9. #define VARIABLE_H_
  10.  
  11. #include <string>
  12. #include <boost/make_shared.hpp>
  13. #include "message/Datatype.h"
  14. #include "message/BitBuffer.h"
  15. #include "protocol/Protocol.h"
  16. #include "utils/convert.h"
  17. #include "xml/Node.h"
  18.  
  19. namespace atom {
  20. namespace message {
  21.  
  22. using namespace std;
  23.  
  24. class Variable
  25. {
  26. public:
  27.     Variable();
  28.     Variable(xml::Node xmlNode);
  29.     virtual ~Variable();
  30.  
  31.     string getName();
  32.     Datatype::pointer getDatatype();
  33.     string getUnit();
  34.     bool isRequired();
  35.  
  36.     void readBits(BitBuffer & buffer);
  37.     void writeBits(BitBuffer & buffer);
  38.  
  39.     string toString();
  40.  
  41. private:
  42.     string myName;
  43.     Datatype::pointer myDatatype;
  44.     bool myRequired;
  45.     string myUnit;
  46. };
  47.  
  48. }
  49. }
  50.  
  51. #endif /* VARIABLE_H_ */
  52.