LLTemplateMessageBuilder Class Reference

#include <lltemplatemessagebuilder.h>

Inheritance diagram for LLTemplateMessageBuilder:

Inheritance graph
[legend]
Collaboration diagram for LLTemplateMessageBuilder:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::map< const char *,
LLMessageTemplate * > 
message_template_name_map_t

Public Member Functions

 LLTemplateMessageBuilder (message_template_name_map_t &)
virtual ~LLTemplateMessageBuilder ()
virtual void newMessage (const char *name)
virtual void nextBlock (const char *blockname)
virtual BOOL removeLastBlock ()
virtual void addBinaryData (const char *varname, const void *data, S32 size)
virtual void addBOOL (const char *varname, BOOL b)
virtual void addS8 (const char *varname, S8 s)
virtual void addU8 (const char *varname, U8 u)
virtual void addS16 (const char *varname, S16 i)
virtual void addU16 (const char *varname, U16 i)
virtual void addF32 (const char *varname, F32 f)
virtual void addS32 (const char *varname, S32 s)
virtual void addU32 (const char *varname, U32 u)
virtual void addU64 (const char *varname, U64 lu)
virtual void addF64 (const char *varname, F64 d)
virtual void addVector3 (const char *varname, const LLVector3 &vec)
virtual void addVector4 (const char *varname, const LLVector4 &vec)
virtual void addVector3d (const char *varname, const LLVector3d &vec)
virtual void addQuat (const char *varname, const LLQuaternion &quat)
virtual void addUUID (const char *varname, const LLUUID &uuid)
virtual void addIPAddr (const char *varname, const U32 ip)
virtual void addIPPort (const char *varname, const U16 port)
virtual void addString (const char *varname, const char *s)
virtual void addString (const char *varname, const std::string &s)
virtual BOOL isMessageFull (const char *blockname) const
virtual void compressMessage (U8 *&buf_ptr, U32 &buffer_length)
virtual BOOL isBuilt () const
virtual BOOL isClear () const
virtual U32 buildMessage (U8 *buffer, U32 buffer_size, U8 offset_to_data)
virtual void clearMessage ()
virtual void setBuilt (BOOL b)
virtual S32 getMessageSize ()
virtual const char * getMessageName () const
virtual void copyFromMessageData (const LLMsgData &data)
virtual void copyFromLLSD (const LLSD &)

Private Member Functions

void addData (const char *varname, const void *data, EMsgVariableType type, S32 size)
void addData (const char *varname, const void *data, EMsgVariableType type)

Private Attributes

LLMsgDatamCurrentSMessageData
const LLMessageTemplatemCurrentSMessageTemplate
LLMsgBlkDatamCurrentSDataBlock
char * mCurrentSMessageName
char * mCurrentSBlockName
BOOL mbSBuilt
BOOL mbSClear
S32 mCurrentSendTotal
message_template_name_map_tmMessageTemplates

Detailed Description

Definition at line 45 of file lltemplatemessagebuilder.h.


Member Typedef Documentation

typedef std::map<const char* , LLMessageTemplate*> LLTemplateMessageBuilder::message_template_name_map_t

Definition at line 49 of file lltemplatemessagebuilder.h.


Constructor & Destructor Documentation

LLTemplateMessageBuilder::LLTemplateMessageBuilder ( message_template_name_map_t  ) 

Definition at line 43 of file lltemplatemessagebuilder.cpp.

LLTemplateMessageBuilder::~LLTemplateMessageBuilder (  )  [virtual]

Definition at line 57 of file lltemplatemessagebuilder.cpp.

References mCurrentSMessageData, and NULL.


Member Function Documentation

void LLTemplateMessageBuilder::addBinaryData ( const char *  varname,
const void data,
S32  size 
) [virtual]

All add* methods expect pointers to canonical varname strings.

Implements LLMessageBuilder.

Definition at line 391 of file lltemplatemessagebuilder.cpp.

References addData(), and MVT_FIXED.

void LLTemplateMessageBuilder::addBOOL ( const char *  varname,
BOOL  b 
) [virtual]

Implements LLMessageBuilder.

Definition at line 453 of file lltemplatemessagebuilder.cpp.

References addData(), and MVT_BOOL.

void LLTemplateMessageBuilder::addData ( const char *  varname,
const void data,
EMsgVariableType  type 
) [private]

Definition at line 351 of file lltemplatemessagebuilder.cpp.

References LLMsgBlkData::addData(), LLMessageTemplate::getBlock(), LLMessageVariable::getName(), LLMessageVariable::getSize(), LLMessageVariable::getType(), LLMessageBlock::getVariable(), llendl, llerrs, mCurrentSBlockName, mCurrentSDataBlock, mCurrentSendTotal, mCurrentSMessageTemplate, LLMessageTemplate::mName, and MVT_VARIABLE.

