PageRenderTime 62ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llprimitive/llvolumemessage.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 92 lines | 46 code | 10 blank | 36 comment | 0 complexity | 90c0e058c2b885645ffee21e7f7cba85 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llvolumemessage.h
  3. * @brief LLVolumeMessage base class
  4. *
  5. * $LicenseInfo:firstyear=2001&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_LLVOLUMEMESSAGE_H
  27. #define LL_LLVOLUMEMESSAGE_H
  28. #include "llvolume.h"
  29. class LLMessageSystem;
  30. class LLDataPacker;
  31. // wrapper class for some volume/message functions
  32. class LLVolumeMessage
  33. {
  34. protected:
  35. // The profile and path params are protected since they do not do
  36. // any kind of parameter validation or clamping. Use the public
  37. // pack and unpack volume param methods below
  38. static bool packProfileParams(
  39. const LLProfileParams* params,
  40. LLMessageSystem* mesgsys);
  41. static bool packProfileParams(
  42. const LLProfileParams* params,
  43. LLDataPacker& dp);
  44. static bool unpackProfileParams(
  45. LLProfileParams* params,
  46. LLMessageSystem* mesgsys,
  47. char const* block_name,
  48. S32 block_num = 0);
  49. static bool unpackProfileParams(LLProfileParams* params, LLDataPacker& dp);
  50. static bool packPathParams(
  51. const LLPathParams* params,
  52. LLMessageSystem* mesgsys);
  53. static bool packPathParams(const LLPathParams* params, LLDataPacker& dp);
  54. static bool unpackPathParams(
  55. LLPathParams* params,
  56. LLMessageSystem* mesgsys,
  57. char const* block_name,
  58. S32 block_num = 0);
  59. static bool unpackPathParams(LLPathParams* params, LLDataPacker& dp);
  60. public:
  61. /**
  62. * @brief This method constrains any volume params to make them valid.
  63. *
  64. * @param[in,out] Possibly invalid params in, always valid out.
  65. * @return Returns true if the in params were valid, and therefore
  66. * unchanged.
  67. */
  68. static bool constrainVolumeParams(LLVolumeParams& params);
  69. static bool packVolumeParams(
  70. const LLVolumeParams* params,
  71. LLMessageSystem* mesgsys);
  72. static bool packVolumeParams(
  73. const LLVolumeParams* params,
  74. LLDataPacker& dp);
  75. static bool unpackVolumeParams(
  76. LLVolumeParams* params,
  77. LLMessageSystem* mesgsys,
  78. char const* block_name,
  79. S32 block_num = 0);
  80. static bool unpackVolumeParams(LLVolumeParams* params, LLDataPacker &dp);
  81. };
  82. #endif // LL_LLVOLUMEMESSAGE_H