• Main Page
  • Related Pages
  • Classes
  • Files
  • File List

src/Message.hh

00001 /*
00002  * This file is part of peekabot.
00003  *
00004  * peekabot is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 3 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * peekabot is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 #ifndef __PEEKABOT_MESSAGE_HH
00019 #define __PEEKABOT_MESSAGE_HH
00020 
00021 
00022 #include <string>
00023 #include <boost/date_time/posix_time/posix_time_types.hpp>
00024 
00025 #include "Types.hh"
00026 #include "MessageHub.hh"
00027 
00028 
00029 namespace peekabot
00030 {
00031 
00032 
00044     class Message
00045     {
00049         const std::string m_message;
00050         
00054         const MessageType m_type;
00055 
00060         const bool m_has_source;
00061 
00066         const SourceID m_source;
00067 
00071         const boost::posix_time::ptime m_timestamp;
00072 
00073     public:
00081         Message(
00082             MessageType type, SourceID source, 
00083             const std::string &message) throw();
00084 
00085 
00092         Message(MessageType type, const std::string &message) throw();
00093 
00100         const std::string &get_message() const throw();
00101 
00105         MessageType get_type() const throw();
00106 
00111         bool has_source() const throw();
00112 
00119         SourceID get_source() const throw();
00120 
00124         boost::posix_time::ptime get_timestamp() const throw();
00125     };
00126 
00127 
00128 
00129 }
00130 
00131 
00132 #endif // __PEEKABOT_MESSAGE_HH

Generated on Sun Jan 30 2011 for peekabot by  doxygen 1.7.1