Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

CjicException.hpp

Go to the documentation of this file.
00001 
00002 #ifndef CjicException_h
00003 #define CjicException_h 1
00004 
00005 // stdexcept
00006 #include <stdexcept>
00007 #include <strstream>
00008 #include "jic/log/trazas.hpp"
00009 
00010 //      Excepcion Basica de nuestro proyecto. Todas las
00011 //      excepciones deberán heredar de ella.
00012 
00013 class CjicException : public std::runtime_error  
00014 {
00015 
00016   public:
00017       CjicException (const std::string& strDesc);
00018 
00019     // Additional Public Declarations
00020 
00021   protected:
00022     // Additional Protected Declarations
00023 
00024   private:
00025     // Additional Private Declarations
00026 
00027   private: 
00028     // Additional Implementation Declarations
00029 
00030 };
00031 
00032 // Class CjicException 
00033 
00034 inline CjicException::CjicException (const std::string& strDesc)
00035   : std::runtime_error(strDesc)
00036 {
00037 }
00038 
00039 #ifdef DEBUG
00040 
00041 #define THROW(Excepcion, Descripcion) \
00042   { \
00043   std::strstream * info = new std::strstream; \
00044   (*info) << #Excepcion << ": " << Descripcion << " ( " << __FILE__ << ", " << __LINE__ << " )" << std::ends; \
00045   char *cadena = info->str(); \
00046   Excepcion exc(cadena); \
00047   delete cadena; \
00048   delete info; \
00049   SUCESO(exc.what()); \
00050   throw(exc); \
00051 }
00052 
00053 #else
00054 
00055 #define THROW(Excepcion, Descripcion) \
00056   { \
00057   std::strstream * info = new std::strstream; \
00058   (*info) << #Excepcion << ": " << Descripcion << std::ends; \
00059   char *cadena = info->str(); \
00060   Excepcion exc(cadena); \
00061   delete cadena; \
00062   delete info; \
00063   SUCESO(exc.what()); \
00064   throw(exc); \
00065 }
00066 
00067 #endif
00068 
00069 #endif

Generated on Wed Mar 5 21:31:47 2003 for JIC by doxygen1.3-rc3