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., 59 Temple Place,                                    *
00024  *   Suite 330, Boston, MA  02111-1307  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  *              $Id: error.h,v 1.1.1.1.2.2 2003/04/04 15:39:43 pissaris Exp $
00043  *              $Name:  $ 
00044  ****************************************************************************/
00045 #ifndef ERROR_H_84822 // to make it unique, a random number
00046 #define ERROR_H_84822
00047 
00048 #include "utility.h"
00049 #include <string>
00050 
00051 namespace KDL {
00052 
00056 class Error {
00057 public:
00062         virtual ~Error() {}
00063     virtual const char* Description() const {return "Unspecified Error\n";}
00064 
00065     virtual int GetType() const {return 0;}
00066 };
00067 
00068 
00069 class Error_IO : public Error {
00070         std::string msg;
00071         int typenr;
00072 public:
00073         Error_IO(const std::string& _msg="Unspecified I/O Error",int typenr=0):msg(_msg) {}
00074     virtual const char* Description() const {return msg.c_str();}
00075     virtual int GetType() const {return typenr;}
00076 };
00077 class Error_BasicIO : public Error_IO {};
00078 class Error_BasicIO_File : public Error_BasicIO {
00079 public:
00080     virtual const char* Description() const {return "Error while reading stream";}
00081     virtual int GetType() const {return 1;}
00082 };
00083 class Error_BasicIO_Exp_Delim : public Error_BasicIO {
00084 public:
00085     virtual const char* Description() const {return "Expected Delimiter not encountered";}
00086     virtual int GetType() const {return 2;}
00087 };
00088 class Error_BasicIO_Not_A_Space : public Error_BasicIO {
00089 public:
00090     virtual const char* Description() const {return "Expected space,tab or newline not encountered";}
00091     virtual int GetType() const {return 3;}
00092 };
00093 class Error_BasicIO_Unexpected : public Error_BasicIO {
00094 public:
00095     virtual const char* Description() const {return "Unexpected character";}
00096     virtual int GetType() const {return 4;}
00097 };
00098 
00099 class Error_BasicIO_ToBig : public Error_BasicIO {
00100 public:
00101     virtual const char* Description() const {return "Word that is read out of stream is bigger than maxsize";}
00102     virtual int GetType() const {return 5;}
00103 };
00104 
00105 class Error_BasicIO_Not_Opened : public Error_BasicIO {
00106 public:
00107     virtual const char* Description() const {return "File cannot be opened";}
00108     virtual int GetType() const {return 6;}
00109 };
00110 class Error_FrameIO : public Error_IO {};
00111 class Error_Frame_Vector_Unexpected_id : public Error_FrameIO {
00112 public:
00113     virtual const char* Description() const {return "Unexpected identifier, expecting a vector (explicit or ZERO)";}
00114     virtual int GetType() const {return 101;}
00115 };
00116 class Error_Frame_Frame_Unexpected_id : public Error_FrameIO {
00117 public:
00118     virtual const char* Description() const {return "Unexpected identifier, expecting a Frame (explicit or DH)";}
00119     virtual int GetType() const {return 102;}
00120 };
00121 class Error_Frame_Rotation_Unexpected_id : public Error_FrameIO {
00122 public:
00123     virtual const char* Description() const {return "Unexpected identifier, expecting a Rotation (explicit or EULERZYX, EULERZYZ, RPY,ROT,IDENTITY)";}
00124     virtual int GetType() const {return 103;}
00125 };
00126 class Error_ChainIO : public Error {};
00127 class Error_Chain_Unexpected_id : public Error_ChainIO {
00128 public:
00129     virtual const char* Description() const {return "Unexpected identifier, expecting TRANS or ROT";}
00130     virtual int GetType() const {return 201;}
00131 };
00133 class Error_RedundancyIO:public Error_IO  {};
00134 class Error_Redundancy_Illegal_Resolutiontype : public Error_RedundancyIO {
00135 public:
00136     virtual const char* Description() const {return "Illegal Resolutiontype is used in I/O with ResolutionTask";}
00137     virtual int GetType() const {return 301;}
00138 };
00139 class Error_Redundancy:public Error  {};
00140 class Error_Redundancy_Unavoidable : public Error_Redundancy {
00141 public:
00142     virtual const char* Description() const {return "Joint limits cannot be avoided";}
00143     virtual int GetType() const {return 1002;}
00144 };
00145 class  Error_Redundancy_Low_Manip: public Error_Redundancy {
00146 public:
00147     virtual const char* Description() const {return "Manipulability is very low";}
00148     virtual int GetType() const {return 1003;}
00149 };
00150 class Error_MotionIO : public Error {};
00151 class Error_MotionIO_Unexpected_MotProf : public Error_MotionIO {
00152 public:
00153     virtual const char* Description() const { return "Wrong keyword while reading motion profile";}
00154     virtual int GetType() const {return 2001;}
00155 };
00156 class Error_MotionIO_Unexpected_Traj : public Error_MotionIO {
00157 public:
00158     virtual const char* Description() const { return "Trajectory type keyword not known";}
00159     virtual int GetType() const {return 2002;}
00160 };
00161 
00162 class Error_MotionPlanning : public Error {};
00163 
00164 class Error_MotionPlanning_Circle_ToSmall : public Error_MotionPlanning {
00165 public:
00166     virtual const char* Description() const { return "Circle : radius is to small";}
00167     virtual int GetType() const {return 3001;}
00168 };
00169 
00170 class Error_MotionPlanning_Circle_No_Plane : public Error_MotionPlanning {
00171 public:
00172     virtual const char* Description() const { return "Circle : Plane for motion is not properly defined";}
00173     virtual int GetType() const {return 3002;}
00174 };
00175 
00176 class Error_MotionPlanning_Incompatible: public Error_MotionPlanning {
00177 public:
00178     virtual const char* Description() const { return "Acceleration of a rectangular velocityprofile cannot be used";}
00179     virtual int GetType() const {return 3003;}
00180 };
00181 
00182 class Error_MotionPlanning_Not_Feasible: public Error_MotionPlanning {
00183 public:
00184     virtual const char* Description() const { return "Motion Profile with requested parameters is not feasible";}
00185     virtual int GetType() const {return 3004;}
00186 };
00187 
00188 class Error_MotionPlanning_Not_Applicable: public Error_MotionPlanning {
00189 public:
00190     virtual const char* Description() const { return "Method is not applicable for this derived object";}
00191     virtual int GetType() const {return 3004;}
00192 };
00194 class Error_Integrator : public Error {};
00195 
00197 class Error_Stepsize_Underflow  : public Error_Integrator {
00198 public: 
00199     virtual const char* Description() const { return "Stepsize Underflow";}
00200     virtual int GetType() const {return 4001;}
00201 };
00202 
00205 class Error_To_Many_Steps : public Error_Integrator {
00206 public:
00207     virtual const char* Description() const { return "To many steps"; }
00208     virtual int GetType() const {return 4002;}
00209 };
00210 
00212 class Error_Stepsize_To_Small : public Error_Integrator {
00213 public:
00214     virtual const char* Description() const { return "Stepsize to small"; }
00215     virtual int GetType() const {return 4003;}
00216 };
00217 
00218 class Error_Criterium : public Error {};
00219 
00220 class Error_Criterium_Unexpected_id: public Error_Criterium {
00221 public:
00222     virtual const char* Description() const { return "Unexpected identifier while reading a criterium";   }
00223     virtual int GetType() const {return 5001;}
00224 };
00225 
00226 class Error_Limits : public Error {};
00227 
00228 class Error_Limits_Unexpected_id: public Error_Limits {
00229 public:
00230     virtual const char* Description() const { return "Unexpected identifier while reading a jointlimits"; }
00231     virtual int GetType() const {return 6001;}
00232 };
00233 
00234 
00235 class Error_Not_Implemented: public Error {
00236 public:
00237     virtual const char* Description() const { return "The requested object/method/function is not implemented"; }
00238     virtual int GetType() const {return 7000;}
00239 };
00240 
00241 
00242 
00243 }
00244 
00245 #endif

Generated on Wed Nov 23 19:00:10 2011 for FreeCAD by  doxygen 1.6.1