Subversion Repositories HomeAutomation

Rev

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

  1. /*
  2.  * Variable.cpp
  3.  *
  4.  *  Created on: Jul 21, 2009
  5.  *      Author: Mattias Runge
  6.  */
  7.  
  8. #include "Variable.h"
  9.  
  10. namespace atom {
  11. namespace message {
  12.  
  13. Variable::Variable(string name, string datatype, bool required, string unit)
  14. {
  15.     this->myName = name;
  16.     this->myRequired = required;
  17.     this->myUnit = unit;
  18.  
  19.     this->myDatatype = Datatype::create(datatype);
  20. }
  21.  
  22. Variable::Variable()
  23. {
  24. }
  25.  
  26. Variable::~Variable()
  27. {
  28. }
  29.  
  30. string Variable::getName()
  31. {
  32.     return this->myName;
  33. }
  34.  
  35. Datatype::pointer Variable::getDatatype()
  36. {
  37.     return this->myDatatype;
  38. }
  39.  
  40. string Variable::getUnit()
  41. {
  42.     return this->myUnit;
  43. }
  44.  
  45. bool Variable::isRequired()
  46. {
  47.     return this->myRequired;
  48. }
  49.  
  50. void Variable::readBits(BitBuffer & buffer)
  51. {
  52.     this->myDatatype->readBits(buffer);
  53. }
  54.  
  55. void Variable::writeBits(BitBuffer & buffer)
  56. {
  57.     this->myDatatype->writeBits(buffer);
  58. }
  59.  
  60. }
  61. }
  62.