mimasexception.h

Go to the documentation of this file.
00001 #ifndef EXCEPTION_H
00002 #define EXCEPTION_H
00003 
00004 #include <exception>
00005 #include <sstream>
00006 #include <string>
00007 
00008 namespace mimas {
00009 
00040 class mimasexception: public std::exception
00041 {
00042  public:
00044   mimasexception(void) {}
00046   mimasexception( mimasexception &e ): std::exception( e )
00047   { message << e.message.str(); }
00049   virtual ~mimasexception(void) throw() {}
00051   template< typename T >
00052   std::ostream &operator<<( const T &t ) { message << t; return message; }
00057   std::ostream &operator<<( std::ostream& (*__pf)( std::ostream&) )
00058     { (*__pf)( message ); return message; }
00060   virtual const char* what(void) const throw() {
00061     temp = message.str();
00062     return temp.c_str();
00063   }
00064  protected:
00066   std::ostringstream message;
00069   static std::string temp;
00070 };
00071 
00072 };
00073 
00074 #define MMERROR( condition, class, params, message )   \
00075   if ( !( condition ) ) {                              \
00076     class _e params;                                    \
00077     _e << message;                                      \
00078     throw _e;                                           \
00079   };
00080 
00081 #endif

[GNU/Linux] [Qt] [Mesa] [STL] [Lapack] [Boost] [Magick++] [Xalan-C and Xerces-C] [doxygen] [graphviz] [FFTW] [popt] [xine] [Gnuplot] [gnu-arch] [gcc] [gstreamer] [autoconf/automake/make] [freshmeat.net] [opensource.org] [sourceforge.net] [MMVL]
mimas 2.1 - Copyright Mon Oct 30 11:31:17 2006, Bala Amavasai, Stuart Meikle, Arul Selvan, Fabio Caparrelli, Jan Wedekind, Manuel Boissenin, ...