소스 검색

Added three general purpose exception classes.

Sascha Zelzer 13 년 전
부모
커밋
947280c855
2개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  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