Subversion Repositories HomeAutomation

Rev

Rev 1323 | Details | Compare with Previous | Last modification | View Log | SVN | RSS feed

Rev Author Line No. Line
1309 runge 1
/*
2
 * Header.h
3
 *
4
 *  Created on: Jul 23, 2009
5
 *      Author: Mattias Runge
6
 */
7
 
8
#ifndef HEADER_H_
9
#define HEADER_H_
10
 
11
#include <map>
1326 runge 12
#include <boost/algorithm/string/trim.hpp>
1310 runge 13
#include "message/Variable.h"
1319 runge 14
#include "message/BitBuffer.h"
1311 runge 15
#include "protocol/Protocol.h"
1314 runge 16
#include "utils/convert.h"
1326 runge 17
#include "Exception.hpp"
18
#include "log/Logger.h"
1309 runge 19
 
20
namespace atom {
21
namespace message {
22
 
1310 runge 23
using namespace std;
1326 runge 24
using namespace boost::algorithm;
1309 runge 25
 
26
class Header
27
{
28
    typedef std::map<std::string, Variable> variableMap;
29
 
30
public:
31
    Header();
1323 runge 32
    Header(BitBuffer & buffer);
33
    Header(unsigned long moduleId, string moduleType, string messageType);
1309 runge 34
    virtual ~Header();
35
 
1323 runge 36
    unsigned long getModuleId();
37
    string getModuleType();
38
    string getMessageType();
1309 runge 39
 
40
    void readBits(BitBuffer & buffer);
1323 runge 41
    void writeBits(BitBuffer & buffer);
1309 runge 42
 
1326 runge 43
    string toString();
44
 
1309 runge 45
private:
1326 runge 46
    log::Logger LOG;
47
 
1309 runge 48
    variableMap myVariables;
1323 runge 49
 
50
    void loadVariables();
1309 runge 51
};
52
 
53
}
54
}
55
 
56
#endif /* HEADER_H_ */