TextMsgEvent Class Reference#include <TextMsgEvent.h>
Inheritance diagram for TextMsgEvent:
[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
|
TextMsgEvent & | setText (const std::string &text) |
| sets the text
|
int | getToken () const |
| returns the token
|
TextMsgEvent & | setToken (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] |
|
TextMsgEvent::TextMsgEvent |
( |
const std::string & |
text |
) |
[inline] |
|
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] |
|
int TextMsgEvent::getToken |
( |
|
) |
const [inline] |
|
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] |
|
Member Data Documentation
The documentation for this class was generated from the following file:
|