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

/indra/llmessage/llmessagebuilder.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 101 lines | 57 code | 15 blank | 29 comment | 0 complexity | f7fab1d217eeae9ed1a929689c86067f MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llmessagebuilder.h
  3. * @brief Declaration of LLMessageBuilder class.
  4. *
  5. * $LicenseInfo:firstyear=2007&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_LLMESSAGEBUILDER_H
  27. #define LL_LLMESSAGEBUILDER_H
  28. #include <string>
  29. #include "stdtypes.h"
  30. class LLMsgData;
  31. class LLQuaternion;
  32. class LLSD;
  33. class LLUUID;
  34. class LLVector3;
  35. class LLVector3d;
  36. class LLVector4;
  37. class LLMessageBuilder
  38. {
  39. public:
  40. //CLASS_LOG_TYPE(LLMessageBuilder);
  41. virtual ~LLMessageBuilder();
  42. virtual void newMessage(const char* name) = 0;
  43. virtual void nextBlock(const char* blockname) = 0;
  44. virtual BOOL removeLastBlock() = 0; // TODO: babbage: remove this horror
  45. /** All add* methods expect pointers to canonical strings. */
  46. virtual void addBinaryData(
  47. const char* varname,
  48. const void* data,
  49. S32 size) = 0;
  50. virtual void addBOOL(const char* varname, BOOL b) = 0;
  51. virtual void addS8(const char* varname, S8 s) = 0;
  52. virtual void addU8(const char* varname, U8 u) = 0;
  53. virtual void addS16(const char* varname, S16 i) = 0;
  54. virtual void addU16(const char* varname, U16 i) = 0;
  55. virtual void addF32(const char* varname, F32 f) = 0;
  56. virtual void addS32(const char* varname, S32 s) = 0;
  57. virtual void addU32(const char* varname, U32 u) = 0;
  58. virtual void addU64(const char* varname, U64 lu) = 0;
  59. virtual void addF64(const char* varname, F64 d) = 0;
  60. virtual void addVector3(const char* varname, const LLVector3& vec) = 0;
  61. virtual void addVector4(const char* varname, const LLVector4& vec) = 0;
  62. virtual void addVector3d(const char* varname, const LLVector3d& vec) = 0;
  63. virtual void addQuat(const char* varname, const LLQuaternion& quat) = 0;
  64. virtual void addUUID(const char* varname, const LLUUID& uuid) = 0;
  65. virtual void addIPAddr(const char* varname, const U32 ip) = 0;
  66. virtual void addIPPort(const char* varname, const U16 port) = 0;
  67. virtual void addString(const char* varname, const char* s) = 0;
  68. virtual void addString(const char* varname, const std::string& s) = 0;
  69. virtual BOOL isMessageFull(const char* blockname) const = 0;
  70. virtual void compressMessage(U8*& buf_ptr, U32& buffer_length) = 0;
  71. virtual S32 getMessageSize() = 0;
  72. virtual BOOL isBuilt() const = 0;
  73. virtual BOOL isClear() const = 0;
  74. virtual U32 buildMessage(
  75. U8* buffer,
  76. U32 buffer_size,
  77. U8 offset_to_data) = 0;
  78. /**< Return built message size */
  79. virtual void clearMessage() = 0;
  80. // TODO: babbage: remove this horror
  81. virtual void setBuilt(BOOL b) = 0;
  82. virtual const char* getMessageName() const = 0;
  83. virtual void copyFromMessageData(const LLMsgData& data) = 0;
  84. virtual void copyFromLLSD(const LLSD& data) = 0;
  85. };
  86. #endif // LL_LLMESSAGEBUILDER_H