Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
exceptions.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2011 LpzRobots development team *
3  * Georg Martius <georg dot martius at web dot de> *
4  * Frank Guettler <guettler at informatik dot uni-leipzig dot de *
5  * Frank Hesse <frank at nld dot ds dot mpg dot de> *
6  * Ralf Der <ralfder at mis dot mpg dot de> *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the *
20  * Free Software Foundation, Inc., *
21  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
22  * *
23  ***************************************************************************/
24 #ifndef EXCEPTIONS_H
25 #define EXCEPTIONS_H
26 
27 #define EXCEPTION_TEMPLATE(class_name) \
28  class class_name : public IException { \
29  public: \
30  inline virtual void raise() const { throw *this; } \
31  };
32 
33 
34 namespace lpzrobots {
35 
36 
37 class IException {
38  public:
39  virtual void raise() const = 0;
40 };
41 
42 
43 EXCEPTION_TEMPLATE(IndexOutOfBoundsException);
44 EXCEPTION_TEMPLATE(InvalidArgumentException);
45 EXCEPTION_TEMPLATE(DimensionMismatchException);
46 
47 
48 
49 }
50 
51 
52 #endif
Definition: exceptions.h:37
EXCEPTION_TEMPLATE(IndexOutOfBoundsException)