wefts_error.h

Go to the documentation of this file.
00001 /* 00002 wefts_error.h 00003 Error classes - for trhow statements. 00004 00005 $Id: wefts_error.h,v 1.6 2004/03/28 21:45:40 jonnymind Exp $ 00006 --------------------------------------------- 00007 Begin : 2003-08-15 17:13 00008 Author : Giancarlo Niccolai 00009 00010 Last modified because: 00011 00012 */ 00013 00014 /************************************************************************** 00015 * This program is free software; you can redistribute it and/or modify * 00016 * it under the terms of the GNU Library General Public License as * 00017 * published by the Free Software Foundation; either version 2.1 of the * 00018 * License, or (at your option) any later version. * 00019 ***************************************************************************/ 00020 00021 00022 #ifndef WT_ERROR_H 00023 #define WT_ERROR_H 00024 00025 #include <string> 00026 #include <iostream> 00027 00035 namespace Wefts { 00036 00044 class Error 00045 { 00046 private: 00047 int m_osCode; 00048 std::string m_descr; 00049 00050 public: 00055 Error( int code=0, std::string descr="Generic low-level error" ); 00056 00061 int osCode() const { return m_osCode; } 00062 00064 virtual const std::string &description() const { return m_descr; } 00065 00067 virtual const std::string className() const { return "Wefts::Error"; } 00068 00072 friend std::ostream& operator<<( std::ostream &stream, Error &err ); 00073 }; 00074 00075 00077 class NotJoinableError: public Error 00078 { 00079 public: 00084 NotJoinableError( int code=0, std::string descr = "Can't join target thread" ); 00085 00087 virtual const std::string className() const { return "Wefts::NotJoinableError"; } 00088 00089 }; 00090 00092 class InvalidError: public Error 00093 { 00094 public: 00099 InvalidError( int code=0, std::string descr="Using an object in an invalid state" ); 00100 00102 virtual const std::string className() const { return "Wefts::InvalidError"; } 00103 00104 }; 00105 00107 class InitError: public Error 00108 { 00109 public: 00114 InitError( int code=0, std::string descr="Object cannot be initialized" ); 00115 00117 virtual const std::string className() const { return "Wefts::InitError"; } 00118 00119 }; 00120 00122 class StartError: public Error 00123 { 00124 public: 00129 StartError( int code=0, std::string descr="Can't start OS thread" ); 00130 00132 virtual const std::string className() const { return "Wefts::StartError"; } 00133 00134 }; 00135 00140 } 00141 00142 #endif 00143 00144 /* end of wefts_error.h */

Generated on Tue Oct 5 14:57:00 2004 for Wefts by doxygen 1.3.7