exception.h

来自「天之炼狱1服务器端源文件游戏服务端不完整」· C头文件 代码 · 共 649 行 · 第 1/2 页

H
649
字号
		//		//////////////////////////////////////////////////////////////////////		class ProtocolException : public IOException {		public :			ProtocolException () throw () : IOException () {}			ProtocolException (const string& msg) throw () : IOException (msg) {}			string getName () const throw () { return "ProtocolException"; }		};				//////////////////////////////////////////////////////////////////////			//			// Idle Exception			//			// 老沥 矫埃悼救 peer 肺何磐 涝仿捞 绝绰 版快			//			//////////////////////////////////////////////////////////////////////			class IdleException : public ProtocolException {			public :				IdleException () throw () : ProtocolException () {}				IdleException (const string& msg) throw () : ProtocolException (msg) {}				string getName () const throw () { return "IdleException"; }			};				//////////////////////////////////////////////////////////////////////			//			// Invalid Protocol Exception			//			// 肋给等 橇肺配妮			//			//////////////////////////////////////////////////////////////////////			class InvalidProtocolException : public ProtocolException {			public :				InvalidProtocolException () throw () : ProtocolException () {}				InvalidProtocolException (const string& msg) throw () : ProtocolException (msg) {}				string getName () const throw () { return "InvalidProtocolException"; }			};				//////////////////////////////////////////////////////////////////////			//			// Insufficient Data Exception			//			// 酒流 菩哦 单捞鸥啊 肯傈窍霸 档馒窍瘤 臼疽阑 版快			//			//////////////////////////////////////////////////////////////////////			class InsufficientDataException : public ProtocolException {			public :				InsufficientDataException (uint size = 0) throw () : ProtocolException (), m_Size(size) {}				InsufficientDataException (const string& msg, uint size = 0) throw () : ProtocolException (msg), m_Size(size) {}				string getName () const throw () { return "InsufficientDataException"; }				uint getSize () const throw () { return m_Size; }				string toString () const throw ()				{					StringStream buf;					buf << getName() << " : " << getMessage();					if (m_Size > 0) {						buf << " (lack of " << m_Size << " bytes)\n";					}					buf << getStackTrace ();								return buf.toString();				}				private :				uint m_Size;			};			//////////////////////////////////////////////////////////////////////			// 			// 橇肺配妮 抗寇, 矫胶袍 抗寇 殿栏肺牢秦辑 立加阑 漏扼具 且 版快			// 捞 抗寇甫 荤侩茄促.			// 			//////////////////////////////////////////////////////////////////////			class DisconnectException : public ProtocolException {			public :				DisconnectException () throw () : ProtocolException () {}				DisconnectException (const string& msg) throw () : ProtocolException (msg) {}				string getName () const throw () { return "DisconnectException"; }			};			//////////////////////////////////////////////////////////////////////			// 			// 漂沥 惑炔锭 公矫秦具 登绰 菩哦捞 甸绢吭阑 版快			// 			//////////////////////////////////////////////////////////////////////			class IgnorePacketException : public ProtocolException {			public :				IgnorePacketException () throw () : ProtocolException () {}				IgnorePacketException (const string& msg) throw () : ProtocolException (msg) {}				string getName () const throw () { return "IgnorePacketException"; }			};	//////////////////////////////////////////////////////////////////////	//	// Thread Exception	//	// 静饭靛 棺 悼扁拳 档备甸俊辑 惯积窍绰 抗寇甸	//	//////////////////////////////////////////////////////////////////////	class ThreadException : public Exception {	public :		ThreadException () throw () : Exception () {}		ThreadException (const string& msg) throw () : Exception (msg) {}		string getName () const throw () { return "ThreadException"; }	};		//////////////////////////////////////////////////////////////////////		//		// Mutex Exception		//		// 孤咆胶俊辑 惯积窍绰 抗寇甸		//		//////////////////////////////////////////////////////////////////////		class MutexException : public ThreadException {		public :			MutexException () throw () : ThreadException () {}			MutexException (const string& msg) throw () : ThreadException (msg) {}			string getName () const throw () { return "MutexException"; }		};			//////////////////////////////////////////////////////////////////////			//			// Mutex Attribute Exception			//			// 孤咆胶 加己俊辑 惯积窍绰 抗寇甸			//			//////////////////////////////////////////////////////////////////////			class MutexAttrException : public MutexException {			public :				MutexAttrException () throw () : MutexException () {}				MutexAttrException (const string& msg) throw () : MutexException (msg) {}				string getName () const throw () { return "MutexAttrException"; }			};		//////////////////////////////////////////////////////////////////////		//		// Conditional Variable Exception		//		// Conditional Variable 俊辑 惯积窍绰 抗寇 (捞抚捞 呈公 辨促.. - -)		//		//////////////////////////////////////////////////////////////////////		class CondVarException : public ThreadException {		public :			CondVarException () throw () : ThreadException () {}			CondVarException (const string& msg) throw () : ThreadException (msg) {}			string getName () const throw () { return "CondVarException"; }		};		//////////////////////////////////////////////////////////////////////		//		// Semaphore Exception		//		// Semaphore 俊辑 惯积窍绰 抗寇		//		//////////////////////////////////////////////////////////////////////		class SemaphoreException : public ThreadException {		public :			SemaphoreException () throw () : ThreadException () {}			SemaphoreException (const string& msg) throw () : ThreadException (msg) {}			string getName () const throw () { return "SemaphoreException"; }		};	//////////////////////////////////////////////////////////////////////	//	// SQL Exception 	//	// SQL 包访 抗寇	//	//////////////////////////////////////////////////////////////////////	class SQLException : public Exception {	public :		SQLException () throw () : Exception() {}		SQLException (const string& msg) throw () : Exception(msg) {}		string getName () const throw () { return "SQLException"; }	};		//////////////////////////////////////////////////////////////////////		//		// SQL Warning		//		// SQL 版绊巩阑 唱鸥郴绰 抗寇~~		//		//////////////////////////////////////////////////////////////////////		class SQLWarning : public SQLException {		public :			SQLWarning () throw () : SQLException() {}			SQLWarning (const string& msg) throw () : SQLException(msg) {}			string getName () const throw () { return "SQLWarning"; }		};		//////////////////////////////////////////////////////////////////////		//		// SQL Connect Exception		//		// SQL俊 措茄 楷搬 矫档啊 角菩茄 版快, 楷搬捞 谗绢脸阑 版快 殿		//		//////////////////////////////////////////////////////////////////////		class SQLConnectException : public SQLException {		public :			SQLConnectException () throw () : SQLException() {}			SQLConnectException (const string& msg) throw () : SQLException(msg) {}			string getName () const throw () { return "SQLConnectException"; }		};		//////////////////////////////////////////////////////////////////////		//		// Query Exception		//		//////////////////////////////////////////////////////////////////////		class SQLQueryException : public SQLException {		public :			SQLQueryException () throw () : SQLException() {}			SQLQueryException (const string& msg) throw () : SQLException(msg) {}			string getName () const throw () { return "SQLQueryException"; }		};	//////////////////////////////////////////////////////////////////////	//	// Runtime Exception	//	// 繁鸥烙俊 惯积啊瓷茄 generic 茄 侩档肺 荤侩瞪 荐 乐绰 抗寇甸	//	//////////////////////////////////////////////////////////////////////	class RuntimeException : public Exception {	public :		RuntimeException () throw () : Exception () {}		RuntimeException (const string& msg) throw () : Exception (msg) {}		string getName () const throw () { return "RuntimeException"; }	};			//////////////////////////////////////////////////////////////////////		//		// Invalid Arguemnt Exception		//		// 窃荐, 糕滚窃荐狼 颇扼固磐啊 肋给等 版快 		//		//////////////////////////////////////////////////////////////////////		class InvalidArgumentException : public RuntimeException {		public :			InvalidArgumentException () throw () : RuntimeException () {}			InvalidArgumentException (const string& msg) throw () : RuntimeException (msg) {}			string getName () const throw () { return "InvalidArgumentException"; }		};		//////////////////////////////////////////////////////////////////////		//		// Out Of Bound Exception		//		// 富弊措肺. Out Of Bound!		//		//////////////////////////////////////////////////////////////////////		class OutOfBoundException : public RuntimeException {		public :			OutOfBoundException () throw () : RuntimeException () {}			OutOfBoundException (const string& msg) throw () : RuntimeException (msg) {}			string getName () const throw () { return "OutOfBoundException"; }		};		//////////////////////////////////////////////////////////////////////		//		// Interrupted Exception		//		// System Call 殿捞 牢磐反飘 寸沁阑 版快		//		//////////////////////////////////////////////////////////////////////		class InterruptedException : public RuntimeException {		public :			InterruptedException () throw () : RuntimeException () {}			InterruptedException (const string& msg) throw () : RuntimeException (msg) {}			string getName () const throw () { return "InterruptedException"; }		};		//////////////////////////////////////////////////////////////////////		//		// No Such Element Exception		//		// 拿泛记俊辑 漂沥 虐蔼阑 八祸沁阑锭 弊繁 郡府刚飘啊 绝绰 版快		//		//////////////////////////////////////////////////////////////////////		class NoSuchElementException : public RuntimeException {		public :			NoSuchElementException () throw () : RuntimeException () {}			NoSuchElementException (const string& msg) throw () : RuntimeException (msg) {}			string getName () const throw () { return "NoSuchElementException"; }		};		//////////////////////////////////////////////////////////////////////		//		// Duplicated Exception		//		// 拿泛记狼 漂沥 虐啊 吝汗登菌阑 锭 		//		//////////////////////////////////////////////////////////////////////		class DuplicatedException : public RuntimeException {		public :			DuplicatedException () throw () : RuntimeException () {}			DuplicatedException (const string& msg) throw () : RuntimeException (msg) {}			string getName () const throw () { return "DuplicatedException"; }		};	//////////////////////////////////////////////////////////////////////	//	// Game Exception	//	// 霸烙俊辑 goto 侩档肺 荤侩窍绰 抗寇甸.. -_-;	//	//////////////////////////////////////////////////////////////////////	class GameException : public Exception {	public :		GameException () throw () : Exception () {}		GameException (const string& msg) throw () : Exception (msg) {}		string getName () const throw () { return "GameException"; }	};			//////////////////////////////////////////////////////////////////////		//		// Portal Exception		//		// PC 啊 器呕阑 光疽阑锭...

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?