00001
00032 #ifndef LL_LLMESSAGEBUILDER_H
00033 #define LL_LLMESSAGEBUILDER_H
00034
00035 #include <string>
00036
00037 #include "stdtypes.h"
00038
00039 class LLMsgData;
00040 class LLQuaternion;
00041 class LLSD;
00042 class LLUUID;
00043 class LLVector3;
00044 class LLVector3d;
00045 class LLVector4;
00046
00047 class LLMessageBuilder
00048 {
00049 public:
00050
00051
00052
00053 virtual ~LLMessageBuilder();
00054 virtual void newMessage(const char* name) = 0;
00055
00056 virtual void nextBlock(const char* blockname) = 0;
00057 virtual BOOL removeLastBlock() = 0;
00058
00060 virtual void addBinaryData(
00061 const char* varname,
00062 const void* data,
00063 S32 size) = 0;
00064 virtual void addBOOL(const char* varname, BOOL b) = 0;
00065 virtual void addS8(const char* varname, S8 s) = 0;
00066 virtual void addU8(const char* varname, U8 u) = 0;
00067 virtual void addS16(const char* varname, S16 i) = 0;
00068 virtual void addU16(const char* varname, U16 i) = 0;
00069 virtual void addF32(const char* varname, F32 f) = 0;
00070 virtual void addS32(const char* varname, S32 s) = 0;
00071 virtual void addU32(const char* varname, U32 u) = 0;
00072 virtual void addU64(const char* varname, U64 lu) = 0;
00073 virtual void addF64(const char* varname, F64 d) = 0;
00074 virtual void addVector3(const char* varname, const LLVector3& vec) = 0;
00075 virtual void addVector4(const char* varname, const LLVector4& vec) = 0;
00076 virtual void addVector3d(const char* varname, const LLVector3d& vec) = 0;
00077 virtual void addQuat(const char* varname, const LLQuaternion& quat) = 0;
00078 virtual void addUUID(const char* varname, const LLUUID& uuid) = 0;
00079 virtual void addIPAddr(const char* varname, const U32 ip) = 0;
00080 virtual void addIPPort(const char* varname, const U16 port) = 0;
00081 virtual void addString(const char* varname, const char* s) = 0;
00082 virtual void addString(const char* varname, const std::string& s) = 0;
00083
00084 virtual BOOL isMessageFull(const char* blockname) const = 0;
00085 virtual void compressMessage(U8*& buf_ptr, U32& buffer_length) = 0;
00086 virtual S32 getMessageSize() = 0;
00087
00088 virtual BOOL isBuilt() const = 0;
00089 virtual BOOL isClear() const = 0;
00090 virtual U32 buildMessage(
00091 U8* buffer,
00092 U32 buffer_size,
00093 U8 offset_to_data) = 0;
00095 virtual void clearMessage() = 0;
00096
00097
00098 virtual void setBuilt(BOOL b) = 0;
00099
00100 virtual const char* getMessageName() const = 0;
00101
00102 virtual void copyFromMessageData(const LLMsgData& data) = 0;
00103 virtual void copyFromLLSD(const LLSD& data) = 0;
00104 };
00105
00106 #endif // LL_LLMESSAGEBUILDER_H