Blender V2.61 - r43446

error.h

Go to the documentation of this file.
00001 /***************************************************************************
00002   tag: Erwin Aertbelien  Mon Jan 10 16:38:38 CET 2005  error.h 
00003 
00004                         error.h -  description
00005                            -------------------
00006     begin                : Mon January 10 2005
00007     copyright            : (C) 2005 Erwin Aertbelien
00008     email                : erwin.aertbelien@mech.kuleuven.ac.be
00009  
00010  ***************************************************************************
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 51 Franklin Street,                                    *
00024  *   Fifth Floor, Boston, MA 02110-1301, USA.                               *
00025  *                                                                         *
00026  ***************************************************************************/
00027  
00028  
00029 /*****************************************************************************
00030  * \file  
00031  *       Defines the exception classes that can be thrown
00032  *  \author 
00033  *      Erwin Aertbelien, Div. PMA, Dep. of Mech. Eng., K.U.Leuven
00034  *
00035  *  \version 
00036  *      ORO_Geometry V0.2
00037  *
00038  *  \par History
00039  *      - $log$
00040  *
00041  *  \par Release
00042  *      $Name:  $ 
00043  ****************************************************************************/
00044 #ifndef ERROR_H_84822 // to make it unique, a random number
00045 #define ERROR_H_84822
00046 
00047 #include "utility.h"
00048 #include <string>
00049 
00050 namespace KDL {
00051 
00055 class Error {
00056 public:
00061     virtual ~Error() {}
00062     virtual const char* Description() const {return "Unspecified Error\n";}
00063 
00064     virtual int GetType() const {return 0;}
00065 };
00066 
00067 
00068 class Error_IO : public Error {
00069     std::string msg;
00070     int typenr;
00071 public:
00072     Error_IO(const std::string& _msg="Unspecified I/O Error",int typenr=0):msg(_msg) {}
00073     virtual const char* Description() const {return msg.c_str();}
00074     virtual int GetType() const {return typenr;}
00075 };
00076 class Error_BasicIO : public Error_IO {};
00077 class Error_BasicIO_File : public Error_BasicIO {
00078 public:
00079     virtual const char* Description() const {return "Error while reading stream";}
00080     virtual int GetType() const {return 1;}
00081 };
00082 class Error_BasicIO_Exp_Delim : public Error_BasicIO {
00083 public:
00084     virtual const char* Description() const {return "Expected Delimiter not encountered";}
00085     virtual int GetType() const {return 2;}
00086 };
00087 class Error_BasicIO_Not_A_Space : public Error_BasicIO {
00088 public:
00089     virtual const char* Description() const {return "Expected space,tab or newline not encountered";}
00090     virtual int GetType() const {return 3;}
00091 };
00092 class Error_BasicIO_Unexpected : public Error_BasicIO {
00093 public:
00094     virtual const char* Description() const {return "Unexpected character";}
00095     virtual int GetType() const {return 4;}
00096 };
00097 
00098 class Error_BasicIO_ToBig : public Error_BasicIO {
00099 public:
00100     virtual const char* Description() const {return "Word that is read out of stream is bigger than maxsize";}
00101     virtual int GetType() const {return 5;}
00102 };
00103 
00104 class Error_BasicIO_Not_Opened : public Error_BasicIO {
00105 public:
00106     virtual const char* Description() const {return "File cannot be opened";}
00107     virtual int GetType() const {return 6;}
00108 };
00109 class Error_FrameIO : public Error_IO {};
00110 class Error_Frame_Vector_Unexpected_id : public Error_FrameIO {
00111 public:
00112     virtual const char* Description() const {return "Unexpected identifier, expecting a vector (explicit or ZERO)";}
00113     virtual int GetType() const {return 101;}
00114 };
00115 class Error_Frame_Frame_Unexpected_id : public Error_FrameIO {
00116 public:
00117     virtual const char* Description() const {return "Unexpected identifier, expecting a Frame (explicit or DH)";}
00118     virtual int GetType() const {return 102;}
00119 };
00120 class Error_Frame_Rotation_Unexpected_id : public Error_FrameIO {
00121 public:
00122     virtual const char* Description() const {return "Unexpected identifier, expecting a Rotation (explicit or EULERZYX, EULERZYZ, RPY,ROT,IDENTITY)";}
00123     virtual int GetType() const {return 103;}
00124 };
00125 class Error_ChainIO : public Error {};
00126 class Error_Chain_Unexpected_id : public Error_ChainIO {
00127 public:
00128     virtual const char* Description() const {return "Unexpected identifier, expecting TRANS or ROT";}
00129     virtual int GetType() const {return 201;}
00130 };
00132 class Error_RedundancyIO:public Error_IO  {};
00133 class Error_Redundancy_Illegal_Resolutiontype : public Error_RedundancyIO {
00134 public:
00135     virtual const char* Description() const {return "Illegal Resolutiontype is used in I/O with ResolutionTask";}
00136     virtual int GetType() const {return 301;}
00137 };
00138 class Error_Redundancy:public Error  {};
00139 class Error_Redundancy_Unavoidable : public Error_Redundancy {
00140 public:
00141     virtual const char* Description() const {return "Joint limits cannot be avoided";}
00142     virtual int GetType() const {return 1002;}
00143 };
00144 class  Error_Redundancy_Low_Manip: public Error_Redundancy {
00145 public:
00146     virtual const char* Description() const {return "Manipulability is very low";}
00147     virtual int GetType() const {return 1003;}
00148 };
00149 class Error_MotionIO : public Error {};
00150 class Error_MotionIO_Unexpected_MotProf : public Error_MotionIO {
00151 public:
00152     virtual const char* Description() const { return "Wrong keyword while reading motion profile";}
00153     virtual int GetType() const {return 2001;}
00154 };
00155 class Error_MotionIO_Unexpected_Traj : public Error_MotionIO {
00156 public:
00157     virtual const char* Description() const { return "Trajectory type keyword not known";}
00158     virtual int GetType() const {return 2002;}
00159 };
00160 
00161 class Error_MotionPlanning : public Error {};
00162 
00163 class Error_MotionPlanning_Circle_ToSmall : public Error_MotionPlanning {
00164 public:
00165     virtual const char* Description() const { return "Circle : radius is to small";}
00166     virtual int GetType() const {return 3001;}
00167 };
00168 
00169 class Error_MotionPlanning_Circle_No_Plane : public Error_MotionPlanning {
00170 public:
00171     virtual const char* Description() const { return "Circle : Plane for motion is not properly defined";}
00172     virtual int GetType() const {return 3002;}
00173 };
00174 
00175 class Error_MotionPlanning_Incompatible: public Error_MotionPlanning {
00176 public:
00177     virtual const char* Description() const { return "Acceleration of a rectangular velocityprofile cannot be used";}
00178     virtual int GetType() const {return 3003;}
00179 };
00180 
00181 class Error_MotionPlanning_Not_Feasible: public Error_MotionPlanning {
00182 public:
00183     virtual const char* Description() const { return "Motion Profile with requested parameters is not feasible";}
00184     virtual int GetType() const {return 3004;}
00185 };
00186 
00187 class Error_MotionPlanning_Not_Applicable: public Error_MotionPlanning {
00188 public:
00189     virtual const char* Description() const { return "Method is not applicable for this derived object";}
00190     virtual int GetType() const {return 3004;}
00191 };
00193 class Error_Integrator : public Error {};
00194 
00196 class Error_Stepsize_Underflow  : public Error_Integrator {
00197 public: 
00198     virtual const char* Description() const { return "Stepsize Underflow";}
00199     virtual int GetType() const {return 4001;}
00200 };
00201 
00204 class Error_To_Many_Steps : public Error_Integrator {
00205 public:
00206     virtual const char* Description() const { return "To many steps"; }
00207     virtual int GetType() const {return 4002;}
00208 };
00209 
00211 class Error_Stepsize_To_Small : public Error_Integrator {
00212 public:
00213     virtual const char* Description() const { return "Stepsize to small"; }
00214     virtual int GetType() const {return 4003;}
00215 };
00216 
00217 class Error_Criterium : public Error {};
00218 
00219 class Error_Criterium_Unexpected_id: public Error_Criterium {
00220 public:
00221     virtual const char* Description() const { return "Unexpected identifier while reading a criterium";   }
00222     virtual int GetType() const {return 5001;}
00223 };
00224 
00225 class Error_Limits : public Error {};
00226 
00227 class Error_Limits_Unexpected_id: public Error_Limits {
00228 public:
00229     virtual const char* Description() const { return "Unexpected identifier while reading a jointlimits"; }
00230     virtual int GetType() const {return 6001;}
00231 };
00232 
00233 
00234 class Error_Not_Implemented: public Error {
00235 public:
00236     virtual const char* Description() const { return "The requested object/method/function is not implemented"; }
00237     virtual int GetType() const {return 7000;}
00238 };
00239 
00240 
00241 
00242 }
00243 
00244 #endif