PageRenderTime 26ms CodeModel.GetById 15ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1
  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. #ifndef LL_LLTRANSFERSOURCEASSET_H
  27. #define LL_LLTRANSFERSOURCEASSET_H
  28. #include "lltransfermanager.h"
  29. #include "llassetstorage.h"
  30. class LLVFile;
  31. class LLTransferSourceParamsAsset : public LLTransferSourceParams
  32. {
  33. public:
  34. LLTransferSourceParamsAsset();
  35. virtual ~LLTransferSourceParamsAsset() {}
  36. /*virtual*/ void packParams(LLDataPacker &dp) const;
  37. /*virtual*/ BOOL unpackParams(LLDataPacker &dp);
  38. void setAsset(const LLUUID &asset_id, const LLAssetType::EType asset_type);
  39. LLUUID getAssetID() const { return mAssetID; }
  40. LLAssetType::EType getAssetType() const { return mAssetType; }
  41. protected:
  42. LLUUID mAssetID;
  43. LLAssetType::EType mAssetType;
  44. };
  45. class LLTransferSourceAsset : public LLTransferSource
  46. {
  47. public:
  48. LLTransferSourceAsset(const LLUUID &request_id, const F32 priority);
  49. virtual ~LLTransferSourceAsset();
  50. static void responderCallback(LLVFS *vfs, const LLUUID& uuid, LLAssetType::EType type,
  51. void *user_data, S32 result, LLExtStat ext_status );
  52. protected:
  53. /*virtual*/ void initTransfer();
  54. /*virtual*/ F32 updatePriority();
  55. /*virtual*/ LLTSCode dataCallback(const S32 packet_id,
  56. const S32 max_bytes,
  57. U8 **datap,
  58. S32 &returned_bytes,
  59. BOOL &delete_returned);
  60. /*virtual*/ void completionCallback(const LLTSCode status);
  61. virtual void packParams(LLDataPacker& dp) const;
  62. /*virtual*/ BOOL unpackParams(LLDataPacker &dp);
  63. protected:
  64. LLTransferSourceParamsAsset mParams;
  65. BOOL mGotResponse;
  66. S32 mCurPos;
  67. };
  68. #endif // LL_LLTRANSFERSOURCEASSET_H