PageRenderTime 24ms CodeModel.GetById 16ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/llmessage/lltransfersourceasset.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 81 lines | 43 code | 13 blank | 25 comment | 0 complexity | 9ef50e48985a7b06f80b1169d96e913a MD5 | raw file
 1/** 
 2 * @file lltransfersourceasset.h
 3 * @brief Transfer system for sending an asset.
 4 *
 5 * $LicenseInfo:firstyear=2006&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLTRANSFERSOURCEASSET_H
28#define LL_LLTRANSFERSOURCEASSET_H
29
30#include "lltransfermanager.h"
31#include "llassetstorage.h"
32
33class LLVFile;
34
35class LLTransferSourceParamsAsset : public LLTransferSourceParams
36{
37public:
38	LLTransferSourceParamsAsset();
39	virtual ~LLTransferSourceParamsAsset() {}
40	/*virtual*/ void packParams(LLDataPacker &dp) const;
41	/*virtual*/ BOOL unpackParams(LLDataPacker &dp);
42
43	void setAsset(const LLUUID &asset_id, const LLAssetType::EType asset_type);
44
45	LLUUID getAssetID() const						{ return mAssetID; }
46	LLAssetType::EType getAssetType() const			{ return mAssetType; }
47
48protected:
49	LLUUID				mAssetID;
50	LLAssetType::EType	mAssetType;
51};
52
53class LLTransferSourceAsset : public LLTransferSource
54{
55public:
56	LLTransferSourceAsset(const LLUUID &request_id, const F32 priority);
57	virtual ~LLTransferSourceAsset();
58
59	static void responderCallback(LLVFS *vfs, const LLUUID& uuid, LLAssetType::EType type,
60								  void *user_data, S32 result, LLExtStat ext_status );
61protected:
62	/*virtual*/ void initTransfer();
63	/*virtual*/ F32 updatePriority();
64	/*virtual*/ LLTSCode dataCallback(const S32 packet_id,
65									  const S32 max_bytes,
66									  U8 **datap,
67									  S32 &returned_bytes,
68									  BOOL &delete_returned);
69	/*virtual*/ void completionCallback(const LLTSCode status);
70
71	virtual void packParams(LLDataPacker& dp) const;
72	/*virtual*/ BOOL unpackParams(LLDataPacker &dp);
73
74protected:
75	LLTransferSourceParamsAsset mParams;
76	BOOL mGotResponse;
77
78	S32 mCurPos;
79};
80
81#endif // LL_LLTRANSFERSOURCEASSET_H