00001 // Copyright (C) 1999 Jean-Marc Valin 00002 00003 #ifndef _NETWORKEXCEPTION_H_ 00004 #define _NETWORKEXCEPTION_H_ 00005 00006 //#include "Node.h" 00007 #include <iostream> 00008 #include <string> 00009 #include "rc_ptrs.h" 00010 #include "BaseException.h" 00011 00012 namespace FD { 00013 00014 /***************************************************************************/ 00015 /* 00016 NodeNotFoundException 00017 Dominic Letourneau 00018 */ 00019 /***************************************************************************/ 00024 class NodeNotFoundException : public BaseException { 00025 00026 public: 00027 00029 NodeNotFoundException(std::string name) { 00030 nodeName = name; 00031 } 00033 virtual void print(std::ostream &out = std::cerr) { 00034 out<<"NodeNotFoundException occured, nodeName: "<<nodeName<<std::endl; 00035 } 00037 std::string nodeName; 00038 }; 00039 00040 /***************************************************************************/ 00041 /* 00042 NoSinkNodeException 00043 Dominic Letourneau 00044 */ 00045 /***************************************************************************/ 00050 class NoSinkNodeException : public BaseException { 00051 00052 public: 00054 NoSinkNodeException() {errorNo = 0;} 00055 00057 NoSinkNodeException(int value) { 00058 errorNo = value; 00059 } 00061 virtual void print(std::ostream &out = std::cerr) { 00062 out<<"NoSinkNodeException occured, errorNo: "<<errorNo<<std::endl; 00063 } 00065 int errorNo; 00066 }; 00067 00068 /***************************************************************************/ 00069 /* 00070 NoInputNodeException 00071 Dominic Letourneau 00072 */ 00073 /***************************************************************************/ 00078 class NoInputNodeException : public BaseException { 00079 00080 public: 00081 00083 NoInputNodeException() {errorNo = 0;} 00084 00086 NoInputNodeException(int value) { 00087 errorNo = value; 00088 } 00089 00091 virtual void print(std::ostream &out = std::cerr) { 00092 out<<"NoInputNodeException occured, errorNo: "<<errorNo<<std::endl; 00093 } 00094 00096 int errorNo; 00097 }; 00098 00099 00100 /***************************************************************************/ 00101 /* 00102 FactoryNotFoundException 00103 Dominic Letourneau 00104 */ 00105 /***************************************************************************/ 00111 class FactoryNotFoundException : public BaseException { 00112 00113 public: 00114 00116 FactoryNotFoundException(std::string name) { 00117 factoryName = name; 00118 } 00120 virtual void print(std::ostream &out = std::cerr) { 00121 out<<"FactoryNotFoundException occured, factoryName: "<<factoryName<<std::endl; 00122 } 00124 std::string factoryName; 00125 }; 00126 00127 }//end namespace FD 00128 00129 #endif