void LLTemplateMessageBuilder::addData ( const char *  varname,
const void data,
EMsgVariableType  type,
S32  size 
) [private]

Definition at line 291 of file lltemplatemessagebuilder.cpp.

References LLMsgBlkData::addData(), LLMessageTemplate::getBlock(), LLMessageVariable::getName(), LLMessageVariable::getSize(), LLMessageVariable::getType(), LLMessageBlock::getVariable(), llendl, llerrs, llwarns, mCurrentSBlockName, mCurrentSDataBlock, mCurrentSendTotal, mCurrentSMessageTemplate, LLMessageTemplate::mName, and MVT_VARIABLE.

Referenced by addBinaryData(), addBOOL(), addF32(), addF64(), addIPAddr(), addIPPort(), addQuat(), addS16(), addS32(), addS8(), addString(), addU16(), addU32(), addU64(), addU8(), addUUID(), addVector3(), addVector3d(), addVector4(), and copyFromMessageData().

void LLTemplateMessageBuilder::addF32 ( const char *  varname,
F32  f 
) [virtual]

Implements LLMessageBuilder.

Definition at line 417 of file lltemplatemessagebuilder.cpp.

References addData(), and MVT_F32.

void LLTemplateMessageBuilder::addF64 ( const char *  varname,
F64  d 
) [virtual]

Implements LLMessageBuilder.

Definition at line 437 of file lltemplatemessagebuilder.cpp.

References addData(), and MVT_F64.

void LLTemplateMessageBuilder::addIPAddr ( const char *  varname,
const U32  ip 
) [virtual]

Implements LLMessageBuilder.

Definition at line 442 of file lltemplatemessagebuilder.cpp.

References addData(), and MVT_IP_ADDR.

void LLTemplateMessageBuilder::addIPPort ( const char *  varname,
const U16  port 
) [virtual]

Implements LLMessageBuilder.

Definition at line 447 of file lltemplatemessagebuilder.cpp.

References addData(), and MVT_IP_PORT.

void LLTemplateMessageBuilder::addQuat ( const char *  varname,
const LLQuaternion quat 
) [virtual]

Implements LLMessageBuilder.

Definition at line 492 of file lltemplatemessagebuilder.cpp.

References addData(), LLVector3::mV, MVT_LLQuaternion, and LLQuaternion::packToVector3().

void LLTemplateMessageBuilder::addS16 ( const char *  varname,
S16  i 
) [virtual]

Implements LLMessageBuilder.

Definition at line 407 of file lltemplatemessagebuilder.cpp.

References addData(), and MVT_S16.

void LLTemplateMessageBuilder::addS32 ( const char *  varname,
S32  s 
) [virtual]

Implements LLMessageBuilder.

Definition at line 422 of file lltemplatemessagebuilder.cpp.

References addData(), and MVT_S32.

void LLTemplateMessageBuilder::addS8 ( const char *  varname,
S8  s 
) [virtual]

Implements LLMessageBuilder.

Definition at line 397 of file lltemplatemessagebuilder.cpp.

References addData(), and MVT_S8.

void LLTemplateMessageBuilder::addString ( const char *  varname,
const std::string &  s 
) [virtual]

Implements LLMessageBuilder.

Definition at line 469 of file lltemplatemessagebuilder.cpp.

References addData(), MVT_VARIABLE, NULL, and S32.

void LLTemplateMessageBuilder::addString ( const char *  varname,
const char *  s 
) [virtual]

Implements LLMessageBuilder.

Definition at line 461 of file lltemplatemessagebuilder.cpp.

References addData(), MVT_VARIABLE, NULL, and S32.

void LLTemplateMessageBuilder::addU16 ( const char *  varname,
U16  i 
) [virtual]

Implements LLMessageBuilder.

Definition at line 412 of file lltemplatemessagebuilder.cpp.

References addData(), and MVT_U16.

void LLTemplateMessageBuilder::addU32 ( const char *  varname,
U32  u 
) [virtual]

Implements LLMessageBuilder.

Definition at line 427 of file lltemplatemessagebuilder.cpp.

References addData(), and MVT_U32.

void LLTemplateMessageBuilder::addU64 ( const char *  varname,
U64  lu 
) [virtual]

Implements LLMessageBuilder.

Definition at line 432 of file lltemplatemessagebuilder.cpp.

References addData(), and MVT_U64.

void LLTemplateMessageBuilder::addU8 ( const char *  varname,
U8  u 
) [virtual]

Implements LLMessageBuilder.

Definition at line 402 of file lltemplatemessagebuilder.cpp.

References addData(), and MVT_U8.

