LLMessageTemplate Class Reference

#include <llmessagetemplate.h>

Collaboration diagram for LLMessageTemplate:

Collaboration graph
[legend]
List of all members.

Public Types

typedef LLDynamicArrayIndexed<
LLMessageBlock *, char *, 8 > 
message_block_map_t

Public Member Functions

 LLMessageTemplate (const char *name, U32 message_number, EMsgFrequency freq)
 ~LLMessageTemplate ()
void addBlock (LLMessageBlock *blockp)
LLMessageBlockgetBlock (char *name)
void setTrust (EMsgTrust t)
EMsgTrust getTrust (void) const
void setEncoding (EMsgEncoding e)
EMsgEncoding getEncoding () const
void setDeprecation (EMsgDeprecation d)
EMsgDeprecation getDeprecation () const
void addHandlerFunc (message_handler_func_t handler, void **user_data)
 Adds a handler This function adds a new handler to be called when the message arrives. Repeated additions of the same handler function will be ignored.
void setHandlerFunc (message_handler_func_t handler, void **user_data)
 Sets a handler This function sets a handler to be called when the message arrives. Any existing handlers are unregistered.
void delHandlerFunc (message_handler_func_t handler)
 Removes a handler Removes a handler from the list of handlers. Attempts to remove handlers that aren't in the list are silently ignored.
BOOL callHandlerFunc (LLMessageSystem *msgsystem) const
bool isBanned (bool trustedSource) const
const LLMessageBlockgetBlock (char *name) const

Public Attributes

message_block_map_t mMemberBlocks
char * mName
EMsgFrequency mFrequency
EMsgTrust mTrust
EMsgEncoding mEncoding
EMsgDeprecation mDeprecation
U32 mMessageNumber
S32 mTotalSize
U32 mReceiveCount
U32 mReceiveBytes
U32 mReceiveInvalid
F32 mDecodeTimeThisFrame
U32 mTotalDecoded
F32 mTotalDecodeTime
F32 mMaxDecodeTimePerMsg
bool mBanFromTrusted
bool mBanFromUntrusted

Private Attributes

std::list< LLMessageTemplateHandlerEntrymHandlers

Friends

std::ostream & operator<< (std::ostream &s, LLMessageTemplate &msg)

Detailed Description

Definition at line 299 of file llmessagetemplate.h.


Member Typedef Documentation

typedef LLDynamicArrayIndexed<LLMessageBlock*, char*, 8> LLMessageTemplate::message_block_map_t

Definition at line 463 of file llmessagetemplate.h.


Constructor & Destructor Documentation

LLMessageTemplate::LLMessageTemplate ( const char *  name,
U32  message_number,
EMsgFrequency  freq 
) [inline]

Definition at line 302 of file llmessagetemplate.h.

References LLMessageStringTable::getString(), gMessageStringTable, and mName.

LLMessageTemplate::~LLMessageTemplate (  )  [inline]

Definition at line 325 of file llmessagetemplate.h.

References LLDynamicArrayIndexed< Type, Key, BlockSize >::begin(), LLDynamicArrayIndexed< Type, Key, BlockSize >::end(), and mMemberBlocks.


Member Function Documentation

void LLMessageTemplate::addBlock ( LLMessageBlock blockp  )  [inline]

Definition at line 330 of file llmessagetemplate.h.

References llendl, llerrs, MBT_MULTIPLE, MBT_SINGLE, mMemberBlocks, LLMessageBlock::mName, LLMessageBlock::mNumber, LLMessageBlock::mTotalSize, mTotalSize, LLMessageBlock::mType, and NULL.

Referenced by LLTemplateParser::parseMessage().

void LLMessageTemplate::addHandlerFunc ( message_handler_func_t  handler,
void **  user_data 
) [inline]

Adds a handler This function adds a new handler to be called when the message arrives. Repeated additions of the same handler function will be ignored.

Note:
delHandlerFunc() must be called to remove the registration
Parameters:
handler Function to call
user_data User specified data to pass to the function

Definition at line 396 of file llmessagetemplate.h.

