aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llassetuploadqueue.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llassetuploadqueue.h
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llassetuploadqueue.h')
-rw-r--r--linden/indra/newview/llassetuploadqueue.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/linden/indra/newview/llassetuploadqueue.h b/linden/indra/newview/llassetuploadqueue.h
new file mode 100644
index 0000000..7c98a99
--- /dev/null
+++ b/linden/indra/newview/llassetuploadqueue.h
@@ -0,0 +1,96 @@
1/**
2 * @file llassetuploadqueue.h
3 * @brief Serializes asset upload request
4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007-2008, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
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://secondlifegrid.net/programs/open_source/licensing/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://secondlifegrid.net/programs/open_source/licensing/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 * $/LicenseInfo$
30 */
31
32#ifndef LL_LLASSETUPLOADQUEUE_H
33#define LL_LLASSETUPLOADQUEUE_H
34
35#include "lluuid.h"
36
37#include <string>
38#include <deque>
39
40class LLAssetUploadQueueSupplier;
41
42class LLAssetUploadQueue
43{
44public:
45
46 // Takes ownership of supplier.
47 LLAssetUploadQueue(LLAssetUploadQueueSupplier* supplier);
48 virtual ~LLAssetUploadQueue();
49
50 void queue(const std::string& filename,
51 const LLUUID& task_id,
52 const LLUUID& item_id,
53 BOOL is_running,
54 BOOL is_target_mono,
55 const LLUUID& queue_id,
56 U8* data,
57 U32 data_size,
58 std::string script_name);
59
60 bool isEmpty() const {return mQueue.empty();}
61
62private:
63
64 friend class LLAssetUploadChainResponder;
65
66 struct UploadData
67 {
68 std::string mFilename;
69 LLUUID mTaskId;
70 LLUUID mItemId;
71 BOOL mIsRunning;
72 BOOL mIsTargetMono;
73 LLUUID mQueueId;
74 U8* mData;
75 U32 mDataSize;
76 std::string mScriptName;
77 };
78
79 // Ownership of mSupplier passed to currently waiting responder
80 // and returned to queue when no requests in progress.
81 LLAssetUploadQueueSupplier* mSupplier;
82 std::deque<UploadData> mQueue;
83
84 // Passes on ownership of mSupplier if request is made.
85 void request(LLAssetUploadQueueSupplier** supplier);
86};
87
88class LLAssetUploadQueueSupplier
89{
90public:
91 virtual ~LLAssetUploadQueueSupplier();
92 virtual LLAssetUploadQueue* get() const = 0;
93 virtual void log(std::string message) const = 0;
94};
95
96#endif // LL_LLASSETUPLOADQUEUE_H