void LLTemplateMessageBuilder::addUUID ( const char *  varname,
const LLUUID uuid 
) [virtual]

Implements LLMessageBuilder.

Definition at line 497 of file lltemplatemessagebuilder.cpp.

References addData(), LLUUID::mData, and MVT_LLUUID.

void LLTemplateMessageBuilder::addVector3 ( const char *  varname,
const LLVector3 vec 
) [virtual]

Implements LLMessageBuilder.

Definition at line 477 of file lltemplatemessagebuilder.cpp.

References addData(), LLVector3::mV, and MVT_LLVector3.

void LLTemplateMessageBuilder::addVector3d ( const char *  varname,
const LLVector3d vec 
) [virtual]

Implements LLMessageBuilder.

Definition at line 487 of file lltemplatemessagebuilder.cpp.

References addData(), LLVector3d::mdV, and MVT_LLVector3d.

void LLTemplateMessageBuilder::addVector4 ( const char *  varname,
const LLVector4 vec 
) [virtual]

Implements LLMessageBuilder.

Definition at line 482 of file lltemplatemessagebuilder.cpp.

References addData(), LLVector4::mV, and MVT_LLVector4.

U32 LLTemplateMessageBuilder::buildMessage ( U8 buffer,
U32  buffer_size,
U8  offset_to_data 
) [virtual]

Return built message size

Implements LLMessageBuilder.

Definition at line 752 of file lltemplatemessagebuilder.cpp.

References buildBlock(), end, LL_PACKET_ID_SIZE, llendl, llerrs, mbSBuilt, mCurrentSMessageData, mCurrentSMessageTemplate, LLMessageTemplate::mFrequency, MFT_HIGH, MFT_LOW, MFT_MEDIUM, LLMessageTemplate::mMemberBlocks, LLMessageTemplate::mMessageNumber, PHL_OFFSET, and TRUE.

Referenced by tut::LLTemplateMessageBuilderTestData::setReader().

void LLTemplateMessageBuilder::clearMessage (  )  [virtual]

Implements LLMessageBuilder.

Definition at line 109 of file lltemplatemessagebuilder.cpp.

References FALSE, mbSBuilt, mbSClear, mCurrentSBlockName, mCurrentSDataBlock, mCurrentSendTotal, mCurrentSMessageData, mCurrentSMessageName, mCurrentSMessageTemplate, NULL, and TRUE.

void LLTemplateMessageBuilder::compressMessage ( U8 *&  buf_ptr,
U32 buffer_length 
) [virtual]

Implements LLMessageBuilder.

Definition at line 584 of file lltemplatemessagebuilder.cpp.

References LLMessageTemplate::getEncoding(), mCurrentSMessageTemplate, ME_ZEROCODED, and zero_code().

void LLTemplateMessageBuilder::copyFromLLSD ( const LLSD  )  [virtual]

Implements LLMessageBuilder.

Definition at line 875 of file lltemplatemessagebuilder.cpp.

void LLTemplateMessageBuilder::copyFromMessageData ( const LLMsgData data  )  [virtual]

Implements LLMessageBuilder.

Definition at line 832 of file lltemplatemessagebuilder.cpp.

References addData(), end, LLMsgData::mMemberBlocks, nextBlock(), NULL, and S32.

const char * LLTemplateMessageBuilder::getMessageName (  )  const [virtual]

Implements LLMessageBuilder.

Definition at line 893 of file lltemplatemessagebuilder.cpp.

References mCurrentSMessageName.

S32 LLTemplateMessageBuilder::getMessageSize (  )  [virtual]

Implements LLMessageBuilder.

Definition at line 890 of file lltemplatemessagebuilder.cpp.

References mCurrentSendTotal.

BOOL LLTemplateMessageBuilder::isBuilt (  )  const [virtual]

Implements LLMessageBuilder.

Definition at line 884 of file lltemplatemessagebuilder.cpp.

References mbSBuilt.

BOOL LLTemplateMessageBuilder::isClear (  )  const [virtual]

Implements LLMessageBuilder.

Definition at line 887 of file lltemplatemessagebuilder.cpp.

References mbSClear.

BOOL LLTemplateMessageBuilder::isMessageFull ( const char *  blockname  )  const [virtual]

Implements LLMessageBuilder.

Definition at line 592 of file lltemplatemessagebuilder.cpp.

References FALSE, LLMessageTemplate::getBlock(), MAX_BLOCKS, MBT_MULTIPLE, MBT_SINGLE, MBT_VARIABLE, mCurrentSendTotal, mCurrentSMessageData, mCurrentSMessageTemplate, LLMsgData::mMemberBlocks, LLMessageBlock::mNumber, MTUBYTES, LLMessageBlock::mType, S32, and TRUE.

