Homepage Demos Overview Downloads Tutorials Reference
Credits
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Search

TextMsgEvent Class Reference

#include <TextMsgEvent.h>

Inheritance diagram for TextMsgEvent:

Inheritance graph
[legend]
List of all members.

Detailed Description

Extends EventBase to also include actual message text.

Definition at line 8 of file TextMsgEvent.h.

Public Member Functions

 TextMsgEvent ()
 Constructor.

 TextMsgEvent (const std::string &text)
 Constructor, pass a text msg.

std::string getText () const
 returns the text

TextMsgEventsetText (const std::string &text)
 sets the text

int getToken () const
 returns the token

TextMsgEventsetToken (int token)
 sets the token

virtual unsigned int getBinSize () const
 calculates space needed to save - if you can't precisely add up the size, overestimate and things will still work.

virtual unsigned int LoadBuffer (const char buf[], unsigned int len)
 Load from a saved buffer.

virtual unsigned int SaveBuffer (char buf[], unsigned int len) const
 Save to a given buffer.


Protected Attributes

std::string _text
 the unmodified arguments passed to the command

int _token
 for future expansion, to support centralized parsing


Constructor & Destructor Documentation

TextMsgEvent::TextMsgEvent  )  [inline]
 

Constructor.

Definition at line 11 of file TextMsgEvent.h.

References _text, _token, EventBase::activateETID, and EventBase::textmsgEGID.

TextMsgEvent::TextMsgEvent const std::string &  text  )  [inline]
 

Constructor, pass a text msg.

Definition at line 14 of file TextMsgEvent.h.

References _text, _token, EventBase::activateETID, and EventBase::textmsgEGID.


Member Function Documentation

virtual unsigned int TextMsgEvent::getBinSize  )  const [inline, virtual]
 

calculates space needed to save - if you can't precisely add up the size, overestimate and things will still work.

Returns:
number of bytes read/written, 0 if error (or empty)

Reimplemented from EventBase.

Definition at line 22 of file TextMsgEvent.h.

References _text, _token, LoadSave::creatorSize(), EventBase::getBinSize(), and LoadSave::stringpad.

std::string TextMsgEvent::getText  )  const [inline]
 

returns the text

Definition at line 16 of file TextMsgEvent.h.

References _text.

int TextMsgEvent::getToken  )  const [inline]
 

returns the token

Definition at line 19 of file TextMsgEvent.h.

References _token.

virtual unsigned int TextMsgEvent::LoadBuffer const char  buf[],
unsigned int  len
[inline, virtual]
 

Load from a saved buffer.

Parameters:
buf pointer to the memory where you should begin loading
len length of buf available (this isn't all yours, might be more stuff saved after yours)
Returns:
the number of bytes actually used

Reimplemented from EventBase.

Definition at line 30 of file TextMsgEvent.h.

References _text, _token, LoadSave::checkCreator(), LoadSave::decode(), and EventBase::LoadBuffer().

virtual unsigned int TextMsgEvent::SaveBuffer char  buf[],
unsigned int  len
const [inline, virtual]
 

Save to a given buffer.

Parameters:
buf pointer to the memory where you should begin writing
len length of buf available. (this isn't all yours, constrain yourself to what you returned in getBinSize() )
Returns:
the number of bytes actually used

Reimplemented from EventBase.

Definition at line 44 of file TextMsgEvent.h.

References _text, _token, LoadSave::encode(), EventBase::SaveBuffer(), and LoadSave::saveCreator().

TextMsgEvent& TextMsgEvent::setText const std::string &  text  )  [inline]
 

sets the text

Definition at line 17 of file TextMsgEvent.h.

References _text.

TextMsgEvent& TextMsgEvent::setToken int  token  )  [inline]
 

sets the token

Definition at line 20 of file TextMsgEvent.h.

References _token.


Member Data Documentation

std::string TextMsgEvent::_text [protected]
 

the unmodified arguments passed to the command

Definition at line 59 of file TextMsgEvent.h.

int TextMsgEvent::_token [protected]
 

for future expansion, to support centralized parsing

Definition at line 60 of file TextMsgEvent.h.


The documentation for this class was generated from the following file:
Tekkotsu v1.4
Generated Sat Jul 19 00:09:13 2003 by Doxygen 1.3.2