00001 /* 00002 * $Id: SystemException.h 562 2007-12-02 08:04:16Z mindstorm2600 $ 00003 * 00004 * X-VR2 00005 * 00006 * Copyright (C) Juan V. Guerrero 2007 00007 * 00008 * Juan V. Guerrero <mindstorm2600@users.sourceforge.net> 00009 * 00010 * This program is free software, distributed under the terms of 00011 * the GNU General Public License Version 2. See the LICENSE file 00012 * at the top of the source tree. 00013 */ 00014 #ifndef __XVR2_SYSTEMEXCEPTION_H__ 00015 #define __XVR2_SYSTEMEXCEPTION_H__ 00016 #include<xvr2/DataTypes.h> 00017 #include<xvr2/CoreExceptions.h> 00018 #include<xvr2/String.h> 00019 00020 namespace xvr2 { 00024 class SystemException : public Exception { 00025 private: 00027 OSErrorCodeT os_errno; 00028 protected: 00029 public: 00041 SystemException(); 00047 SystemException(OSErrorCodeT error_code); 00053 SystemException(const SystemException &se); 00056 OSErrorCodeT osErrorCode(); 00059 String osErrorMessage(); 00062 int code(); 00065 virtual String message(); 00066 }; 00067 00072 class IOException:public SystemException{ 00073 public: 00075 IOException(); 00076 IOException(OSErrorCodeT error_code); 00077 }; 00081 class DSOException:public SystemException{ 00082 public: 00084 DSOException(const char *msg = 0); 00085 }; 00086 00090 class FileException:public IOException{ 00091 public: 00093 FileException(); 00094 FileException(OSErrorCodeT error_code); 00095 }; 00099 class NotEnoughKernelMemory:public IOException{ 00100 public: 00102 NotEnoughKernelMemory(); 00103 }; 00104 00109 class BrokenPipe:public IOException{ 00110 public: 00112 BrokenPipe(); 00113 }; 00114 00118 class ProcOutOfFileDescriptors:public IOException{ 00119 public: 00121 ProcOutOfFileDescriptors(); 00122 }; 00123 00127 class SysOutOfFileDescriptors:public IOException{ 00128 public: 00130 SysOutOfFileDescriptors(); 00131 }; 00132 00138 class DeviceOrFIFONotFound:public IOException{ 00139 public: 00141 DeviceOrFIFONotFound(); 00142 }; 00147 class DeviceNotFound:public IOException{ 00148 public: 00150 DeviceNotFound(); 00151 }; 00152 00156 class InterruptedSystemCall:public IOException{ 00157 public: 00161 InterruptedSystemCall(); 00162 }; 00163 00167 class SocketUnableToWrite:public IOException{ 00168 public: 00170 SocketUnableToWrite(); 00171 }; 00172 00176 class SocketUnableToRead:public IOException{ 00177 public: 00179 SocketUnableToRead(); 00180 }; 00184 class CantLoadDSO:public DSOException{ 00185 public: 00187 CantLoadDSO(); 00188 }; 00189 00193 class CantUnloadDSO:public DSOException{ 00194 public: 00196 CantUnloadDSO(); 00197 }; 00198 00202 class DSOSymbolException:public DSOException{ 00203 public: 00205 DSOSymbolException(); 00206 }; 00207 } 00208 00209 00210 #endif