Subversion Repositories HomeAutomation

Rev

Rev 1319 | 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.  
  18. namespace atom {
  19. namespace message {
  20.  
  21. using namespace std;
  22.  
  23. class Variable
  24. {
  25. public:
  26.     Variable();
  27.     Variable(string name, string datatype, bool required, string unit);
  28.     virtual ~Variable();
  29.  
  30.     string getName();
  31.     Datatype::pointer getDatatype();
  32.     string getUnit();
  33.     bool isRequired();
  34.  
  35.     void readBits(BitBuffer & buffer);
  36.     void writeBits(BitBuffer & buffer);
  37.  
  38. private:
  39.     string myName;
  40.     Datatype::pointer myDatatype;
  41.     bool myRequired;
  42.     string myUnit;
  43. };
  44.  
  45. }
  46. }
  47.  
  48. #endif /* VARIABLE_H_ */
  49.