Tekkotsu 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,(size_t)-1, EventBase::statusETID,0),_text("")/*,_token(0)*/ {  }
00012 
00013   //! Constructor, pass a text msg
00014   TextMsgEvent(const std::string& text, size_t srcID=-1U) : EventBase(EventBase::textmsgEGID,srcID, 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 autoRegisterTextMsgEvent; }
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   std::string getDescription(bool showTypeSpecific=true, unsigned int verbosity=0) const;
00024   
00025   virtual unsigned int getBinSize() const;
00026   virtual unsigned int loadBinaryBuffer(const char buf[], unsigned int len);
00027   virtual unsigned int saveBinaryBuffer(char buf[], unsigned int len) const;
00028   virtual void loadXML(xmlNode* node);
00029   virtual void saveXML(xmlNode * node) const;
00030   
00031  protected:
00032   std::string _text; //!< the unmodified arguments passed to the command
00033   
00034   //! causes class type id to automatically be regsitered with EventBase's FamilyFactory (getTypeRegistry())
00035   static const EventBase::classTypeID_t autoRegisterTextMsgEvent;
00036 };
00037 
00038 /*! @file
00039  * @brief Describes TextMsgEvent, which extends EventBase to also include actual message text
00040  * @author ejt (Creator)
00041  */
00042 
00043 #endif

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:51 2016 by Doxygen 1.6.3