ctkPluginDatabaseException.cpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #include "ctkPluginDatabaseException.h"
  16. #include <QDebug>
  17. //----------------------------------------------------------------------------
  18. ctkPluginDatabaseException::ctkPluginDatabaseException(const QString& msg, const Type& type)
  19. : ctkRuntimeException(msg),
  20. type(type)
  21. {
  22. }
  23. //----------------------------------------------------------------------------
  24. ctkPluginDatabaseException::ctkPluginDatabaseException(const QString& msg, const Type& type,
  25. const ctkException& cause)
  26. : ctkRuntimeException(msg, cause),
  27. type(type)
  28. {
  29. }
  30. //----------------------------------------------------------------------------
  31. ctkPluginDatabaseException::ctkPluginDatabaseException(const QString& msg,
  32. const ctkException& cause)
  33. : ctkRuntimeException(msg, cause),
  34. type(UNSPECIFIED)
  35. {
  36. }
  37. //----------------------------------------------------------------------------
  38. ctkPluginDatabaseException::ctkPluginDatabaseException(const ctkPluginDatabaseException& o)
  39. : ctkRuntimeException(o), type(o.type)
  40. {
  41. }
  42. //----------------------------------------------------------------------------
  43. ctkPluginDatabaseException& ctkPluginDatabaseException::operator=(const ctkPluginDatabaseException& o)
  44. {
  45. ctkRuntimeException::operator=(o);
  46. type = o.type;
  47. return *this;
  48. }
  49. //----------------------------------------------------------------------------
  50. ctkPluginDatabaseException::~ctkPluginDatabaseException() throw()
  51. {
  52. }
  53. //----------------------------------------------------------------------------
  54. const char* ctkPluginDatabaseException::name() const throw()
  55. {
  56. return "ctkPluginDatabaseException";
  57. }
  58. //----------------------------------------------------------------------------
  59. ctkPluginDatabaseException* ctkPluginDatabaseException::clone() const
  60. {
  61. return new ctkPluginDatabaseException(*this);
  62. }
  63. //----------------------------------------------------------------------------
  64. void ctkPluginDatabaseException::rethrow() const
  65. {
  66. throw *this;
  67. }
  68. //----------------------------------------------------------------------------
  69. ctkPluginDatabaseException::Type ctkPluginDatabaseException::getType() const
  70. {
  71. return type;
  72. }