Subversion Repositories HomeAutomation

Rev

Rev 1310 | Rev 1314 | 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 "utils/BitBuffer.h"
  15. #include "protocol/Protocol.h"
  16.  
  17. namespace atom {
  18. namespace message {
  19.  
  20. using namespace std;
  21. using namespace utils;
  22.  
  23. class Variable
  24. {
  25. public:
  26.     Variable();
  27.     Variable(string name, string datatype, bool required, string unit);
  28.     virtual ~Variable();
  29.  
  30.     boost::any getValue();
  31.     void setValue(boost::any value);
  32.  
  33.     void readBits(BitBuffer & buffer);
  34.  
  35. private:
  36.     string myName;
  37.     Datatype::pointer myDatatype;
  38.     bool myRequired;
  39.     string myUnit;
  40.     unsigned int myLength;
  41. };
  42.  
  43. }
  44. }
  45.  
  46. #endif /* VARIABLE_H_ */
  47.