Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

Exception.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------------
00002 //                   OpenMS -- Open-Source Mass Spectrometry
00003 // --------------------------------------------------------------------------
00004 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
00005 // ETH Zurich, and Freie Universitaet Berlin 2002-2012.
00006 //
00007 // This software is released under a three-clause BSD license:
00008 //  * Redistributions of source code must retain the above copyright
00009 //    notice, this list of conditions and the following disclaimer.
00010 //  * Redistributions in binary form must reproduce the above copyright
00011 //    notice, this list of conditions and the following disclaimer in the
00012 //    documentation and/or other materials provided with the distribution.
00013 //  * Neither the name of any author or any participating institution
00014 //    may be used to endorse or promote products derived from this software
00015 //    without specific prior written permission.
00016 // For a full list of authors, refer to the file AUTHORS.
00017 // --------------------------------------------------------------------------
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00019 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
00022 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00024 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00025 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00026 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00027 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00028 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // --------------------------------------------------------------------------
00031 // $Maintainer: Stephan Aiche$
00032 // $Authors: Marc Sturm $
00033 // --------------------------------------------------------------------------
00034 
00035 #ifndef OPENMS_CONCEPT_EXCEPTION_H
00036 #define OPENMS_CONCEPT_EXCEPTION_H
00037 
00038 #include <OpenMS/config.h>
00039 #include <OpenMS/CONCEPT/Types.h>
00040 
00041 #include <new>
00042 #include <string>
00043 #include <sstream>
00044 
00045 namespace OpenMS
00046 {
00047 
00062   namespace Exception
00063   {
00064 
00090     class OPENMS_DLLAPI BaseException :
00091       public std::exception
00092     {
00093 public:
00094 
00098 
00100       BaseException() throw();
00101 
00103       BaseException(const char * file, int line, const char * function) throw();
00104 
00106       BaseException(const char * file, int line, const char * function, const std::string & name, const std::string & message) throw();
00107 
00109       BaseException(const BaseException & exception) throw();
00110 
00112       virtual ~BaseException() throw();
00114 
00118 
00120       const char * getName() const throw();
00121 
00123       virtual const char * what() const throw();
00124 
00126       int getLine() const throw();
00127 
00129       const char * getFile() const throw();
00130 
00132       const char * getFunction() const throw();
00133 
00135       const char * getMessage() const throw();
00136 
00138       void setMessage(const std::string & message) throw();
00139 
00141 
00142 protected:
00143 
00145       const char * file_;
00146 
00148       int                 line_;
00149 
00151       const char * function_;
00152 
00154       std::string name_;
00155 
00157       std::string what_;
00158     };
00159 
00167     class OPENMS_DLLAPI Precondition :
00168       public BaseException
00169     {
00170 public:
00171       Precondition(const char * file, int line, const char * function, const std::string & condition)  throw();
00172     };
00173 
00181     class OPENMS_DLLAPI Postcondition :
00182       public BaseException
00183     {
00184 public:
00185       Postcondition(const char * file, int line, const char * function, const std::string & condition) throw();
00186     };
00187 
00196     class OPENMS_DLLAPI MissingInformation :
00197       public BaseException
00198     {
00199 public:
00200       MissingInformation(const char * file, int line, const char * function, const std::string & error_message) throw();
00201     };
00202 
00203 
00217     class OPENMS_DLLAPI IndexUnderflow :
00218       public BaseException
00219     {
00220 public:
00221       IndexUnderflow(const char * file, int line, const char * function, SignedSize index = 0, Size size = 0) throw();
00222     };
00223 
00236     class OPENMS_DLLAPI SizeUnderflow :
00237       public BaseException
00238     {
00239 public:
00240       SizeUnderflow(const char * file, int line, const char * function, Size size = 0) throw();
00241     };
00242 
00255     class OPENMS_DLLAPI IndexOverflow :
00256       public BaseException
00257     {
00258 public:
00259       IndexOverflow(const char * file, int line, const char * function, SignedSize index = 0, Size size = 0) throw();
00260     };
00261 
00272     class OPENMS_DLLAPI FailedAPICall :
00273       public BaseException
00274     {
00275 public:
00276       FailedAPICall(const char * file, int line, const char * function, const std::string & message) throw();
00277     };
00278 
00286     class OPENMS_DLLAPI InvalidRange :
00287       public BaseException
00288     {
00289 public:
00290       InvalidRange(const char * file, int line, const char * function) throw();
00291     };
00292 
00293 
00304     class OPENMS_DLLAPI InvalidSize :
00305       public BaseException
00306     {
00307 public:
00308       InvalidSize(const char * file, int line, const char * function, Size size = 0) throw();
00309     };
00310 
00311 
00320     class OPENMS_DLLAPI OutOfRange :
00321       public BaseException
00322     {
00323 public:
00324       OutOfRange(const char * file, int line, const char * function) throw();
00325     };
00326 
00336     class OPENMS_DLLAPI InvalidValue :
00337       public BaseException
00338     {
00339 public:
00340       InvalidValue(const char * file, int line, const char * function, const std::string & message, const std::string & value) throw();
00341     };
00342 
00348     class OPENMS_DLLAPI InvalidParameter :
00349       public BaseException
00350     {
00351 public:
00352       InvalidParameter(const char * file, int line, const char * function, const std::string & message) throw();
00353     };
00354 
00363     class OPENMS_DLLAPI ConversionError :
00364       public BaseException
00365     {
00366 public:
00367       ConversionError(const char * file, int line, const char * function, const std::string & error) throw();
00368     };
00369 
00379     class OPENMS_DLLAPI IllegalSelfOperation :
00380       public BaseException
00381     {
00382 public:
00383       IllegalSelfOperation(const char * file, int line, const char * function) throw();
00384     };
00385 
00394     class OPENMS_DLLAPI NullPointer :
00395       public BaseException
00396     {
00397 public:
00398       NullPointer(const char * file, int line, const char * function) throw();
00399     };
00400 
00408     class OPENMS_DLLAPI InvalidIterator :
00409       public BaseException
00410     {
00411 public:
00412       InvalidIterator(const char * file, int line, const char * function) throw();
00413     };
00414 
00423     class OPENMS_DLLAPI IncompatibleIterators :
00424       public BaseException
00425     {
00426 public:
00427       IncompatibleIterators(const char * file, int line, const char * function) throw();
00428     };
00429 
00437     class OPENMS_DLLAPI NotImplemented :
00438       public BaseException
00439     {
00440 public:
00441       NotImplemented(const char * file, int line, const char * function) throw();
00442     };
00443 
00451     class OPENMS_DLLAPI IllegalTreeOperation :
00452       public BaseException
00453     {
00454 public:
00455       IllegalTreeOperation(const char * file, int line, const char * function) throw();
00456     };
00457 
00468 #ifdef _MSC_VER // disable some seqan warnings that distract from ours
00469 #   pragma warning( push ) // save warning state
00470 #   pragma warning( disable : 4275 )
00471 #endif
00472     class OPENMS_DLLAPI OutOfMemory :
00473       public BaseException, public std::bad_alloc
00474     {
00475 public:
00476       OutOfMemory(const char * file, int line, const char * function, Size size = 0) throw();
00477     };
00478 #ifdef _MSC_VER
00479 #   pragma warning( pop )  // restore old warning state
00480 #endif
00481 
00486     class OPENMS_DLLAPI BufferOverflow :
00487       public BaseException
00488     {
00489 public:
00490       BufferOverflow(const char * file, int line, const char * function) throw();
00491     };
00492 
00498     class OPENMS_DLLAPI DivisionByZero :
00499       public BaseException
00500     {
00501 public:
00502       DivisionByZero(const char * file, int line, const char * function) throw();
00503     };
00504 
00510     class OPENMS_DLLAPI OutOfGrid :
00511       public BaseException
00512     {
00513 public:
00514       OutOfGrid(const char * file, int line, const char * function) throw();
00515     };
00516 
00524     class OPENMS_DLLAPI FileNotFound :
00525       public BaseException
00526     {
00527 public:
00528       FileNotFound(const char * file, int line, const char * function, const std::string & filename) throw();
00529     };
00530 
00538     class OPENMS_DLLAPI FileNotReadable :
00539       public BaseException
00540     {
00541 public:
00542       FileNotReadable(const char * file, int line, const char * function, const std::string & filename) throw();
00543     };
00544 
00552     class OPENMS_DLLAPI FileNotWritable :
00553       public BaseException
00554     {
00555 public:
00556       FileNotWritable(const char * file, int line, const char * function, const std::string & filename) throw();
00557     };
00558 
00566     class OPENMS_DLLAPI IOException :
00567       public BaseException
00568     {
00569 public:
00570       IOException(const char * file, int line, const char * function, const std::string & filename) throw();
00571     };
00572 
00580     class OPENMS_DLLAPI FileEmpty :
00581       public BaseException
00582     {
00583 public:
00584       FileEmpty(const char * file, int line, const char * function, const std::string & filename) throw();
00585     };
00586 
00594     class OPENMS_DLLAPI IllegalPosition :
00595       public BaseException
00596     {
00597 public:
00598       IllegalPosition(const char * file, int line, const char * function, float x, float y, float z) throw();
00599     };
00600 
00608     class OPENMS_DLLAPI ParseError :
00609       public BaseException
00610     {
00611 public:
00612       ParseError(const char * file, int line, const char * function, const std::string & expression, const std::string & message) throw();
00613     };
00614 
00622     class OPENMS_DLLAPI UnableToCreateFile :
00623       public BaseException
00624     {
00625 public:
00626       UnableToCreateFile(const char * file, int line, const char * function, const std::string & filename) throw();
00627     };
00628 
00634     class OPENMS_DLLAPI IllegalArgument :
00635       public BaseException
00636     {
00637 public:
00638       IllegalArgument(const char * file, int line, const char * function, const std::string & error_message) throw();
00639     };
00640 
00648     class OPENMS_DLLAPI ElementNotFound :
00649       public BaseException
00650     {
00651 public:
00652       ElementNotFound(const char * file, int line, const char * function, const std::string & element)   throw();
00653     };
00654 
00662     class OPENMS_DLLAPI UnableToFit :
00663       public BaseException
00664     {
00665 public:
00666       UnableToFit(const char * file, int line, const char * function, const std::string & name, const std::string & message) throw();
00667     };
00668 
00677     class OPENMS_DLLAPI UnableToCalibrate :
00678       public BaseException
00679     {
00680 public:
00681       UnableToCalibrate(const char * file, int line, const char * function, const std::string & name, const std::string & message) throw();
00682     };
00683 
00691     class OPENMS_DLLAPI DepletedIDPool :
00692       public BaseException
00693     {
00694 public:
00695       DepletedIDPool(const char * file, int line, const char * function, const std::string & name, const std::string & message) throw();
00696     };
00697 
00698   } // namespace Exception
00699 
00721   OPENMS_DLLAPI std::ostream & operator<<(std::ostream & os, const Exception::BaseException & e);
00722 
00723 } // namespace OPENMS
00724 
00725 #endif // OPENMS_CONCEPT_EXCEPTION_H

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:38 using doxygen 1.7.1