src/cpsp/Exception.hh
Go to the documentation of this file.00001 /* 00002 * Main authors: 00003 * Martin Mann http://www.bioinf.uni-freiburg.de/~mmann/ 00004 * 00005 * Contributing authors: 00006 * Sebastian Will http://www.bioinf.uni-freiburg.de/~will/ 00007 * 00008 * Copyright: 00009 * Martin Mann, 2007 00010 * 00011 * This file is part of the CPSP-tools package: 00012 * http://www.bioinf.uni-freiburg.de/sw/cpsp/ 00013 * 00014 * See the file "LICENSE" for information on usage and 00015 * redistribution of this file, and for a 00016 * DISCLAIMER OF ALL WARRANTIES. 00017 * 00018 */ 00019 00020 #ifndef EXCEPTION_HH_ 00021 #define EXCEPTION_HH_ 00022 00023 #include <string> 00024 #include <iostream> 00025 00038 namespace cpsp 00039 { 00040 00041 class Exception 00042 { 00043 private: 00044 std::string outString; 00045 public: 00046 Exception(); 00047 Exception(const std::string &outString); 00048 Exception(const std::string &outString, const int retValue); 00049 virtual ~Exception(); 00050 00051 std::string toString() const { return outString; } 00052 00053 int retValue; 00054 static unsigned int errorCount; 00055 }; 00056 00057 std::ostream& operator<< (std::ostream& os, const Exception &p); 00058 00059 00060 } // namespace cpsp 00061 00062 #endif /*EXCEPTION_HH_*/