Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

QgarErrorAlgorithm.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------+
00002  | Library QgarLib, graphics analysis and recognition                  |
00003  | Copyright (C) 2002  Qgar Project, LORIA                             |
00004  |                                                                     |
00005  | This library is free software; you can redistribute it and/or       |
00006  | modify it under the terms of the GNU Lesser General Public          |
00007  | License version 2.1, as published by the Free Software Foundation.  |
00008  |                                                                     |
00009  | This library is distributed in the hope that it will be useful,     |
00010  | but WITHOUT ANY WARRANTY; without even the implied warranty of      |
00011  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                |
00012  | See the GNU Lesser General Public License for more details.         |
00013  |                                                                     |
00014  | The GNU Lesser General Public License is included in the file       |
00015  | LICENSE.LGPL, in the root directory of the Qgar packaging. See      |
00016  | http://www.gnu.org/licenses/lgpl.html for the terms of the licence. |
00017  | To receive a paper copy, write to the Free Software Foundation,     |
00018  | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.       |
00019  |                                                                     |
00020  | Contact Project Qgar for any information:                           |
00021  |   LORIA - équipe Qgar                                               |
00022  |   B.P. 239, 54506 Vandoeuvre-lès-Nancy Cedex, France                |
00023  |   email: qgar-contact@loria.fr                                      |
00024  |   http://www.qgar.org/                                              |
00025  *---------------------------------------------------------------------*/
00026 
00027 
00028 #ifndef __QGARERRORALGORITHM_H_INCLUDED__
00029 #define __QGARERRORALGORITHM_H_INCLUDED__
00030 
00031 
00032 /**
00033  * @file    QgarErrorAlgorithm.H
00034  * @brief   Header file of class qgar::QgarErrorAlgorithm.
00035  *
00036  * @author  <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Gerald Masini">Gerald Masini</a>
00037  * @date    November 12, 2003  16:02
00038  * @since   Qgar 2.1
00039  */
00040 
00041 
00042 // For RCS/CVS use: Do not delete
00043 /* $Id: QgarErrorAlgorithm.H,v 1.9 2005/01/11 13:14:10 masini Exp $ */
00044 
00045 
00046 
00047 // STL
00048 #include <stdexcept>
00049 #include <string>
00050 // QGAR
00051 #include <qgarlib/AbstractQgarError.H>
00052 
00053 
00054 
00055 namespace qgar
00056 {
00057 
00058 
00059 /**
00060  * @class QgarErrorAlgorithm QgarErrorAlgorithm.H "qgarlib/QgarErrorAlgorithm.H"
00061  * @ingroup ERROR
00062  * @brief Class for Qgar algorithm exceptions.
00063  *
00064  * An algorithm exception is raised when an algorithm fails for a reason
00065  * that is in no way due to a bad implementation and that cannot be normally
00066  * anticipated by the user: For example, initial conditions that cannot
00067  * be set from the data set.
00068  * 
00069  * @author  <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Gerald Masini">Gerald Masini</a>
00070  * @date    November 12, 2003  16:02
00071  * @since   Qgar 2.1
00072  */
00073 class QgarErrorAlgorithm
00074 
00075   : public std::runtime_error,
00076     public AbstractQgarError
00077 
00078 {
00079 // -------------------------------------------------------------------
00080 // P U B L I C   M E M B E R S
00081 // -------------------------------------------------------------------
00082 public:
00083 
00084   /** @name Constructors */
00085   //        ============
00086   //@{
00087   /**
00088    * @brief Construct from the profile of the function throwing
00089    *        the exception, without displaying any error message.
00090    * @param aFuncProfile  profile of the function throwing the exception
00091    */
00092   QgarErrorAlgorithm(const char* aFuncProfile);
00093 
00094   /**
00095    * @brief Construct and display an error message.
00096    * @param aFileName     name of the file including the function throwing the exception
00097    * @param aLineNumber   line number (in the file) of the <b>throw</b> instruction
00098    * @param aFuncProfile  profile of the function throwing the exception
00099    * @param aDiagnostic   full explicit diagnostic
00100    *
00101    * An error message includes 4 lines:
00102    * - message header,  displayed by
00103    *   qgar::AbstractQgarError::displayErrorMessageHeader(const char*)
00104    * - file name and line number of the corresponding <b>throw</b> instruction
00105    * - function profile
00106    * - diagnostic
00107    */
00108   QgarErrorAlgorithm(const char* aFileName,
00109                      int aLineNumber,
00110                      const char* aFuncProfile,
00111                      const std::string aDiagnostic);
00112   //@}
00113 
00114 
00115   /** @name Destructor */
00116   //        ==========
00117   //@{
00118   /**
00119    * @brief Virtual destructor.
00120    */
00121   virtual ~QgarErrorAlgorithm() throw();
00122   //@}
00123   
00124 // -------------------------------------------------------------------
00125 }; // class QgarErrorAlgorithm
00126 
00127 
00128 } // namespace qgar
00129 
00130 #endif /* __QGARERRORALGORITHM_H_INCLUDED__ */