src/cpsp/Exception.cc
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 #include "cpsp/Exception.hh" 00021 00022 namespace cpsp 00023 { 00024 00025 unsigned int Exception::errorCount = 0; 00026 00027 00028 Exception::Exception(): 00029 outString("\nException raised\n"), retValue(-1) 00030 { 00031 errorCount++; 00032 } 00033 00034 Exception::Exception(const std::string &outString) : 00035 outString(outString), retValue(-1) 00036 { 00037 errorCount++; 00038 } 00039 00040 Exception::Exception(const std::string &outString, const int retValue) : 00041 outString(outString), retValue(retValue) 00042 { 00043 errorCount++; 00044 } 00045 00046 Exception::~Exception() { 00047 } 00048 00049 std::ostream& operator<< (std::ostream& os, const Exception& p) { 00050 if (&p == NULL) 00051 os <<"NULL"; 00052 else 00053 os <<p.toString(); 00054 return os; 00055 } 00056 00057 } // namespace cpsp