exception.h

来自「使用神经网络开发包实现图形化的神经网络模拟」· C头文件 代码 · 共 37 行

H
37
字号
#ifndef _EXCEPTION_H
#define _EXCEPTION_H

#include <iostream>
#include <string>

namespace annie
{

/** A common exception class used by all classes in the annie library.
  *	You should place calls to functions that can throw exceptions in a try {} block,
  * and catch(Exception &e). Use cout<<e.what() to print out the details onto the screen.
  *
  * In version 1.0 of annie, this is the only class thrown by any function. Further refinements
  * will be made as and when required.
  */
class Exception
{
protected:
	std::string details;
public:
	///Creates an exception
	/** @param info A string specifying details of the error. */
	Exception(const char *info);

	///Creates an exception
	/** @param info A string specifying details of the error. */
	Exception(std::string info);

	///Returns a string consisting of the details specified when the Exception was created
	std::string what();
};

}; //namespace annie
#endif // define _EXCEPTION_H

⌨️ 快捷键说明

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