Subversion Repositories gelsvn

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
667 khor 1
/** @file ExceptionStandard.h
2
 * @brief Exceptions are not much used in CGLA, but these classes define what we throw.
3
 */
4
 
5
/* ----------------------------------------------------------------------- *
6
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
7
 * Copyright (C) the authors and DTU Informatics
8
 * For license and list of authors, see ../../doc/intro.pdf
9
 * @brief Exceptions are not much used in CGLA, but these classes define what we throw.
10
 * ----------------------------------------------------------------------- */
11
 
12
#ifndef __CGLA_EXCEPTIONSTANDARD_H__
13
#define __CGLA_EXCEPTIONSTANDARD_H__
14
 
15
#include <string>
16
#include <iostream>
17
 
18
namespace CGLA
19
{
20
 
21
	class CGLAMotherException
22
	{
23
		std::string str;
24
	public:
25
		CGLAMotherException(const std::string s)
26
			{
27
				str = s;
28
			}
29
 
30
		void print(std::ostream& os) const 
31
		{
32
			os << str << std::endl; 
33
		}
34
	};
35
 
36
#define CGLA_DERIVEEXCEPTION(nameoe)															\
37
	class nameoe: public CGLAMotherException									\
38
	{																													\
39
	public:																										\
40
		nameoe(const std::string& s): CGLAMotherException(s) {}	\
41
	};																												\
42
 
43
}
44
 
45
#endif