Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

TextMsgEvent.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_TextMsgEvent_h
00003 #define INCLUDED_TextMsgEvent_h
00004 
00005 #include "EventBase.h"
00006 
00007 //! Extends EventBase to also include actual message text
00008 class TextMsgEvent : public EventBase {
00009  public:
00010   //! Constructor
00011   TextMsgEvent() : EventBase(EventBase::textmsgEGID,(unsigned int)-1, EventBase::statusETID,0),_text("")/*,_token(0)*/ {  }
00012 
00013   //! Constructor, pass a text msg
00014   TextMsgEvent(const std::string& text) : EventBase(EventBase::textmsgEGID,(unsigned int)-1, EventBase::statusETID,0),_text(text)/*,_token(0)*/ { }
00015   
00016   virtual EventBase* clone() const { return new TextMsgEvent(*this); }
00017 
00018   virtual unsigned int getClassTypeID() const { return makeClassTypeID("TXTM"); }
00019 
00020   std::string getText() const { return _text; } //!< returns the text
00021   TextMsgEvent& setText(const std::string& text) { _text=text; return *this; } //!< sets the text
00022   
00023   //int getToken() const { return _token; } //!< returns the token
00024   //TextMsgEvent& setToken(int token) { _token=token; return *this;} //!< sets the token
00025   
00026   std::string getDescription(bool showTypeSpecific=true, unsigned int verbosity=0) const;
00027   
00028   virtual unsigned int getBinSize() const;
00029   virtual unsigned int LoadBinaryBuffer(const char buf[], unsigned int len);
00030   virtual unsigned int SaveBinaryBuffer(char buf[], unsigned int len) const;
00031   virtual void LoadXML(xmlNode* node);
00032   virtual void SaveXML(xmlNode * node) const;
00033   
00034  protected:
00035   std::string _text; //!< the unmodified arguments passed to the command
00036   //int _token;      //!< for future expansion, to support centralized parsing
00037 };
00038 
00039 /*! @file
00040  * @brief Describes TextMsgEvent, which extends EventBase to also include actual message text
00041  * @author ejt (Creator)
00042  *
00043  * $Author: ejt $
00044  * $Name: tekkotsu-2_4_1 $
00045  * $Revision: 1.12 $
00046  * $State: Exp $
00047  * $Date: 2005/06/29 22:03:35 $
00048  */
00049 
00050 #endif

Tekkotsu v2.4.1
Generated Tue Aug 16 16:32:49 2005 by Doxygen 1.4.4