00001 /*----------------------------------------------------------------------------* 00002 * Copyright (c) 2005 Southeastern Universities Research Association, * 00003 * Thomas Jefferson National Accelerator Facility * 00004 * * 00005 * This software was developed under a United States Government license * 00006 * described in the NOTICE file included as part of this distribution. * 00007 * * 00008 * E.Wolin, 25-Feb-2005, Jefferson Lab * 00009 * * 00010 * Authors: Elliott Wolin * 00011 * wolin@jlab.org Jefferson Lab, MS-6B * 00012 * Phone: (757) 269-7365 12000 Jefferson Ave. * 00013 * Fax: (757) 269-5519 Newport News, VA 23606 * 00014 * 00015 *----------------------------------------------------------------------------*/ 00016 00017 #ifndef _CodaException_hxx 00018 #define _CodaException_hxx 00019 00020 00021 #include <exception> 00022 #include <string> 00023 #include <sstream> 00024 00025 00026 namespace codaObject { 00027 00028 using namespace std; 00029 00030 00031 //----------------------------------------------------------------------------- 00032 //----------------------------------------------------------------------------- 00033 00034 00038 class CodaException : public std::exception { 00039 00040 public: 00041 CodaException(const string &c); 00042 CodaException(const string &c, int i); 00043 virtual ~CodaException(void) throw(); 00044 00045 virtual void setReturnCode(int i) throw(); 00046 virtual int getReturnCode(void) const throw(); 00047 virtual string toString(void) const throw(); 00048 virtual const char* what(void) const throw(); 00049 00050 00051 private: 00052 string descr; 00053 int returnCode; 00054 }; 00055 00056 00057 //----------------------------------------------------------------------------- 00058 //----------------------------------------------------------------------------- 00059 00060 00061 } // namespace codaObject 00062 00063 #endif /* _CodaException_hxx */