Encapsulate obscure detail that lower numeric priority is higher queue priority
[clinton/bobotpp.git] / source / ServerQueueItem.H
CommitLineData
cb21075d 1// ServerQueueItem.H -*- C++ -*-
2// Copyright (c) 1998 Etienne BERNARD
3
4// This program is free software; you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation; either version 2 of the License, or
7// any later version.
8
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License
15// along with this program; if not, write to the Free Software
c99c411a 16// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17// 02110-1301, USA.
cb21075d 18
19#ifndef SERVERQUEUEITEM_H
20#define SERVERQUEUEITEM_H
21
22class ServerQueueItem {
23public:
24 int priority, penalty, type;
25
26 enum {
27 CHANNELMODE, USERMODE, INVITE, JOIN, KICK,
28 NICK, NOTICE, PART, PASS, PING, PONG, PRIVMSG,
29 QUIT, TOPIC, USER, USERHOST, WHO, WHOIS, OTHER
30 };
31
32 ServerQueueItem(int, int, int);
33 virtual ~ServerQueueItem() { }
34
35 virtual bool merge(ServerQueueItem *) { return false; }
36 virtual String getLine() = 0;
37
94a03421 38 bool operator< (const ServerQueueItem & item);
39
cb21075d 40 friend class ServerQueue;
41
42private:
43 ServerQueueItem(const ServerQueueItem &);
44};
45
46
47class ServerQueueOtherItem : public ServerQueueItem {
48public:
49 String line;
50
51 ServerQueueOtherItem(String, int, int, int);
52 String getLine();
53};
54
55class ServerQueueChannelModeItem : public ServerQueueItem {
56public:
57 String channel;
58 String mode;
59 String parameters;
60 int paramcount;
61
62 ServerQueueChannelModeItem(String, String, String);
63 bool merge(ServerQueueItem *);
64 String getLine();
65};
66
67class ServerQueueKickItem : public ServerQueueItem {
68public:
69 String channel;
70 String who;
71 String reason;
72 int count;
73
74 ServerQueueKickItem(String, String, String);
75 bool merge(ServerQueueItem *);
76 String getLine();
77};
78
79class ServerQueueNoticeItem : public ServerQueueItem {
80public:
81 String dest;
82 String message;
83 int count;
84
85 ServerQueueNoticeItem(String, String);
86 bool merge(ServerQueueItem *);
87 String getLine();
88};
89
90#endif