References mHandlers.

Referenced by LLMessageSystem::addHandlerFuncFast(), and setHandlerFunc().

BOOL LLMessageTemplate::callHandlerFunc ( LLMessageSystem msgsystem  )  const [inline]

Definition at line 438 of file llmessagetemplate.h.

References FALSE, mHandlers, and TRUE.

Referenced by LLMessageSystem::callHandler(), and LLTemplateMessageReader::decodeData().

void LLMessageTemplate::delHandlerFunc ( message_handler_func_t  handler  )  [inline]

Removes a handler Removes a handler from the list of handlers. Attempts to remove handlers that aren't in the list are silently ignored.

Parameters:
handler Function to remove

Definition at line 433 of file llmessagetemplate.h.

References mHandlers.

Referenced by LLMessageSystem::delHandlerFuncFast().

const LLMessageBlock* LLMessageTemplate::getBlock ( char *  name  )  const [inline]

Definition at line 456 of file llmessagetemplate.h.

References LLDynamicArrayIndexed< Type, Key, BlockSize >::end(), LLDynamicArrayIndexed< Type, Key, BlockSize >::find(), mMemberBlocks, and NULL.

LLMessageBlock* LLMessageTemplate::getBlock ( char *  name  )  [inline]

Definition at line 352 of file llmessagetemplate.h.

References mMemberBlocks.

Referenced by LLTemplateMessageBuilder::addData(), tut::LLMessageTemplateParserTestData::ensure_block_attributes(), LLTemplateMessageBuilder::isMessageFull(), LLTemplateMessageBuilder::nextBlock(), and LLTemplateMessageBuilder::removeLastBlock().

EMsgDeprecation LLMessageTemplate::getDeprecation (  )  const [inline]

Definition at line 383 of file llmessagetemplate.h.

References mDeprecation.

Referenced by LLTemplateMessageBuilder::newMessage().

EMsgEncoding LLMessageTemplate::getEncoding (  )  const [inline]

Definition at line 373 of file llmessagetemplate.h.

References mEncoding.

Referenced by LLTemplateMessageBuilder::compressMessage().

EMsgTrust LLMessageTemplate::getTrust ( void   )  const [inline]

Definition at line 363 of file llmessagetemplate.h.

References mTrust.

Referenced by LLTemplateMessageReader::isTrusted().

bool LLMessageTemplate::isBanned ( bool  trustedSource  )  const [inline]

Definition at line 449 of file llmessagetemplate.h.

References mBanFromTrusted, and mBanFromUntrusted.

Referenced by LLMessageSystem::callHandler(), and LLTemplateMessageReader::isBanned().

void LLMessageTemplate::setDeprecation ( EMsgDeprecation  d  )  [inline]

Definition at line 378 of file llmessagetemplate.h.

References mDeprecation.

Referenced by LLTemplateParser::parseMessage().

void LLMessageTemplate::setEncoding ( EMsgEncoding  e  )  [inline]

Definition at line 369 of file llmessagetemplate.h.

References mEncoding.

Referenced by LLTemplateParser::parseMessage().

void LLMessageTemplate::setHandlerFunc ( message_handler_func_t  handler,
void **  user_data 
) [inline]

Sets a handler This function sets a handler to be called when the message arrives. Any existing handlers are unregistered.

Note:
delHandlerFunc() must be called to remove the registration
Parameters:
handler Function to call
user_data User specified data to pass to the function

Definition at line 416 of file llmessagetemplate.h.

References addHandlerFunc(), llendl, llwarns, mHandlers, and mName.

Referenced by LLMessageSystem::setHandlerFuncFast().

void LLMessageTemplate::setTrust ( EMsgTrust  t  )  [inline]

Definition at line 358 of file llmessagetemplate.h.

References mTrust.

Referenced by LLTemplateParser::parseMessage().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
LLMessageTemplate msg 
) [friend]

Definition at line 137 of file llmessagetemplate.cpp.


Member Data Documentation

bool LLMessageTemplate::mBanFromTrusted

