MessageImpl.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *
00003  * Copyright (C) 2009-2010 Cassio Neri Moreira
00004  *
00005  * This file is part of the KeyValue library.
00006  *
00007  * The KeyValue library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License as published
00009  * by the Free Software Foundation, either version 3 of the License, or (at
00010  * your option) any later version.
00011  *
00012  * The KeyValue library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
00015  * Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License along
00018  * with KeyValue. If not, see <http://www.gnu.org/licenses/>.
00019  *
00020  **************************************************************************/
00021 
00029 #ifndef KEYVALUE_SYS_MESSAGEIMPL_H_
00030 #define KEYVALUE_SYS_MESSAGEIMPL_H_
00031 
00032 #include <boost/static_assert.hpp>
00033 
00034 #include "keyvalue/sys/message/Message.h"
00035 
00036 namespace keyvalue {
00037 
00060 template <unsigned int id>
00061 class MessageImpl : public Message {
00062 
00063 public:
00064 
00065   MessageImpl() : Message(0) {
00074     BOOST_STATIC_ASSERT(id < 2);
00075   }
00076 
00077   explicit
00078   MessageImpl(unsigned int level);
00079 
00085   const string&
00086   getPrefix() const;
00087 
00093   logger::Color
00094   getColor() const;
00095 
00096 private:
00097 
00098   // Non assignable.
00099   Message&
00100   operator=(const MessageImpl& orig);
00101 
00102 }; // class MessageImpl
00103 
00113 typedef MessageImpl<0> Error;
00114 
00124 typedef MessageImpl<1> Logic;
00125 
00135 typedef MessageImpl<2> Info;
00136 
00146 typedef MessageImpl<3> Warning;
00147 
00157 typedef MessageImpl<4> Report;
00158 
00168 typedef MessageImpl<5> Debug;
00169 
00170 } // namespace keyvalue
00171 
00172 #endif // KEYVALUE_SYS_MESSAGEIMPL_H_

Generated on Sat Mar 20 15:08:29 2010 for KeyValue by  doxygen 1.6.1