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

QgarErrorInvalidArg.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 __QGARERRORINVALIDARG_H_INCLUDED__
00029 #define __QGARERRORINVALIDARG_H_INCLUDED__
00030 
00031 
00032 /**
00033  * @file    QgarErrorInvalidArg.H
00034  * @brief   Header file of class qgar::QgarErrorInvalidArg.
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: QgarErrorInvalidArg.H,v 1.9 2005/01/11 13:14:11 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 QgarErrorInvalidArg QgarErrorInvalidArg.H "qgarlib/QgarErrorInvalidArg.H"
00061  * @ingroup ERROR
00062  * @brief Class for Qgar domain exceptions.
00063  *
00064  * Such an exception is raised when a function is called
00065  * with an invalid argument.
00066  * 
00067  * @author  <a href="mailto:qgar-develop@loria.fr?subject=Qgar fwd Gerald Masini">Gerald Masini</a>
00068  * @date    November 12, 2003  16:02
00069  * @since   Qgar 2.1
00070  */
00071 class QgarErrorInvalidArg
00072 
00073   : public std::invalid_argument,
00074     public AbstractQgarError
00075 
00076 {
00077 // -------------------------------------------------------------------
00078 // P U B L I C   M E M B E R S
00079 // -------------------------------------------------------------------
00080 public:
00081 
00082   /** @name Constructors */
00083   //        ============
00084   //@{
00085   /**
00086    * @brief Construct from the profile of the function throwing
00087    *        the exception, without displaying any error message.
00088    * @param aFuncProfile  profile of the function throwing the exception
00089    */
00090   QgarErrorInvalidArg(const char* aFuncProfile);
00091 
00092   /**
00093    * @brief Construct and display an error message.
00094    * @param aFileName     name of the file including the function throwing the exception
00095    * @param aLineNumber   line number (in the file) of the <b>throw</b> instruction
00096    * @param aFuncProfile  profile of the function throwing the exception
00097    * @param aDiagnostic   full explicit diagnostic
00098    *
00099    * An error message includes 4 lines:
00100    * - message header,  displayed by
00101    *   qgar::AbstractQgarError::displayErrorMessageHeader(const char*)
00102    * - file name and line number of the corresponding <b>throw</b> instruction
00103    * - function profile
00104    * - diagnostic
00105    */
00106   QgarErrorInvalidArg(const char* aFileName,
00107                       int aLineNumber,
00108                       const char* aFuncProfile,
00109                       const std::string aDiagnostic);
00110   //@}
00111 
00112 
00113   /** @name Destructor */
00114   //        ==========
00115   //@{
00116   /**
00117    * @brief Virtual destructor.
00118    */
00119   virtual ~QgarErrorInvalidArg() throw();
00120   //@}
00121   
00122 // -------------------------------------------------------------------
00123 }; // class QgarErrorInvalidArg
00124 
00125 
00126 } // namespace qgar
00127 
00128 #endif /* __QGARERRORINVALIDARG_H_INCLUDED__ */