-
Notifications
You must be signed in to change notification settings - Fork 1
/
Message.h
66 lines (56 loc) · 1.03 KB
/
Message.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef _RAIN_MESSAGE_H
#define _RAIN_MESSAGE_H
#include <wx/wx.h>
#include <wx/hashmap.h>
namespace RAIN
{
namespace BEnc
{
class Value;
}
}
WX_DECLARE_STRING_HASH_MAP(RAIN::BEnc::Value *, HeaderHash);
enum
{
MSG_STATUS_UNKNOWN,
MSG_STATUS_INCOMING,
MSG_STATUS_OUTGOING,
MSG_STATUS_LOCAL,
};
namespace RAIN
{
namespace BEnc
{
class Dictionary;
class List;
class String;
class Integer;
}
class MessageCore;
class Message
{
public:
Message();
Message(RAIN::Message *that);
Message(wxString *msg, int status);
~Message();
void Parse(wxString *hdrs);
void ImportHeaders();
void PrepareBroadcast();
wxString GetFromHash();
void Debug();
BEnc::Value * GetReply();
wxString CanonicalForm();
HeaderHash headers;
int status;
int subsystem;
};
class MessageHandler
{
public:
virtual void HandleMessage(RAIN::Message *msg) = 0;
virtual int GetMessageHandlerID() = 0;
virtual void Tick() = 0;
};
};
#endif//_RAIN_MESSAGE_H