Homepage Demos Overview Downloads Tutorials Reference
Credits

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.

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

Constructor, pass a text msg.

Definition at line 14 of file TextMsgEvent.h.


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.

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

returns the text

Definition at line 16 of file TextMsgEvent.h.

Referenced by EventLogger::processEvent().

int TextMsgEvent::getToken  )  const [inline]
 

returns the token

Definition at line 19 of file TextMsgEvent.h.

Referenced by EventLogger::processEvent().

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.

Referenced by EventTranslator::sendEvent().

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.

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

sets the text

Definition at line 17 of file TextMsgEvent.h.

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

sets the token

Definition at line 20 of file TextMsgEvent.h.


Member Data Documentation

std::string TextMsgEvent::_text [protected]
 

the unmodified arguments passed to the command

Definition at line 59 of file TextMsgEvent.h.

Referenced by getBinSize(), getText(), LoadBuffer(), SaveBuffer(), setText(), and TextMsgEvent().

int TextMsgEvent::_token [protected]
 

for future expansion, to support centralized parsing

Definition at line 60 of file TextMsgEvent.h.

Referenced by getBinSize(), getToken(), LoadBuffer(), SaveBuffer(), setToken(), and TextMsgEvent().


The documentation for this class was generated from the following file:
Tekkotsu v2.0
Generated Wed Jan 21 03:23:29 2004 by Doxygen 1.3.4