Subversion Repositories gelsvn

Rev

Rev 2 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 595
-
 
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
 
1
#ifndef __CGLA_EXCEPTIONSTANDARD_H__
12
#ifndef __CGLA_EXCEPTIONSTANDARD_H__
2
#define __CGLA_EXCEPTIONSTANDARD_H__
13
#define __CGLA_EXCEPTIONSTANDARD_H__
3
 
14
 
4
#include <string>
15
#include <string>
5
#include <iostream>
16
#include <iostream>
6
 
17
 
7
namespace CGLA
18
namespace CGLA
8
{
19
{
9
 
20
 
10
	class CGLAMotherException
21
	class CGLAMotherException
11
	{
22
	{
12
		std::string str;
23
		std::string str;
13
	public:
24
	public:
14
		CGLAMotherException(const std::string s)
25
		CGLAMotherException(const std::string s)
15
			{
26
			{
16
				str = s;
27
				str = s;
17
			}
28
			}
18
  
29
  
19
		void print(std::ostream& os) const 
30
		void print(std::ostream& os) const 
20
		{
31
		{
21
			os << str << std::endl; 
32
			os << str << std::endl; 
22
		}
33
		}
23
	};
34
	};
24
 
35
 
25
#define CGLA_DERIVEEXCEPTION(nameoe)															\
36
#define CGLA_DERIVEEXCEPTION(nameoe)															\
26
	class nameoe: public CGLAMotherException									\
37
	class nameoe: public CGLAMotherException									\
27
	{																													\
38
	{																													\
28
	public:																										\
39
	public:																										\
29
		nameoe(const std::string& s): CGLAMotherException(s) {}	\
40
		nameoe(const std::string& s): CGLAMotherException(s) {}	\
30
	};																												\
41
	};																												\
31
 
42
 
32
}
43
}
33
 
44
 
34
#endif
45
#endif
35
 
46