diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/llmessage/llmessagethrottle.h | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmessage/llmessagethrottle.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/linden/indra/llmessage/llmessagethrottle.h b/linden/indra/llmessage/llmessagethrottle.h new file mode 100644 index 0000000..80d4ca3 --- /dev/null +++ b/linden/indra/llmessage/llmessagethrottle.h | |||
@@ -0,0 +1,81 @@ | |||
1 | /** | ||
2 | * @file llmessagethrottle.h | ||
3 | * @brief LLMessageThrottle class used for throttling messages. | ||
4 | * | ||
5 | * Copyright (c) 2004-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #ifndef LL_LLMESSAGETHROTTLE_H | ||
29 | #define LL_LLMESSAGETHROTTLE_H | ||
30 | |||
31 | #include <deque> | ||
32 | |||
33 | #include "linden_common.h" | ||
34 | #include "lluuid.h" | ||
35 | |||
36 | typedef enum e_message_throttle_categories | ||
37 | { | ||
38 | MTC_VIEWER_ALERT, | ||
39 | MTC_AGENT_ALERT, | ||
40 | MTC_EOF | ||
41 | } EMessageThrottleCats; | ||
42 | |||
43 | class LLMessageThrottleEntry | ||
44 | { | ||
45 | public: | ||
46 | LLMessageThrottleEntry(const size_t hash, const U64 entry_time) | ||
47 | : mHash(hash), mEntryTime(entry_time) {} | ||
48 | |||
49 | size_t getHash() { return mHash; } | ||
50 | U64 getEntryTime() { return mEntryTime; } | ||
51 | protected: | ||
52 | size_t mHash; | ||
53 | U64 mEntryTime; | ||
54 | }; | ||
55 | |||
56 | |||
57 | class LLMessageThrottle | ||
58 | { | ||
59 | public: | ||
60 | LLMessageThrottle(); | ||
61 | ~LLMessageThrottle(); | ||
62 | |||
63 | BOOL addViewerAlert (const LLUUID& to, const char* mesg); | ||
64 | BOOL addAgentAlert (const LLUUID& agent, const LLUUID& task, const char* mesg); | ||
65 | |||
66 | void pruneEntries(); | ||
67 | |||
68 | protected: | ||
69 | typedef std::deque<LLMessageThrottleEntry> message_list_t; | ||
70 | typedef std::deque<LLMessageThrottleEntry>::iterator message_list_iterator_t; | ||
71 | typedef std::deque<LLMessageThrottleEntry>::reverse_iterator message_list_reverse_iterator_t; | ||
72 | typedef std::deque<LLMessageThrottleEntry>::const_iterator message_list_const_iterator_t; | ||
73 | typedef std::deque<LLMessageThrottleEntry>::const_reverse_iterator message_list_const_reverse_iterator_t; | ||
74 | message_list_t mMessageList[MTC_EOF]; | ||
75 | }; | ||
76 | |||
77 | extern LLMessageThrottle gMessageThrottle; | ||
78 | |||
79 | #endif | ||
80 | |||
81 | |||