Subversion Repositories HomeAutomation

Rev

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

Rev Author Line No. Line
1596 runge 1
/*
2
 *
3
 *  Copyright (C) 2010  Mattias Runge
4
 *
5
 *  This program is free software; you can redistribute it and/or modify
6
 *  it under the terms of the GNU General Public License as published by
7
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  (at your option) any later version.
9
 *
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 *  GNU General Public License for more details.
14
 *
15
 *  You should have received a copy of the GNU General Public License along
16
 *  with this program; if not, write to the Free Software Foundation, Inc.,
17
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
 *
19
 */
20
 
21
#ifndef CAN_MESSAGE_H
22
#define CAN_MESSAGE_H
23
 
24
#include <string>
25
#include <map>
26
 
27
#include <boost/shared_ptr.hpp>
28
 
1642 runge 29
#include "common/common.h"
1602 runge 30
 
1596 runge 31
namespace atom {
32
namespace can {
33
 
34
class Message
35
{
36
public:
37
    typedef boost::shared_ptr<Message> Pointer;
38
 
39
    Message(std::string class_name, std::string direction_name, std::string module_name, unsigned int id, std::string command_name);
40
    virtual ~Message();
41
 
42
    std::string GetClassName();
43
    std::string GetDirectionName();
44
    std::string GetModuleName();
45
    unsigned int GetId();
46
    std::string GetCommandName();
47
 
48
    std::string GetVariable(std::string name);
49
    void SetVariable(std::string name, std::string value);
50
 
1642 runge 51
    common::StringMap& GetVariables();
52
    void SetVariables(common::StringMap variables);
1596 runge 53
 
54
private:
55
    std::string class_name_;
56
    std::string direction_name_;
57
    std::string module_name_;
58
    unsigned int id_;
59
    std::string command_name_;
1642 runge 60
    common::StringMap variables_;
1596 runge 61
};
62
 
63
}; // namespace can
64
}; // namespace atom
65
 
66
#endif // CAN_MESSAGE_H