Exception.h

Go to the documentation of this file.
00001 /*
00002         This file is part of ALIZE which is an open-source tool for 
00003         speaker recognition.
00004 
00005     ALIZE is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU Lesser General Public License as 
00007     published by the Free Software Foundation, either version 3 of 
00008     the License, or any later version.
00009 
00010     ALIZE is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public 
00016     License along with ALIZE.
00017     If not, see <http://www.gnu.org/licenses/>.
00018         
00019         ALIZE is a development project initiated by the ELISA consortium
00020         [alize.univ-avignon.fr/] and funded by the French Research 
00021         Ministry in the framework of the TECHNOLANGUE program 
00022         [www.technolangue.net]
00023 
00024         The ALIZE project team wants to highlight the limits of voice
00025         authentication in a forensic context.
00026         The "Person  Authentification by Voice: A Need of Caution" paper 
00027         proposes a good overview of this point (cf. "Person  
00028         Authentification by Voice: A Need of Caution", Bonastre J.F., 
00029         Bimbot F., Boe L.J., Campbell J.P., Douglas D.A., Magrin-
00030         chagnolleau I., Eurospeech 2003, Genova].
00031         The conclusion of the paper of the paper is proposed bellow:
00032         [Currently, it is not possible to completely determine whether the 
00033         similarity between two recordings is due to the speaker or to other 
00034         factors, especially when: (a) the speaker does not cooperate, (b) there 
00035         is no control over recording equipment, (c) recording conditions are not 
00036         known, (d) one does not know whether the voice was disguised and, to a 
00037         lesser extent, (e) the linguistic content of the message is not 
00038         controlled. Caution and judgment must be exercised when applying speaker 
00039         recognition techniques, whether human or automatic, to account for these 
00040         uncontrolled factors. Under more constrained or calibrated situations, 
00041         or as an aid for investigative purposes, judicious application of these 
00042         techniques may be suitable, provided they are not considered as infallible.
00043         At the present time, there is no scientific process that enables one to 
00044         uniquely characterize a person=92s voice or to identify with absolute 
00045         certainty an individual from his or her voice.]
00046         Contact Jean-Francois Bonastre for more information about the licence or
00047         the use of ALIZE
00048 
00049         Copyright (C) 2003-2010
00050         Laboratoire d'informatique d'Avignon [lia.univ-avignon.fr]
00051         ALIZE admin [alize@univ-avignon.fr]
00052         Jean-Francois Bonastre [jean-francois.bonastre@univ-avignon.fr]
00053 */
00054 
00055 #if !defined(ALIZE_Exception_h)
00056 #define ALIZE_Exception_h
00057 
00058 #if defined(_WIN32)
00059 #if defined(ALIZE_EXPORTS)
00060 #define ALIZE_API __declspec(dllexport)
00061 #else
00062 #define ALIZE_API __declspec(dllimport)
00063 #endif
00064 #else
00065 #define ALIZE_API
00066 #endif
00067 
00068 #include "Object.h"
00069 #include "alizeString.h"
00070 
00071 namespace alize
00072 {
00073 
00079 
00080 
00081   class ALIZE_API Exception : public Object
00082   {
00083     public :
00091       explicit Exception(const String& msg,
00092                          const String& sourceFile, int line);
00093       explicit Exception(const String& msg,
00094                          const String& sourceFile, int line, const String callerName);
00095       Exception(const Exception&);
00096       virtual ~Exception();
00097       virtual String toString() const;
00098       virtual String getClassName() const;
00099 
00100       //void OBS__storeStackTrace() ;
00117       String stackTrace( const String callerName) const ;
00118 
00119       const String msg; // message of the exception
00120       const String sourceFile; // name of the source file
00121       const int  line; // line number of the source file
00122       String trace ;  
00123     private:
00124       bool operator==(const Exception&) const;   
00125       bool operator!=(const Exception& e) const;   
00126       const Exception& operator=(const Exception&);
00127   };
00128 
00129   //---------------------------------------------------------------------
00136 
00137   class IndexOutOfBoundsException : public Exception
00138   {
00139     public :
00140       explicit IndexOutOfBoundsException(const String& msg,
00141                 const String& sourceFile, int line,
00142                 long index, long limit);
00143       IndexOutOfBoundsException(
00144         const IndexOutOfBoundsException&);
00145       virtual ~IndexOutOfBoundsException();
00146       virtual String getClassName() const;
00147       virtual String toString() const;
00148       const long index;
00149       const long limit;
00150     private:
00151       bool operator==(const IndexOutOfBoundsException&)
00152                         const; 
00153       bool operator!=(const IndexOutOfBoundsException& e)
00154                         const; 
00155       const IndexOutOfBoundsException& operator=(
00156           const IndexOutOfBoundsException&); 
00157   };
00158 
00159   //---------------------------------------------------------------------
00167 
00168   class ALIZE_API IOException : public Exception
00169   {
00170     public :
00171       explicit IOException(const String& msg,
00172             const String& sourceFile, int line, const FileName& f);
00173       explicit IOException(const String& msg,
00174             const String& sourceFile, int line, const FileName& f, const String callerName);
00175       IOException(const IOException&);
00176       virtual ~IOException();
00177       virtual String toString() const;
00178       virtual String getClassName() const;
00179       const FileName fileName;
00180     private:
00181       bool operator==(const IOException&) const;   
00182       bool operator!=(const IOException& e) const; 
00183       const IOException& operator=(
00184                   const IOException&); 
00185   };
00186   //---------------------------------------------------------------------
00193 
00194   class IdAlreadyExistsException : public Exception
00195   {
00196     public :
00197       explicit IdAlreadyExistsException(const String& msg,
00198           const String& sourceFile, int line);
00199       IdAlreadyExistsException(
00200         const IdAlreadyExistsException&);
00201       virtual ~IdAlreadyExistsException();
00202       virtual String getClassName() const;
00203     private:
00204       bool operator==(const IdAlreadyExistsException&)
00205                           const; 
00206       bool operator!=(const IdAlreadyExistsException& e)
00207                           const; 
00208       const IdAlreadyExistsException& operator=(const
00209                IdAlreadyExistsException&); 
00210   };
00211   //---------------------------------------------------------------------
00218 
00219   class InvalidDataException : public IOException
00220   {
00221     public :
00222       explicit InvalidDataException(const String& msg,
00223         const String& sourceFile, int line, const FileName& f);
00224       InvalidDataException(const InvalidDataException&);
00225       virtual ~InvalidDataException();
00226       virtual String getClassName() const;
00227     private:
00228       bool operator==(const InvalidDataException&)
00229                         const; 
00230       bool operator!=(const InvalidDataException& e)
00231                         const; 
00232       const InvalidDataException& operator=(const
00233                  InvalidDataException&); 
00234   };
00235   //---------------------------------------------------------------------
00240 
00241   class FileNotFoundException : public IOException
00242   {
00243     public :
00244       explicit FileNotFoundException(const String& msg,
00245          const String& sourceFile, int line, const FileName& f);
00246       FileNotFoundException(const FileNotFoundException&);
00247       virtual ~FileNotFoundException();
00248       virtual String getClassName() const;
00249     private:
00250       bool operator==(const FileNotFoundException&)
00251                         const; 
00252       bool operator!=(const FileNotFoundException& e)
00253                         const; 
00254       const FileNotFoundException& operator=(const
00255                 FileNotFoundException&); 
00256   };
00257   //---------------------------------------------------------------------
00263 
00264   class EOFException : public IOException
00265   {
00266     public :
00267       explicit EOFException(const String& msg,
00268         const String& sourceFile, int line, const FileName& f);
00269       EOFException(const EOFException&);
00270       virtual ~EOFException();
00271       virtual String getClassName() const;
00272     private:
00273       bool operator==(const EOFException&) const; 
00274       bool operator!=(const EOFException& e)
00275                          const; 
00276       const EOFException& operator=(
00277                   const EOFException&); 
00278   };
00279   //---------------------------------------------------------------------
00284 
00285   class OutOfMemoryException : public Exception
00286   {
00287     public :
00288       explicit OutOfMemoryException(const String& msg,
00289           const String& sourceFile, int line);
00290       OutOfMemoryException(const OutOfMemoryException&);
00291       virtual ~OutOfMemoryException();
00292       virtual String getClassName() const;
00293     private:
00294       bool operator==(const OutOfMemoryException&)
00295                         const; 
00296       bool operator!=(const OutOfMemoryException& e)
00297                         const; 
00298       const OutOfMemoryException& operator=(const
00299                  OutOfMemoryException&); 
00300   };
00301   //---------------------------------------------------------------------
00306 
00307   class ParamNotFoundInConfigException : public Exception
00308   {
00309     public :
00310       explicit ParamNotFoundInConfigException(const String& msg,
00311           const String& sourceFile, int line);
00312       ParamNotFoundInConfigException(const ParamNotFoundInConfigException&);
00313       virtual ~ParamNotFoundInConfigException();
00314       virtual String getClassName() const;
00315     private:
00316       bool operator==(const ParamNotFoundInConfigException&)
00317                         const; 
00318       bool operator!=(const ParamNotFoundInConfigException& e)
00319                         const; 
00320       const ParamNotFoundInConfigException& operator=(const
00321                  ParamNotFoundInConfigException&); 
00322   };
00323   //---------------------------------------------------------------------
00328 
00329   class ConfigCheckException : public Exception
00330   {
00331     public :
00332       explicit ConfigCheckException(const String& msg,
00333           const String& sourceFile, int line);
00334       ConfigCheckException(const ConfigCheckException&);
00335       virtual ~ConfigCheckException();
00336       virtual String getClassName() const;
00337     private:
00338       bool operator==(const ConfigCheckException&)
00339                         const; 
00340       bool operator!=(const ConfigCheckException& e)
00341                         const; 
00342       const ConfigCheckException& operator=(const
00343                  ConfigCheckException&); 
00344   };
00345   //---------------------------------------------------------------------
00346 } // end namespace alize
00347 
00348 //extern void* operator new(size_t);
00349 
00350 #endif // !defined(ALIZE_Exception_h)
00351