Subversion Repositories HomeAutomation

Rev

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

Rev Author Line No. Line
1309 runge 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
 
1310 runge 13
Variable::Variable(string name, string datatype, bool required, string unit)
1309 runge 14
{
1310 runge 15
    this->myName = name;
1309 runge 16
    this->myRequired = required;
17
    this->myUnit = unit;
18
 
1322 runge 19
    this->myDatatype = Datatype::create(datatype);
1309 runge 20
}
21
 
22
Variable::Variable()
23
{
24
}
25
 
26
Variable::~Variable()
27
{
28
}
29
 
1322 runge 30
string Variable::getName()
1310 runge 31
{
1322 runge 32
    return this->myName;
1310 runge 33
}
34
 
1322 runge 35
Datatype::pointer Variable::getDatatype()
1310 runge 36
{
1322 runge 37
    return this->myDatatype;
1310 runge 38
}
39
 
1322 runge 40
string Variable::getUnit()
41
{
42
    return this->myUnit;
43
}
44
 
45
bool Variable::isRequired()
46
{
47
    return this->myRequired;
48
}
49
 
1309 runge 50
void Variable::readBits(BitBuffer & buffer)
51
{
1322 runge 52
    this->myDatatype->readBits(buffer);
1309 runge 53
}
54
 
1322 runge 55
void Variable::writeBits(BitBuffer & buffer)
56
{
57
    this->myDatatype->writeBits(buffer);
1309 runge 58
}
1322 runge 59
 
1309 runge 60
}
1322 runge 61
}