Subversion Repositories HomeAutomation

Rev

Rev 1326 | 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. #include "log/Logger.h"
  19.  
  20. namespace atom {
  21. namespace message {
  22.  
  23. using namespace std;
  24.  
  25. class Variable
  26. {
  27. public:
  28.     Variable();
  29.     Variable(xml::Node xmlNode);
  30.     virtual ~Variable();
  31.  
  32.     string getName();
  33.     Datatype::pointer getDatatype();
  34.     string getUnit();
  35.     bool isRequired();
  36.  
  37.     void readBits(BitBuffer & buffer);
  38.     void writeBits(BitBuffer & buffer);
  39.  
  40.     string toString();
  41.  
  42. private:
  43.     log::Logger LOG;
  44.  
  45.     string myName;
  46.     Datatype::pointer myDatatype;
  47.     bool myRequired;
  48.     string myUnit;
  49. };
  50.  
  51. }
  52. }
  53.  
  54. #endif /* VARIABLE_H_ */
  55.