aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/lllogtextmessage.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:46 -0500
committerJacek Antonelli2008-08-15 23:44:46 -0500
commit38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch)
treeadca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/llmessage/lllogtextmessage.h
parentREADME.txt (diff)
downloadmeta-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 'linden/indra/llmessage/lllogtextmessage.h')
-rw-r--r--linden/indra/llmessage/lllogtextmessage.h95
1 files changed, 95 insertions, 0 deletions
diff --git a/linden/indra/llmessage/lllogtextmessage.h b/linden/indra/llmessage/lllogtextmessage.h
new file mode 100644
index 0000000..2413376
--- /dev/null
+++ b/linden/indra/llmessage/lllogtextmessage.h
@@ -0,0 +1,95 @@
1/**
2 * @file lllogtextmessage.h
3 * @author Phoenix
4 * @date 2005-01-11
5 * @brief Declaration of class for coalescing text logs generated
6 * from chat and IM
7 *
8 * Copyright (c) 2005-2007, Linden Research, Inc.
9 *
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 */
30
31#ifndef LL_LLLOGTEXTMESSAGE_H
32#define LL_LLLOGTEXTMESSAGE_H
33
34#include <deque>
35#include <string>
36
37#include "lluuid.h"
38#include "llhost.h"
39
40/**
41 * @class LLLogTextMessage
42 * @brief This class represents a coalesced collection of text messages
43 * generated by agents and their objects.
44 *
45 * This class is intended to be used as a singleton. Since use on the
46 * simulator and userserver is somewhat different the class does not
47 * enforce a singleton or provide an extern.
48 */
49class LLLogTextMessage
50{
51public:
52 LLLogTextMessage(const LLHost& dataserver) :
53 mDataserver(dataserver),
54 mPendingSize(0) {}
55 ~LLLogTextMessage();
56
57 void log(const LLUUID& from, const LLUUID& to, const char* mesg);
58 void log(const LLUUID& from, F64 global_x, F64 global_y, const char* mesg);
59 void log(
60 const LLUUID& from,
61 const LLUUID& to,
62 F64 global_x,
63 F64 global_y,
64 const char* mesg);
65 void flush();
66
67protected:
68 struct LLLogTextMessageData
69 {
70 LLLogTextMessageData(
71 const LLUUID& from,
72 const LLUUID& to,
73 const F64& global_x,
74 const F64& gloabl_y,
75 const char* message);
76 LLUUID mFromID;
77 LLUUID mToID;
78 F64 mGlobalX;
79 F64 mGlobalY;
80 std::string mMessage;
81 S32 mTime;
82 };
83
84 // The destination of the messages
85 LLHost mDataserver;
86
87 // Keep the messages queued in order of arrival.
88 std::deque<LLLogTextMessageData> mQueue;
89
90 // Tracks the outgoing message size in bytes of the pending queued
91 // text logs.
92 S32 mPendingSize;
93};
94
95#endif // LL_LLLOGTEXTMESSAGE_H