Sfoglia il codice sorgente

Added three general purpose exception classes.

Sascha Zelzer 13 anni fa
parent
commit
947280c855
2 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 4 0
      Libs/Core/ctkException.cpp
  2. 4 0
      Libs/Core/ctkException.h

+ 4 - 0
Libs/Core/ctkException.cpp

@@ -123,3 +123,7 @@ QDebug operator<<(QDebug dbg, const ctkException& exc)
   dbg << exc.what();
   return dbg.maybeSpace();
 }
+
+CTK_IMPLEMENT_EXCEPTION(ctkRuntimeException, ctkException, "ctkRuntimeException")
+CTK_IMPLEMENT_EXCEPTION(ctkInvalidArgumentException, ctkRuntimeException, "ctkInvalidArgumentException")
+CTK_IMPLEMENT_EXCEPTION(ctkIllegalStateException, ctkRuntimeException, "ctkIllegalStateException")

+ 4 - 0
Libs/Core/ctkException.h

@@ -180,4 +180,8 @@ CTK_CORE_EXPORT QDebug operator<<(QDebug dbg, const ctkException& exc);
     return new CLS(*this);                                               \
   }
 
+CTK_DECLARE_EXCEPTION(CTK_CORE_EXPORT, ctkRuntimeException, ctkException)
+CTK_DECLARE_EXCEPTION(CTK_CORE_EXPORT, ctkInvalidArgumentException, ctkRuntimeException)
+CTK_DECLARE_EXCEPTION(CTK_CORE_EXPORT, ctkIllegalStateException, ctkRuntimeException)
+
 #endif // __ctkException_h