Definition at line 480 of file llmessagetemplate.h.

Referenced by isBanned().

bool LLMessageTemplate::mBanFromUntrusted

Definition at line 481 of file llmessagetemplate.h.

Referenced by isBanned().

F32 LLMessageTemplate::mDecodeTimeThisFrame

Definition at line 475 of file llmessagetemplate.h.

Referenced by LLTemplateMessageReader::decodeData(), and LLMessageSystem::dumpReceiveCounts().

EMsgDeprecation LLMessageTemplate::mDeprecation

Definition at line 469 of file llmessagetemplate.h.

Referenced by getDeprecation(), and setDeprecation().

EMsgEncoding LLMessageTemplate::mEncoding

Definition at line 468 of file llmessagetemplate.h.

Referenced by getEncoding(), and setEncoding().

EMsgFrequency LLMessageTemplate::mFrequency

Definition at line 466 of file llmessagetemplate.h.

Referenced by LLTemplateMessageBuilder::buildMessage(), LLTemplateMessageReader::decodeData(), and operator<<().

std::list<LLMessageTemplateHandlerEntry> LLMessageTemplate::mHandlers [private]

Definition at line 484 of file llmessagetemplate.h.

Referenced by addHandlerFunc(), callHandlerFunc(), delHandlerFunc(), and setHandlerFunc().

F32 LLMessageTemplate::mMaxDecodeTimePerMsg

Definition at line 478 of file llmessagetemplate.h.

Referenced by LLTemplateMessageReader::decodeData().

message_block_map_t LLMessageTemplate::mMemberBlocks

Definition at line 464 of file llmessagetemplate.h.

Referenced by addBlock(), LLTemplateMessageBuilder::buildMessage(), LLTemplateMessageReader::decodeData(), getBlock(), LLTemplateMessageReader::getSize(), LLTemplateMessageBuilder::newMessage(), operator<<(), and ~LLMessageTemplate().

U32 LLMessageTemplate::mMessageNumber

Definition at line 470 of file llmessagetemplate.h.

Referenced by LLMessageSystem::addTemplate(), LLTemplateMessageBuilder::buildMessage(), and operator<<().

char* LLMessageTemplate::mName

Definition at line 465 of file llmessagetemplate.h.

Referenced by LLTemplateMessageBuilder::addData(), LLMessageSystem::addTemplate(), LLTemplateMessageReader::decodeData(), LLMessageSystem::dumpReceiveCounts(), tut::LLMessageTemplateParserTestData::ensure_block_attributes(), LLTemplateMessageReader::getMessageName(), LLMessageTemplate(), LLTemplateMessageReader::logRanOffEndOfPacket(), LLTemplateMessageBuilder::nextBlock(), operator<<(), setHandlerFunc(), and LLTemplateMessageReader::validateMessage().

U32 LLMessageTemplate::mReceiveBytes

Definition at line 473 of file llmessagetemplate.h.

Referenced by LLMessageSystem::dumpReceiveCounts().

U32 LLMessageTemplate::mReceiveCount

Definition at line 472 of file llmessagetemplate.h.

Referenced by LLMessageSystem::dumpReceiveCounts(), and LLTemplateMessageReader::validateMessage().

U32 LLMessageTemplate::mReceiveInvalid

Definition at line 474 of file llmessagetemplate.h.

Referenced by LLMessageSystem::dumpReceiveCounts().

U32 LLMessageTemplate::mTotalDecoded

Definition at line 476 of file llmessagetemplate.h.

Referenced by LLTemplateMessageReader::decodeData().

F32 LLMessageTemplate::mTotalDecodeTime

Definition at line 477 of file llmessagetemplate.h.

Referenced by LLTemplateMessageReader::decodeData().

S32 LLMessageTemplate::mTotalSize

Definition at line 471 of file llmessagetemplate.h.

Referenced by addBlock(), and operator<<().

EMsgTrust LLMessageTemplate::mTrust

Definition at line 467 of file llmessagetemplate.h.

Referenced by getTrust(), and setTrust().


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