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
std::string getDescription (bool showTypeSpecific=true, unsigned int verbosity=0) const
 generates a description of the event with variable verbosity
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


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

unsigned int TextMsgEvent::getBinSize  )  const [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 14 of file TextMsgEvent.cc.

std::string TextMsgEvent::getDescription bool  showTypeSpecific = true,
unsigned int  verbosity = 0
const [virtual]
 

generates a description of the event with variable verbosity

Parameters:
showTypeSpecific will signal subclasses to add additional information
verbosity can be one of the following values:
  • 0 - the name and type
  • 1 - the name, type, duration, and timestamp
  • 2 and above - the name, type, duration, and magnitude if showTypeSpecific, additional fields will be added after the common fields listed above.

Reimplemented from EventBase.

Definition at line 5 of file TextMsgEvent.cc.

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

returns the text

Definition at line 16 of file TextMsgEvent.h.

unsigned int TextMsgEvent::LoadBuffer const char  buf[],
unsigned int  len
[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 23 of file TextMsgEvent.cc.

Referenced by EventTranslator::sendEvent().

unsigned int TextMsgEvent::SaveBuffer char  buf[],
unsigned int  len
const [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 38 of file TextMsgEvent.cc.

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

sets the text

Definition at line 17 of file TextMsgEvent.h.


Member Data Documentation

std::string TextMsgEvent::_text [protected]
 

the unmodified arguments passed to the command

Definition at line 29 of file TextMsgEvent.h.

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


The documentation for this class was generated from the following files:

Tekkotsu v2.2.1
Generated Tue Nov 23 16:37:53 2004 by Doxygen 1.3.9.1