From 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:50 -0500 Subject: Second Life viewer sources 1.14.0.0 --- linden/indra/llmessage/llassetstorage.h | 72 +++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 8 deletions(-) (limited to 'linden/indra/llmessage/llassetstorage.h') diff --git a/linden/indra/llmessage/llassetstorage.h b/linden/indra/llmessage/llassetstorage.h index deccad3..639ab59 100644 --- a/linden/indra/llmessage/llassetstorage.h +++ b/linden/indra/llmessage/llassetstorage.h @@ -109,6 +109,19 @@ public: BOOL mDataSentInFirstPacket; BOOL mDataIsInVFS; LLUUID mRequestingAgentID; // Only valid for uploads from an agent + + virtual LLSD getTerseDetails() const; + virtual LLSD getFullDetails() const; +}; + +template +struct ll_asset_request_equal : public std::equal_to +{ + bool operator()(const T& x, const T& y) const + { + return ( x->getType() == y->getType() + && x->getUUID() == y->getUUID() ); + } }; @@ -184,6 +197,15 @@ public: LLVFS *mVFS; typedef void (*LLStoreAssetCallback)(const LLUUID &asset_id, void *user_data, S32 status); + enum ERequestType + { + RT_INVALID = -1, + RT_DOWNLOAD = 0, + RT_UPLOAD = 1, + RT_LOCALUPLOAD = 2, + RT_COUNT = 3 + }; + protected: BOOL mShutDown; LLHost mUpstreamHost; @@ -191,9 +213,11 @@ protected: LLMessageSystem *mMessageSys; LLXferManager *mXferManager; - std::list mPendingDownloads; - std::list mPendingUploads; - std::list mPendingLocalUploads; + + typedef std::list request_list_t; + request_list_t mPendingDownloads; + request_list_t mPendingUploads; + request_list_t mPendingLocalUploads; public: LLAssetStorage(LLMessageSystem *msg, LLXferManager *xfer, @@ -258,14 +282,48 @@ public: const LLUUID &asset_id, LLAssetType::EType atype, LLGetAssetCallback cb, void *user_data, BOOL is_priority = FALSE); // Get a particular inventory item. +protected: + virtual LLSD getPendingDetails(const request_list_t* requests, + LLAssetType::EType asset_type, + const std::string& detail_prefix) const; + + virtual LLSD getPendingRequest(const request_list_t* requests, + LLAssetType::EType asset_type, + const LLUUID& asset_id) const; + + virtual bool deletePendingRequest(request_list_t* requests, + LLAssetType::EType asset_type, + const LLUUID& asset_id); + +public: + static const LLAssetRequest* findRequest(const request_list_t* requests, + LLAssetType::EType asset_type, + const LLUUID& asset_id); + static LLAssetRequest* findRequest(request_list_t* requests, + LLAssetType::EType asset_type, + const LLUUID& asset_id); + + request_list_t* getRequestList(ERequestType rt); + const request_list_t* getRequestList(ERequestType rt) const; + static std::string getRequestName(ERequestType rt); S32 getNumPendingDownloads() const; S32 getNumPendingUploads() const; S32 getNumPendingLocalUploads(); + S32 getNumPending(ERequestType rt) const; + + virtual LLSD getPendingDetails(ERequestType rt, + LLAssetType::EType asset_type, + const std::string& detail_prefix) const; + + virtual LLSD getPendingRequest(ERequestType rt, + LLAssetType::EType asset_type, + const LLUUID& asset_id) const; + + virtual bool deletePendingRequest(ERequestType rt, + LLAssetType::EType asset_type, + const LLUUID& asset_id); - // Returns a map from type to num pending, eg 'texture' => 5, 'object' => 10 - LLSD getPendingDownloadTypes() const; - LLSD getPendingUploadTypes() const; // download process callbacks static void downloadCompleteCallback( @@ -349,8 +407,6 @@ private: LLXferManager *xfer, LLVFS *vfs, const LLHost &upstream_host); - LLSD getPendingTypes(const std::list& requests) const; - }; //////////////////////////////////////////////////////////////////////// -- cgit v1.1