aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/lltemplatemessagebuilder.h
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmessage/lltemplatemessagebuilder.h')
-rw-r--r--linden/indra/llmessage/lltemplatemessagebuilder.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/linden/indra/llmessage/lltemplatemessagebuilder.h b/linden/indra/llmessage/lltemplatemessagebuilder.h
new file mode 100644
index 0000000..ae53328
--- /dev/null
+++ b/linden/indra/llmessage/lltemplatemessagebuilder.h
@@ -0,0 +1,88 @@
1#ifndef LL_LLTEMPLATEMESSAGEBUILDER_H
2#define LL_LLTEMPLATEMESSAGEBUILDER_H
3
4#include <map>
5
6#include "llmessagebuilder.h"
7#include "llmsgvariabletype.h"
8
9class LLMsgData;
10class LLMessageTemplate;
11class LLMsgBlkData;
12class LLMessageTemplate;
13
14class LLTemplateMessageBuilder : public LLMessageBuilder
15{
16public:
17
18 typedef std::map<const char *, LLMessageTemplate*> message_template_name_map_t;
19
20 LLTemplateMessageBuilder(message_template_name_map_t&);
21 virtual ~LLTemplateMessageBuilder();
22
23 virtual void newMessage(const char *name);
24
25 virtual void nextBlock(const char* blockname);
26 virtual BOOL removeLastBlock(); // TODO: babbage: remove this horror...
27
28 /** All add* methods expect pointers to canonical varname strings. */
29 virtual void addBinaryData(const char *varname, const void *data,
30 S32 size);
31 virtual void addBOOL(const char* varname, BOOL b);
32 virtual void addS8(const char *varname, S8 s);
33 virtual void addU8(const char *varname, U8 u);
34 virtual void addS16(const char *varname, S16 i);
35 virtual void addU16(const char *varname, U16 i);
36 virtual void addF32(const char *varname, F32 f);
37 virtual void addS32(const char *varname, S32 s);
38 virtual void addU32(const char *varname, U32 u);
39 virtual void addU64(const char *varname, U64 lu);
40 virtual void addF64(const char *varname, F64 d);
41 virtual void addVector3(const char *varname, const LLVector3& vec);
42 virtual void addVector4(const char *varname, const LLVector4& vec);
43 virtual void addVector3d(const char *varname, const LLVector3d& vec);
44 virtual void addQuat(const char *varname, const LLQuaternion& quat);
45 virtual void addUUID(const char *varname, const LLUUID& uuid);
46 virtual void addIPAddr(const char *varname, const U32 ip);
47 virtual void addIPPort(const char *varname, const U16 port);
48 virtual void addString(const char* varname, const char* s);
49 virtual void addString(const char* varname, const std::string& s);
50
51 virtual BOOL isMessageFull(const char* blockname) const;
52 virtual void compressMessage(U8*& buf_ptr, U32& buffer_length);
53
54 virtual BOOL isBuilt() const;
55 virtual BOOL isClear() const;
56 virtual U32 buildMessage(U8* buffer, U32 buffer_size);
57 /**< Return built message size */
58
59 virtual void clearMessage();
60
61 // TODO: babbage: remove this horror.
62 virtual void setBuilt(BOOL b);
63
64 virtual S32 getMessageSize();
65 virtual const char* getMessageName() const;
66
67 virtual void copyFromMessageData(const LLMsgData& data);
68 virtual void copyFromLLSD(const LLSD&);
69
70private:
71 void addData(const char *varname, const void *data,
72 EMsgVariableType type, S32 size);
73
74 void addData(const char *varname, const void *data,
75 EMsgVariableType type);
76
77 LLMsgData* mCurrentSMessageData;
78 LLMessageTemplate* mCurrentSMessageTemplate;
79 LLMsgBlkData* mCurrentSDataBlock;
80 char* mCurrentSMessageName;
81 char* mCurrentSBlockName;
82 BOOL mbSBuilt;
83 BOOL mbSClear;
84 S32 mCurrentSendTotal;
85 message_template_name_map_t& mMessageTemplates;
86};
87
88#endif // LL_LLTEMPLATEMESSAGEBUILDER_H