diff options
Diffstat (limited to 'linden/indra/llcommon/llkeythrottle.h')
-rw-r--r-- | linden/indra/llcommon/llkeythrottle.h | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/linden/indra/llcommon/llkeythrottle.h b/linden/indra/llcommon/llkeythrottle.h index 26009bb..c2dc9d2 100644 --- a/linden/indra/llcommon/llkeythrottle.h +++ b/linden/indra/llcommon/llkeythrottle.h | |||
@@ -1,17 +1,26 @@ | |||
1 | /** | 1 | /** |
2 | * @file llkeythrottle.h | 2 | * @file llkeythrottle.h |
3 | * @brief LLKeyThrottle class definition | ||
4 | * | 3 | * |
5 | * $LicenseInfo:firstyear=2005&license=internal$ | 4 | * $LicenseInfo:firstyear=2005&license=viewergpl$ |
6 | * | 5 | * |
7 | * Copyright (c) 2005-2008, Linden Research, Inc. | 6 | * Copyright (c) 2005-2008, Linden Research, Inc. |
8 | * | 7 | * |
9 | * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of | 8 | * Second Life Viewer Source Code |
10 | * this source code is governed by the Linden Lab Source Code Disclosure | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
11 | * Agreement ("Agreement") previously entered between you and Linden | 10 | * to you under the terms of the GNU General Public License, version 2.0 |
12 | * Lab. By accessing, using, copying, modifying or distributing this | 11 | * ("GPL"), unless you have obtained a separate licensing agreement |
13 | * software, you acknowledge that you have been informed of your | 12 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
14 | * obligations under the Agreement and agree to abide by those obligations. | 13 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
14 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
15 | * | ||
16 | * There are special exceptions to the terms and conditions of the GPL as | ||
17 | * it is applied to this Source Code. View the full text of the exception | ||
18 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
19 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
20 | * | ||
21 | * By copying, modifying or distributing this software, you acknowledge | ||
22 | * that you have read and understood your obligations described above, | ||
23 | * and agree to abide by those obligations. | ||
15 | * | 24 | * |
16 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | 25 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO |
17 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | 26 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, |
@@ -34,11 +43,16 @@ | |||
34 | #include <map> | 43 | #include <map> |
35 | 44 | ||
36 | 45 | ||
46 | // forward declaration so LLKeyThrottleImpl can befriend it | ||
47 | template <class T> class LLKeyThrottle; | ||
48 | |||
49 | |||
37 | // Implementation utility class - use LLKeyThrottle, not this | 50 | // Implementation utility class - use LLKeyThrottle, not this |
38 | template <class T> | 51 | template <class T> |
39 | class LLKeyThrottleImpl | 52 | class LLKeyThrottleImpl |
40 | { | 53 | { |
41 | public: | 54 | friend class LLKeyThrottle<T>; |
55 | protected: | ||
42 | struct Entry { | 56 | struct Entry { |
43 | U32 count; | 57 | U32 count; |
44 | BOOL blocked; | 58 | BOOL blocked; |
@@ -60,7 +74,9 @@ public: | |||
60 | // currMap started counting at this time | 74 | // currMap started counting at this time |
61 | // prevMap covers the previous interval | 75 | // prevMap covers the previous interval |
62 | 76 | ||
63 | LLKeyThrottleImpl() : prevMap(0), currMap(0) { } | 77 | LLKeyThrottleImpl() : prevMap(0), currMap(0), |
78 | countLimit(0), interval_usec(0), | ||
79 | start_usec(0) { }; | ||
64 | 80 | ||
65 | static U64 getTime() | 81 | static U64 getTime() |
66 | { | 82 | { |