Subversion Repositories HomeAutomation

Rev

Rev 1914 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1914 Rev 2216
Line 20... Line 20...
20
 
20
 
21
#ifndef BROKER_MESSAGE_H
21
#ifndef BROKER_MESSAGE_H
22
#define BROKER_MESSAGE_H
22
#define BROKER_MESSAGE_H
23
 
23
 
24
#include <boost/shared_ptr.hpp>
24
#include <boost/shared_ptr.hpp>
-
 
25
 
-
 
26
#include "common/Byteset.h"
25
 
27
 
26
namespace atom {
28
namespace atom {
27
namespace broker {
29
namespace broker {
28
 
30
 
29
class Origin
31
class Origin
Line 38... Line 40...
38
   
40
 
39
    typedef enum
41
    typedef enum
40
    {
42
    {
41
        CAN_MESSAGE,
43
        CAN_MESSAGE,
42
    CAN_RAW_MESSAGE,
44
        CAN_RAW_MESSAGE,
43
        JS_COMMAND
45
        JS_COMMAND,
-
 
46
        CAN_RAW_BYTES
44
    } Type;
47
    } Type;
45
   
48
 
46
    Message(Type type, PayloadPointer payload, Origin* origin);
49
    Message(Type type, PayloadPointer payload, Origin* origin);
-
 
50
    Message(Type type, common::Byteset data, Origin* origin);
47
    virtual ~Message();
51
    virtual ~Message();
48
   
52
 
49
    Type GetType();
53
    Type GetType();
50
    PayloadPointer GetPayload();
54
    PayloadPointer GetPayload();
51
    bool TestIfOrigin(Origin* origin);
55
    bool TestIfOrigin(Origin* origin);
-
 
56
 
-
 
57
    common::Byteset GetRawData();
-
 
58
 
-
 
59
 
52
   
60
 
53
private:
61
private:
54
    Type type_;
62
    Type type_;
55
    PayloadPointer payload_;
63
    PayloadPointer payload_;
-
 
64
    common::Byteset data_;
56
    Origin* origin_;
65
    Origin* origin_;
57
   
-
 
58
};
66
};
59
 
67
 
60
}; // namespace broker
68
}; // namespace broker
61
}; // namespace atom
69
}; // namespace atom
62
 
70