void LLTemplateMessageBuilder::newMessage ( const char *  name  )  [virtual]

Implements LLMessageBuilder.

Definition at line 65 of file lltemplatemessagebuilder.cpp.

References LLMsgData::addBlock(), FALSE, LLMessageTemplate::getDeprecation(), llendl, llerrs, llwarns, mbSBuilt, mbSClear, mCurrentSBlockName, mCurrentSDataBlock, mCurrentSendTotal, mCurrentSMessageData, mCurrentSMessageName, mCurrentSMessageTemplate, MD_NOTDEPRECATED, LLMessageTemplate::mMemberBlocks, mMessageTemplates, and NULL.

Referenced by tut::LLTemplateMessageBuilderTestData::defaultBuilder().

void LLTemplateMessageBuilder::nextBlock ( const char *  blockname  )  [virtual]

Implements LLMessageBuilder.

Definition at line 127 of file lltemplatemessagebuilder.cpp.

References LLMsgBlkData::addVariable(), count, end, LLMessageTemplate::getBlock(), llendl, llerrs, MAX_BLOCKS, LLMsgBlkData::mBlockNumber, MBT_MULTIPLE, MBT_SINGLE, mCurrentSBlockName, mCurrentSDataBlock, mCurrentSMessageData, mCurrentSMessageTemplate, LLMsgData::mMemberBlocks, LLMessageBlock::mMemberVariables, LLMsgBlkData::mName, LLMessageTemplate::mName, LLMessageBlock::mNumber, LLMessageBlock::mType, and S32.

Referenced by copyFromMessageData(), and tut::LLTemplateMessageBuilderTestData::defaultBuilder().

BOOL LLTemplateMessageBuilder::removeLastBlock (  )  [virtual]

Implements LLMessageBuilder.

Definition at line 228 of file lltemplatemessagebuilder.cpp.

References FALSE, LLMessageTemplate::getBlock(), llendl, llwarns, LLMsgBlkData::mBlockNumber, mCurrentSBlockName, mCurrentSendTotal, mCurrentSMessageData, mCurrentSMessageName, mCurrentSMessageTemplate, LLMessageBlock::mMemberVariables, S32, and TRUE.

void LLTemplateMessageBuilder::setBuilt ( BOOL  b  )  [virtual]

Implements LLMessageBuilder.

Definition at line 881 of file lltemplatemessagebuilder.cpp.

References mbSBuilt.


Member Data Documentation

BOOL LLTemplateMessageBuilder::mbSBuilt [private]

Definition at line 113 of file lltemplatemessagebuilder.h.

Referenced by buildMessage(), clearMessage(), isBuilt(), newMessage(), and setBuilt().

BOOL LLTemplateMessageBuilder::mbSClear [private]

Definition at line 114 of file lltemplatemessagebuilder.h.

Referenced by clearMessage(), isClear(), and newMessage().

char* LLTemplateMessageBuilder::mCurrentSBlockName [private]

Definition at line 112 of file lltemplatemessagebuilder.h.

Referenced by addData(), clearMessage(), newMessage(), nextBlock(), and removeLastBlock().

LLMsgBlkData* LLTemplateMessageBuilder::mCurrentSDataBlock [private]

Definition at line 110 of file lltemplatemessagebuilder.h.

Referenced by addData(), clearMessage(), newMessage(), and nextBlock().

S32 LLTemplateMessageBuilder::mCurrentSendTotal [private]

Definition at line 115 of file lltemplatemessagebuilder.h.

Referenced by addData(), clearMessage(), getMessageSize(), isMessageFull(), newMessage(), and removeLastBlock().

LLMsgData* LLTemplateMessageBuilder::mCurrentSMessageData [private]

Definition at line 108 of file lltemplatemessagebuilder.h.

Referenced by buildMessage(), clearMessage(), isMessageFull(), newMessage(), nextBlock(), removeLastBlock(), and ~LLTemplateMessageBuilder().

char* LLTemplateMessageBuilder::mCurrentSMessageName [private]

Definition at line 111 of file lltemplatemessagebuilder.h.

Referenced by clearMessage(), getMessageName(), newMessage(), and removeLastBlock().

const LLMessageTemplate* LLTemplateMessageBuilder::mCurrentSMessageTemplate [private]

Definition at line 109 of file lltemplatemessagebuilder.h.

Referenced by addData(), buildMessage(), clearMessage(), compressMessage(), isMessageFull(), newMessage(), nextBlock(), and removeLastBlock().

message_template_name_map_t& LLTemplateMessageBuilder::mMessageTemplates [private]

Definition at line 116 of file lltemplatemessagebuilder.h.

Referenced by newMessage().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:50 2010 for Second Life Viewer by  doxygen 1.4.7