Msg.hpp
Go to the documentation of this file.
00001 // This is -*-c++-*-
00002 //
00003 // Msg.hpp
00004 //
00005 
00006 #ifndef MSG_HPP
00007 #define MSG_HPP
00008 
00009 #include "../BasicDatatypes.hpp"
00010 #include <iosfwd> // for istream, ostream
00011 
00012 namespace datatypes
00013 {
00014         
00015 //
00016 // A text message.
00017 //
00018 class Msg : public BasicData
00019 {
00020 public:
00022         Msg(const UINT16 sourceId);
00023 
00025         Msg(const UINT16 sourceId, const std::string message);
00026 
00027         // Estimate the memory usage of this object
00028         virtual const UINT32 getUsedMemory() const { return sizeof(*this) + m_msgText.length(); };
00029         
00030         std::string getMsg() const;
00031         void setMsg(std::string message);
00032 
00033         std::string toString() const;
00034         
00036         bool operator==(const Msg& other) const
00037         {
00038                 return (m_msgText == other.m_msgText);
00039         }
00040         
00041 private:
00042         std::string m_msgText;
00043 };
00044 
00045 std::ostream& operator<<(std::ostream& os, const Msg& msg); 
00046 
00047 }       // namespace datatypes
00048 
00049 #endif


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Wed Jun 14 2017 04:04:50