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

mxcpc_exceptions.h

00001 //           ///          //                                        Mx clientSDK
00002 //          /////        ////                    Mx Crossplatform Client Library
00003 //         /// XXX     XXX ///
00004 //        ///    XXX XXX    ///     $RCSfile: mxcpc_exceptions.h,v $
00005 //       ///       XXX       ///     $Revision: 1.3 $
00006 //      ///      XXX XXX      ///     $Date: 2005/12/09 15:33:45 $
00007 //     ////    XXX     XXX    ////     $Author: cvs-kai $
00008 //    ////                     ////
00009 //   ////  M  O  B  O  T  I  X  ////////////////////////////////////////////////
00010 //  //// Security Vision Systems //////////////////////////////////////////////
00011 //                                                                          //
00012 //  Copyright (C) 2005 - 2006, MOBOTIX AG, Germany                         //
00013 //  This software is made available under the BSD licence. Please refer   //
00014 //  to the file LICENCE.TXT contained in this distribution for details.  //
00015 //                                                                      //
00016 //  /////////////////////////////////////////////////////////////////////
00017 
00018 
00019 
00020 #ifndef __MXCPC_EXCEPTIONS_H__
00021 #define __MXCPC_EXCEPTIONS_H__
00022 
00023 
00024 
00025 #define MXCPC_RETHROW_UNHANDLED_EXCEPTION(e) \
00026          if(   !dynamic_cast<std::bad_alloc *>(&e) \
00027             && !dynamic_cast<mxcpcException *>(&e)) throw
00028 
00029             
00030             
00031 #include <exception>
00032 #include <memory>
00033 
00034 
00035 
00036 //! Mother of all <tt>mxcpc</tt> exceptions :-)
00037 /*!
00038  *  \ingroup mxcpc_core
00039  *
00040  *  As a matter of fact, mxcpcException itself is derived from 
00041  *  <tt>std::exception</tt>.
00042  *
00043  *  \attention
00044  *  It is policy throughout the <tt>mxcpc</tt> library, that whoever
00045  *  throws an mxcpcException guarantees preservation of application state
00046  *  integrity through proper rollback mechanisms. It is also convention that
00047  *  <tt>mxcpc</tt> methods including class constructors either fail with a 
00048  *  <tt>std::bad_alloc</tt> exception or with any kind of mxcpcException - 
00049  *  as a result, any other kind of exception that should escape 
00050  *  <tt>mxcpc</tt> code must be considered unexpected and no guarantees 
00051  *  about sane application state hold.
00052  */
00053 class mxcpcException : public std::exception {};
00054 
00055 
00056 //! Unspecific screw-up.
00057 /*!
00058  *  \ingroup mxcpc_core
00059  */
00060 class mxcpcDidntWorkOutException : public mxcpcException {};
00061 
00062 
00063 //! Failure during file, network or similar operations.
00064 /*!
00065  *  \ingroup mxcpc_core
00066  */
00067 class mxcpcIOFailure : public mxcpcException {};
00068 
00069 
00070 //! An operation was attempted that would have violated datastructure 
00071 //! integrity. 
00072 /*!
00073  *  \ingroup mxcpc_core
00074  *
00075  *  However, as it is with all mxcpcException s, datastructure integrity was
00076  *  preserved.
00077  */
00078 class mxcpcDatastructureIntegrityViolation : public mxcpcException {};
00079 
00080 
00081 
00082 #endif   // __MXCPC_EXCEPTIONS_H__

Generated on Fri Jan 20 13:33:31 2006 for mxcpc by  doxygen 1.4.4