Просмотр исходного кода

Use CTK exception classes everywhere in PluginFramework and plug-ins.

Sascha Zelzer лет назад: 13
Родитель
Сommit
3c081d518e
54 измененных файлов с 136 добавлено и 138 удалено
  1. 1 1
      Libs/PluginFramework/Testing/org.commontk.pluginfwtest/ctkPluginFrameworkTestSuite.cpp
  2. 2 2
      Libs/PluginFramework/ctkDictionary.cpp
  3. 1 1
      Libs/PluginFramework/ctkDictionary.h
  4. 2 2
      Libs/PluginFramework/ctkLDAPSearchFilter.h
  5. 5 5
      Libs/PluginFramework/ctkPlugin.h
  6. 10 10
      Libs/PluginFramework/ctkPluginContext.h
  7. 9 9
      Libs/PluginFramework/ctkPluginFrameworkUtil.cpp
  8. 2 2
      Libs/PluginFramework/ctkPluginFrameworkUtil_p.h
  9. 2 2
      Libs/PluginFramework/ctkPluginManifest.cpp
  10. 1 1
      Libs/PluginFramework/ctkPluginPrivate_p.h
  11. 1 1
      Libs/PluginFramework/ctkServiceReference.h
  12. 1 1
      Libs/PluginFramework/ctkServiceRegistration.h
  13. 3 4
      Libs/PluginFramework/ctkServiceTracker.tpp
  14. 1 1
      Libs/PluginFramework/ctkServiceTrackerPrivate.h
  15. 6 8
      Libs/PluginFramework/ctkServiceTrackerPrivate.tpp
  16. 1 1
      Libs/PluginFramework/ctkServices_p.h
  17. 2 2
      Libs/PluginFramework/ctkVersionRange.cpp
  18. 8 8
      Libs/PluginFramework/service/cm/ctkConfiguration.h
  19. 1 1
      Libs/PluginFramework/service/cm/ctkConfigurationAdmin.h
  20. 2 2
      Libs/PluginFramework/service/cm/ctkConfigurationEvent.cpp
  21. 4 4
      Libs/PluginFramework/service/event/ctkEvent.cpp
  22. 1 1
      Libs/PluginFramework/service/event/ctkEvent.h
  23. 1 1
      Libs/PluginFramework/service/event/ctkEventAdmin.h
  24. 1 1
      Plugins/org.commontk.configadmin/ctkConfigurationAdminImpl.cpp
  25. 3 3
      Plugins/org.commontk.configadmin/ctkConfigurationImpl.cpp
  26. 1 1
      Plugins/org.commontk.dah.app/ctkDicomAbstractApp.cpp
  27. 2 2
      Plugins/org.commontk.dah.app/ctkDicomAppPlugin.cpp
  28. 3 3
      Plugins/org.commontk.dah.core/ctkDicomAppHostingTypesHelper.cpp
  29. 1 1
      Plugins/org.commontk.dah.core/ctkSimpleSoapClient.cpp
  30. 1 1
      Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic.cpp
  31. 2 2
      Plugins/org.commontk.eventadmin/adapter/ctkEAAbstractAdapter.cpp
  32. 1 1
      Plugins/org.commontk.eventadmin/adapter/ctkEALogEventAdapter.cpp
  33. 1 1
      Plugins/org.commontk.eventadmin/ctkEAConfiguration_p.h
  34. 1 1
      Plugins/org.commontk.eventadmin/ctkEventAdminActivator_p.h
  35. 2 2
      Plugins/org.commontk.eventadmin/ctkEventAdminImpl.tpp
  36. 8 8
      Plugins/org.commontk.eventadmin/ctkEventAdminImpl_p.h
  37. 5 5
      Plugins/org.commontk.eventadmin/ctkEventAdminService.cpp
  38. 1 1
      Plugins/org.commontk.eventadmin/ctkEventAdminService_p.h
  39. 4 4
      Plugins/org.commontk.eventadmin/dispatch/ctkEAPooledExecutor.cpp
  40. 4 4
      Plugins/org.commontk.eventadmin/dispatch/ctkEAPooledExecutor_p.h
  41. 3 3
      Plugins/org.commontk.eventadmin/handler/ctkEABlacklistingHandlerTasks.tpp
  42. 1 1
      Plugins/org.commontk.eventadmin/handler/ctkEABlacklistingHandlerTasks_p.h
  43. 2 2
      Plugins/org.commontk.eventadmin/handler/ctkEACacheFilters.tpp
  44. 2 2
      Plugins/org.commontk.eventadmin/handler/ctkEACacheFilters_p.h
  45. 1 1
      Plugins/org.commontk.eventadmin/handler/ctkEACacheTopicHandlerFilters.tpp
  46. 2 2
      Plugins/org.commontk.eventadmin/handler/ctkEAFilters_p.h
  47. 1 1
      Plugins/org.commontk.eventadmin/tasks/ctkEASyncDeliverTasks.tpp
  48. 1 1
      Plugins/org.commontk.eventadmin/util/ctkEACyclicBarrier_p.h
  49. 1 1
      Plugins/org.commontk.eventadmin/util/ctkEALeastRecentlyUsedCacheMap.tpp
  50. 4 4
      Plugins/org.commontk.eventbus/ctkBusEvent.cpp
  51. 1 1
      Plugins/org.commontk.eventbus/ctkBusEvent.h
  52. 2 1
      Plugins/org.commontk.metatype/ctkMetaTypeProviderImpl.cpp
  53. 4 4
      Plugins/org.commontk.plugingenerator.core/ctkPluginGeneratorCodeModel.cpp
  54. 3 3
      Plugins/org.commontk.slicermodule/ctkSlicerModuleReader.cpp

+ 1 - 1
Libs/PluginFramework/Testing/org.commontk.pluginfwtest/ctkPluginFrameworkTestSuite.cpp

@@ -183,7 +183,7 @@ void ctkPluginFrameworkTestSuite::frame010a()
 }
 }
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
-//Test result of getService(ctkServiceReference()). Should throw std::invalid_argument
+//Test result of getService(ctkServiceReference()). Should throw ctkInvalidArgumentException
 void ctkPluginFrameworkTestSuite::frame018a()
 void ctkPluginFrameworkTestSuite::frame018a()
 {
 {
   try
   try

+ 2 - 2
Libs/PluginFramework/ctkDictionary.cpp

@@ -22,7 +22,7 @@
 
 
 #include "ctkDictionary.h"
 #include "ctkDictionary.h"
 
 
-#include <stdexcept>
+#include <ctkException.h>
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
 ctkDictionary::ctkDictionary()
 ctkDictionary::ctkDictionary()
@@ -47,7 +47,7 @@ ctkDictionary::ctkDictionary(const ctkProperties& properties)
     {
     {
       QString msg("ctkProperties object contains case variants of the key: ");
       QString msg("ctkProperties object contains case variants of the key: ");
       msg += it.key();
       msg += it.key();
-      throw std::invalid_argument(qPrintable(msg));
+      throw ctkInvalidArgumentException(msg);
     }
     }
     this->insert(it.key(), it.value());
     this->insert(it.key(), it.value());
   }
   }

+ 1 - 1
Libs/PluginFramework/ctkDictionary.h

@@ -53,7 +53,7 @@ public:
    * not contain case-variants of the same string.
    * not contain case-variants of the same string.
    *
    *
    * @param properties The ctkProperties object from which to copy the key-value pairs.
    * @param properties The ctkProperties object from which to copy the key-value pairs.
-   * @throws std::invalid_argument if <code>properties</code> contains case-variants of a key
+   * @throws ctkInvalidArgumentException if <code>properties</code> contains case-variants of a key
    */
    */
   ctkDictionary(const ctkProperties& properties);
   ctkDictionary(const ctkProperties& properties);
 
 

+ 2 - 2
Libs/PluginFramework/ctkLDAPSearchFilter.h

@@ -73,12 +73,12 @@ public:
    * <code>ctkDictionary</code> object.
    * <code>ctkDictionary</code> object.
    *
    *
    * <p>
    * <p>
-   * If the filter cannot be parsed, an std::invalid_argument will be
+   * If the filter cannot be parsed, an ctkInvalidArgumentException will be
    * thrown with a human readable message where the filter became unparsable.
    * thrown with a human readable message where the filter became unparsable.
    *
    *
    * @param filter The filter string.
    * @param filter The filter string.
    * @return A <code>ctkLDAPSearchFilter</code> object encapsulating the filter string.
    * @return A <code>ctkLDAPSearchFilter</code> object encapsulating the filter string.
-   * @throws std::invalid_argument If <code>filter</code> contains an invalid
+   * @throws ctkInvalidArgumentException If <code>filter</code> contains an invalid
    *         filter string that cannot be parsed.
    *         filter string that cannot be parsed.
    * @see "Framework specification for a description of the filter string syntax." TODO!
    * @see "Framework specification for a description of the filter string syntax." TODO!
    */
    */

+ 5 - 5
Libs/PluginFramework/ctkPlugin.h

@@ -260,7 +260,7 @@ public:
    *
    *
    * <p>
    * <p>
    * If this plugin's state is <code>UNINSTALLED</code> then an
    * If this plugin's state is <code>UNINSTALLED</code> then an
-   * <code>std::logic_error</code> is thrown.
+   * <code>ctkIllegalStateException</code> is thrown.
    * <p>
    * <p>
    * The following steps are required to start this bundle:
    * The following steps are required to start this bundle:
    * <ol>
    * <ol>
@@ -367,7 +367,7 @@ public:
    * The following steps are required to stop a plugin:
    * The following steps are required to stop a plugin:
    * <ol>
    * <ol>
    * <li>If this plugin's state is <code>UNINSTALLED</code> then an
    * <li>If this plugin's state is <code>UNINSTALLED</code> then an
-   * <code>std::logic_error</code> is thrown.
+   * <code>ctkIllegalStateException</code> is thrown.
    *
    *
    * <li>If this plugin is in the process of being activated or deactivated
    * <li>If this plugin is in the process of being activated or deactivated
    * then this method must wait for activation or deactivation to complete
    * then this method must wait for activation or deactivation to complete
@@ -457,7 +457,7 @@ public:
    * The following steps are required to update a plugin:
    * The following steps are required to update a plugin:
    * <ol>
    * <ol>
    * <li>If this plugin's state is <code>UNINSTALLED</code> then an
    * <li>If this plugin's state is <code>UNINSTALLED</code> then an
-   * <code>std::logic_error</code> is thrown.
+   * <code>ctkIllegalStateException</code> is thrown.
    *
    *
    * <li>If this plugin's state is <code>ACTIVE</code>, <code>STARTING</code>
    * <li>If this plugin's state is <code>ACTIVE</code>, <code>STARTING</code>
    * or <code>STOPPING</code>, this plugin is stopped as described in the
    * or <code>STOPPING</code>, this plugin is stopped as described in the
@@ -507,7 +507,7 @@ public:
    *        Manifest header, if present, or this plugin's original location.
    *        Manifest header, if present, or this plugin's original location.
    * @throws ctkPluginException If the update location cannot be read or the update
    * @throws ctkPluginException If the update location cannot be read or the update
    *         fails.
    *         fails.
-   * @throws std::logic_error If this plugin has been uninstalled or this
+   * @throws ctkIllegalStateException If this plugin has been uninstalled or this
    *         plugin tries to change its own state.
    *         plugin tries to change its own state.
    * @see #stop()
    * @see #stop()
    * @see #start()
    * @see #start()
@@ -532,7 +532,7 @@ public:
    * The following steps are required to uninstall a plugin:
    * The following steps are required to uninstall a plugin:
    * <ol>
    * <ol>
    * <li>If this plugin's state is <code>UNINSTALLED</code> then an
    * <li>If this plugin's state is <code>UNINSTALLED</code> then an
-   * <code>std::logic_error</code> is thrown.
+   * <code>ctkIllegalStateException</code> is thrown.
    *
    *
    * <li>If this plugin's state is <code>ACTIVE</code>, <code>STARTING</code>
    * <li>If this plugin's state is <code>ACTIVE</code>, <code>STARTING</code>
    * or <code>STOPPING</code>, this plugin is stopped as described in the
    * or <code>STOPPING</code>, this plugin is stopped as described in the

+ 10 - 10
Libs/PluginFramework/ctkPluginContext.h

@@ -85,7 +85,7 @@ class ctkPluginContextPrivate;
  * its context plugin; that is, during the period from when the context plugin
  * its context plugin; that is, during the period from when the context plugin
  * is in the <code>STARTING</code>, <code>STOPPING</code>, and
  * is in the <code>STARTING</code>, <code>STOPPING</code>, and
  * <code>ACTIVE</code> plugin states. If the <code>ctkPluginContext</code>
  * <code>ACTIVE</code> plugin states. If the <code>ctkPluginContext</code>
- * object is used subsequently, a <code>std::logic_error</code> must be
+ * object is used subsequently, a <code>ctkIllegalStateException</code> must be
  * thrown. The <code>ctkPluginContext</code> object must never be reused after
  * thrown. The <code>ctkPluginContext</code> object must never be reused after
  * its context plugin is stopped.
  * its context plugin is stopped.
  *
  *
@@ -167,7 +167,7 @@ public:
    * The following steps are required to register a service:
    * The following steps are required to register a service:
    * <ol>
    * <ol>
    * <li>If <code>service</code> is not a <code>ctkServiceFactory</code>, an
    * <li>If <code>service</code> is not a <code>ctkServiceFactory</code>, an
-   * <code>std::invalid_argument</code> is thrown if <code>service</code>
+   * <code>ctkInvalidArgumentException</code> is thrown if <code>service</code>
    * is not an instance of all the specified class names.
    * is not an instance of all the specified class names.
    * <li>The Framework adds the following service properties to the service
    * <li>The Framework adds the following service properties to the service
    * properties from the specified <code>ctkDictionary</code> (which may be
    * properties from the specified <code>ctkDictionary</code> (which may be
@@ -201,7 +201,7 @@ public:
    * @return A <code>ctkServiceRegistration</code> object for use by the plugin
    * @return A <code>ctkServiceRegistration</code> object for use by the plugin
    *         registering the service to update the service's properties or to
    *         registering the service to update the service's properties or to
    *         unregister the service.
    *         unregister the service.
-   * @throws std::invalid_argument If one of the following is true:
+   * @throws ctkInvalidArgumentException If one of the following is true:
    *         <ul>
    *         <ul>
    *         <li><code>service</code> is <code>0</code>. <li><code>service
    *         <li><code>service</code> is <code>0</code>. <li><code>service
    *         </code> is not a <code>ctkServiceFactory</code> object and is not an
    *         </code> is not a <code>ctkServiceFactory</code> object and is not an
@@ -268,7 +268,7 @@ public:
    * of the filter syntax. If the specified <code>filter</code> is
    * of the filter syntax. If the specified <code>filter</code> is
    * empty, all registered services are considered to match the
    * empty, all registered services are considered to match the
    * filter. If the specified <code>filter</code> expression cannot be parsed,
    * filter. If the specified <code>filter</code> expression cannot be parsed,
-   * an <code>std::invalid_argument</code> will be thrown with a human readable
+   * an <code>ctkInvalidArgumentException</code> will be thrown with a human readable
    * message where the filter became unparsable.
    * message where the filter became unparsable.
    *
    *
    * <p>
    * <p>
@@ -291,7 +291,7 @@ public:
    * @return A list of <code>ctkServiceReference</code> objects or
    * @return A list of <code>ctkServiceReference</code> objects or
    *         an empty list if no services are registered which satisfy the
    *         an empty list if no services are registered which satisfy the
    *         search.
    *         search.
-   * @throws std::invalid_argument If the specified <code>filter</code>
+   * @throws ctkInvalidArgumentException If the specified <code>filter</code>
    *         contains an invalid filter expression that cannot be parsed.
    *         contains an invalid filter expression that cannot be parsed.
    * @throws ctkIllegalStateException If this ctkPluginContext is no longer valid.
    * @throws ctkIllegalStateException If this ctkPluginContext is no longer valid.
    */
    */
@@ -312,7 +312,7 @@ public:
    * @return A list of <code>ctkServiceReference</code> objects or
    * @return A list of <code>ctkServiceReference</code> objects or
    *         an empty list if no services are registered which satisfy the
    *         an empty list if no services are registered which satisfy the
    *         search.
    *         search.
-   * @throws std::invalid_argument If the specified <code>filter</code>
+   * @throws ctkInvalidArgumentException If the specified <code>filter</code>
    *         contains an invalid filter expression that cannot be parsed.
    *         contains an invalid filter expression that cannot be parsed.
    * @throws ctkIllegalStateException If this ctkPluginContext is no longer valid.
    * @throws ctkIllegalStateException If this ctkPluginContext is no longer valid.
    * @see getServiceReferences(const QString&, const QString&)
    * @see getServiceReferences(const QString&, const QString&)
@@ -431,7 +431,7 @@ public:
    *         an exception.
    *         an exception.
    * @throws ctkIllegalStateException If this ctkPluginContext is no
    * @throws ctkIllegalStateException If this ctkPluginContext is no
    *         longer valid.
    *         longer valid.
-   * @throws std::invalid_argument If the specified
+   * @throws ctkInvalidArgumentException If the specified
    *         <code>ctkServiceReference</code> was not created by the same
    *         <code>ctkServiceReference</code> was not created by the same
    *         framework instance as this <code>ctkPluginContext</code> or
    *         framework instance as this <code>ctkPluginContext</code> or
    *         if it is invalid (default constructed).
    *         if it is invalid (default constructed).
@@ -455,7 +455,7 @@ public:
    *         an exception or the service could not be casted to the desired type.
    *         an exception or the service could not be casted to the desired type.
    * @throws ctkIllegalStateException If this ctkPluginContext is no
    * @throws ctkIllegalStateException If this ctkPluginContext is no
    *         longer valid.
    *         longer valid.
-   * @throws std::invalid_argument If the specified
+   * @throws ctkInvalidArgumentException If the specified
    *         <code>ctkServiceReference</code> was not created by the same
    *         <code>ctkServiceReference</code> was not created by the same
    *         framework instance as this <code>ctkPluginContext</code> or
    *         framework instance as this <code>ctkPluginContext</code> or
    *         if it is invalid (default constructed).
    *         if it is invalid (default constructed).
@@ -502,7 +502,7 @@ public:
    *         <code>true</code> otherwise.
    *         <code>true</code> otherwise.
    * @throws ctkIllegalStateException If this ctkPluginContext is no
    * @throws ctkIllegalStateException If this ctkPluginContext is no
    *         longer valid.
    *         longer valid.
-   * @throws std::invalid_argument If the specified
+   * @throws ctkInvalidArgumentException If the specified
    *         <code>ctkServiceReference</code> was not created by the same
    *         <code>ctkServiceReference</code> was not created by the same
    *         framework instance as this <code>ctkPluginContext</code>.
    *         framework instance as this <code>ctkPluginContext</code>.
    * @see #getService
    * @see #getService
@@ -673,7 +673,7 @@ public:
    * @param receiver The object to connect to.
    * @param receiver The object to connect to.
    * @param slot The name of the slot to be connected.
    * @param slot The name of the slot to be connected.
    * @param filter The filter criteria.
    * @param filter The filter criteria.
-   * @throws std::invalid_argument If <code>filter</code> contains an
+   * @throws ctkInvalidArgumentException If <code>filter</code> contains an
    *         invalid filter string that cannot be parsed.
    *         invalid filter string that cannot be parsed.
    * @throws ctkIllegalStateException If this ctkPluginContext is no
    * @throws ctkIllegalStateException If this ctkPluginContext is no
    *         longer valid.
    *         longer valid.

+ 9 - 9
Libs/PluginFramework/ctkPluginFrameworkUtil.cpp

@@ -25,7 +25,7 @@
 #include <QString>
 #include <QString>
 #include <QCoreApplication>
 #include <QCoreApplication>
 
 
-#include <stdexcept>
+#include <ctkException.h>
 
 
 
 
 /**
 /**
@@ -241,7 +241,7 @@ QList<QMap<QString, QStringList> > ctkPluginFrameworkUtil::parseEntries(const QS
         QString what = QString("Definition, ") + a + ", expected key at: " + at.getRest()
         QString what = QString("Definition, ") + a + ", expected key at: " + at.getRest()
                        + ". Key values are terminated by a ';' or a ',' and may not "
                        + ". Key values are terminated by a ';' or a ',' and may not "
                        + "contain ':', '='.";
                        + "contain ':', '='.";
-        throw std::invalid_argument(what.toStdString());
+        throw ctkInvalidArgumentException(what);
       }
       }
       if (!single)
       if (!single)
       {
       {
@@ -261,13 +261,13 @@ QList<QMap<QString, QStringList> > ctkPluginFrameworkUtil::parseEntries(const QS
           QString what = QString("Definition, ") + a + ", duplicate " +
           QString what = QString("Definition, ") + a + ", duplicate " +
                          (is_directive ? "directive" : "attribute") +
                          (is_directive ? "directive" : "attribute") +
                          ": " + param;
                          ": " + param;
-          throw std::invalid_argument(what.toStdString());
+          throw ctkInvalidArgumentException(what);
         }
         }
         QString value = at.getValue();
         QString value = at.getValue();
         if (value.isNull())
         if (value.isNull())
         {
         {
           QString what = QString("Definition, ") + a + ", expected value at: " + at.getRest();
           QString what = QString("Definition, ") + a + ", expected value at: " + at.getRest();
-          throw std::invalid_argument(what.toStdString());
+          throw ctkInvalidArgumentException(what);
         }
         }
         if (is_directive)
         if (is_directive)
         {
         {
@@ -297,13 +297,13 @@ QList<QMap<QString, QStringList> > ctkPluginFrameworkUtil::parseEntries(const QS
       else
       else
       {
       {
         QString what = QString("Definition, ") + a + ", expected end of entry at: " + at.getRest();
         QString what = QString("Definition, ") + a + ", expected end of entry at: " + at.getRest();
-        throw std::invalid_argument(what.toStdString());
+        throw ctkInvalidArgumentException(what);
       }
       }
 
 
       if (single_entry && !at.getEnd())
       if (single_entry && !at.getEnd())
       {
       {
         QString what = QString("Definition, ") + a + ", expected end of single entry at: " + at.getRest();
         QString what = QString("Definition, ") + a + ", expected end of single entry at: " + at.getRest();
-        throw std::invalid_argument(what.toStdString());
+        throw ctkInvalidArgumentException(what);
       }
       }
 
 
       params.insert("$directives", directives); // $ is not allowed in
       params.insert("$directives", directives); // $ is not allowed in
@@ -348,7 +348,7 @@ QDir ctkPluginFrameworkUtil::getFileStorage(ctkPluginFrameworkContext* ctx,
   QString fwdir = getFrameworkDir(ctx);
   QString fwdir = getFrameworkDir(ctx);
   if (fwdir.isEmpty())
   if (fwdir.isEmpty())
   {
   {
-    throw std::runtime_error("The framework storge directory is empty");
+    throw ctkRuntimeException("The framework storge directory is empty");
   }
   }
   QDir dir(fwdir + "/" + name);
   QDir dir(fwdir + "/" + name);
   if (dir.exists())
   if (dir.exists())
@@ -357,7 +357,7 @@ QDir ctkPluginFrameworkUtil::getFileStorage(ctkPluginFrameworkContext* ctx,
     {
     {
       QString msg("Not a directory: ");
       QString msg("Not a directory: ");
       msg.append(dir.absolutePath());
       msg.append(dir.absolutePath());
-      throw std::runtime_error(msg.toStdString());
+      throw ctkRuntimeException(msg);
     }
     }
   }
   }
   else
   else
@@ -366,7 +366,7 @@ QDir ctkPluginFrameworkUtil::getFileStorage(ctkPluginFrameworkContext* ctx,
     {
     {
       QString msg("Cannot create directory: ");
       QString msg("Cannot create directory: ");
       msg.append(dir.absolutePath());
       msg.append(dir.absolutePath());
-      throw std::runtime_error(msg.toStdString());
+      throw ctkRuntimeException(msg);
     }
     }
   }
   }
   return dir;
   return dir;

+ 2 - 2
Libs/PluginFramework/ctkPluginFrameworkUtil_p.h

@@ -49,7 +49,7 @@ public:
    * @param unique Only allow unique parameters for each ENTRY.
    * @param unique Only allow unique parameters for each ENTRY.
    * @param single_entry If true, only allow one ENTRY is allowed.
    * @param single_entry If true, only allow one ENTRY is allowed.
    * @return QMap<QString, QString> mapping attributes to values.
    * @return QMap<QString, QString> mapping attributes to values.
-   * @exception std::invalid_argument If syntax error in input string.
+   * @exception ctkInvalidArgumentException If syntax error in input string.
    */
    */
   static QList<QMap<QString, QStringList> > parseEntries(const QString& a, const QString& s,
   static QList<QMap<QString, QStringList> > parseEntries(const QString& a, const QString& s,
                                                          bool single, bool unique, bool single_entry);
                                                          bool single, bool unique, bool single_entry);
@@ -62,7 +62,7 @@ public:
    * @param name local directory name.
    * @param name local directory name.
    * @return A QDir object pointing to the directory. The directory is
    * @return A QDir object pointing to the directory. The directory is
    *         guaranteed to exist.
    *         guaranteed to exist.
-   * @throws std::runtime_error if there is no global framework storage
+   * @throws ctkRuntimeException if there is no global framework storage
    *         directory or if the directory could not be created.
    *         directory or if the directory could not be created.
    */
    */
   static QDir getFileStorage(ctkPluginFrameworkContext* ctx, const QString& name);
   static QDir getFileStorage(ctkPluginFrameworkContext* ctx, const QString& name);

+ 2 - 2
Libs/PluginFramework/ctkPluginManifest.cpp

@@ -25,7 +25,7 @@
 #include <QIODevice>
 #include <QIODevice>
 #include <QDebug>
 #include <QDebug>
 
 
-#include <stdexcept>
+#include <ctkException.h>
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
 ctkPluginManifest::ctkPluginManifest()
 ctkPluginManifest::ctkPluginManifest()
@@ -133,7 +133,7 @@ ctkPluginManifest::Attributes ctkPluginManifest::getAttributes(const QString& se
 {
 {
   if (!sections.contains(section))
   if (!sections.contains(section))
   {
   {
-    throw std::invalid_argument(std::string("Manifest section invalid: ") + qPrintable(section));
+    throw ctkInvalidArgumentException(QString("Manifest section invalid: ") + section);
   }
   }
 
 
   return sections[section];
   return sections[section];

+ 1 - 1
Libs/PluginFramework/ctkPluginPrivate_p.h

@@ -90,7 +90,7 @@ public:
    * @param fw ctkPluginFrameworkContext for this plugin.
    * @param fw ctkPluginFrameworkContext for this plugin.
    * @param ba ctkPlugin archive representing the shared library and cached data
    * @param ba ctkPlugin archive representing the shared library and cached data
    * @param checkContext AccessConrolContext to do permission checks against.
    * @param checkContext AccessConrolContext to do permission checks against.
-   * @exception std::invalid_argument Faulty manifest for bundle
+   * @exception ctkInvalidArgumentException Faulty manifest for bundle
    */
    */
   ctkPluginPrivate(QWeakPointer<ctkPlugin> qq, ctkPluginFrameworkContext* fw,
   ctkPluginPrivate(QWeakPointer<ctkPlugin> qq, ctkPluginFrameworkContext* fw,
                    QSharedPointer<ctkPluginArchive> pa /*, Object checkContext*/);
                    QSharedPointer<ctkPluginArchive> pa /*, Object checkContext*/);

+ 1 - 1
Libs/PluginFramework/ctkServiceReference.h

@@ -185,7 +185,7 @@ public:
    * @return Returns a false or true if this
    * @return Returns a false or true if this
    *         <code>ctkServiceReference</code> is less than or greater
    *         <code>ctkServiceReference</code> is less than or greater
    *         than the specified <code>ctkServiceReference</code>.
    *         than the specified <code>ctkServiceReference</code>.
-   * @throws std::invalid_argument If the specified
+   * @throws ctkInvalidArgumentException If the specified
    *         <code>ctkServiceReference</code> was not created by the same
    *         <code>ctkServiceReference</code> was not created by the same
    *         framework instance as this <code>ctkServiceReference</code>.
    *         framework instance as this <code>ctkServiceReference</code>.
    */
    */

+ 1 - 1
Libs/PluginFramework/ctkServiceRegistration.h

@@ -108,7 +108,7 @@ public:
    *
    *
    * @throws ctkIllegalStateException If this <code>ctkServiceRegistration</code>
    * @throws ctkIllegalStateException If this <code>ctkServiceRegistration</code>
    *         object has already been unregistered or if it is invalid.
    *         object has already been unregistered or if it is invalid.
-   * @throws std::invalid_argument If <code>properties</code> contains
+   * @throws ctkInvalidArgumentException If <code>properties</code> contains
    *         case variants of the same key name.
    *         case variants of the same key name.
    */
    */
   void setProperties(const ctkDictionary& properties);
   void setProperties(const ctkDictionary& properties);

+ 3 - 4
Libs/PluginFramework/ctkServiceTracker.tpp

@@ -116,10 +116,9 @@ void ctkServiceTracker<S,T>::open()
         /* set tracked with the initial references */
         /* set tracked with the initial references */
         t->setInitial(references);
         t->setInitial(references);
       }
       }
-      catch (const std::invalid_argument& e)
+      catch (const ctkInvalidArgumentException& e)
       {
       {
-        throw std::runtime_error(std::string("unexpected std::invalid_argument exception: ")
-            + e.what());
+        throw ctkRuntimeException(QString("unexpected ctkInvalidArgumentException exception: %1").arg(e.what()));
       }
       }
     }
     }
     d->trackedService = t;
     d->trackedService = t;
@@ -153,7 +152,7 @@ void ctkServiceTracker<S,T>::close()
     {
     {
       d->context->disconnectServiceListener(outgoing.data(), "serviceChanged");
       d->context->disconnectServiceListener(outgoing.data(), "serviceChanged");
     }
     }
-    catch (const std::logic_error& /*e*/)
+    catch (const ctkIllegalStateException& /*e*/)
     {
     {
       /* In case the context was stopped. */
       /* In case the context was stopped. */
     }
     }

+ 1 - 1
Libs/PluginFramework/ctkServiceTrackerPrivate.h

@@ -63,7 +63,7 @@ public:
    * @param filterString The filter criteria or <code>null</code> for all
    * @param filterString The filter criteria or <code>null</code> for all
    *        services.
    *        services.
    * @return The list of initial <code>ctkServiceReference</code>s.
    * @return The list of initial <code>ctkServiceReference</code>s.
-   * @throws std::invalid_argument If the specified filterString has an
+   * @throws ctkInvalidArgumentException If the specified filterString has an
    *         invalid syntax.
    *         invalid syntax.
    */
    */
   QList<ctkServiceReference> getInitialReferences(const QString& className,
   QList<ctkServiceReference> getInitialReferences(const QString& className,

+ 6 - 8
Libs/PluginFramework/ctkServiceTrackerPrivate.tpp

@@ -26,8 +26,6 @@
 #include "ctkPluginConstants.h"
 #include "ctkPluginConstants.h"
 #include "ctkLDAPSearchFilter.h"
 #include "ctkLDAPSearchFilter.h"
 
 
-#include <stdexcept>
-
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
 template<class S, class T>
 template<class S, class T>
 const bool ctkServiceTrackerPrivate<S,T>::DEBUG = false;
 const bool ctkServiceTrackerPrivate<S,T>::DEBUG = false;
@@ -48,13 +46,13 @@ ctkServiceTrackerPrivate<S,T>::ctkServiceTrackerPrivate(
   {
   {
     this->filter = ctkLDAPSearchFilter(listenerFilter);
     this->filter = ctkLDAPSearchFilter(listenerFilter);
   }
   }
-  catch (const std::invalid_argument& e)
+  catch (const ctkInvalidArgumentException& e)
   {
   {
     /*
     /*
      * we could only get this exception if the ServiceReference was
      * we could only get this exception if the ServiceReference was
      * invalid
      * invalid
      */
      */
-    std::invalid_argument ia(std::string("unexpected std::invalid_argument exception: ") + e.what());
+    ctkInvalidArgumentException ia(QString("unexpected ctkInvalidArgumentException exception: %1").arg(e.what()));
     throw ia;
     throw ia;
   }
   }
 }
 }
@@ -76,14 +74,14 @@ ctkServiceTrackerPrivate<S,T>::ctkServiceTrackerPrivate(
   {
   {
     this->filter = ctkLDAPSearchFilter(listenerFilter);
     this->filter = ctkLDAPSearchFilter(listenerFilter);
   }
   }
-  catch (const std::invalid_argument& e)
+  catch (const ctkInvalidArgumentException& e)
   {
   {
     /*
     /*
      * we could only get this exception if the clazz argument was
      * we could only get this exception if the clazz argument was
      * malformed
      * malformed
      */
      */
-    std::invalid_argument ia(
-        std::string("unexpected std::invalid_argument exception: ") + e.what());
+    ctkInvalidArgumentException ia(
+          QString("unexpected ctkInvalidArgumentException exception: %1").arg(e.what()));
     throw ia;
     throw ia;
   }
   }
 }
 }
@@ -101,7 +99,7 @@ ctkServiceTrackerPrivate<S,T>::ctkServiceTrackerPrivate(
   this->customizer = customizer ? customizer : q_func();
   this->customizer = customizer ? customizer : q_func();
   if (context == 0)
   if (context == 0)
   {
   {
-    throw std::invalid_argument("The plugin context cannot be null.");
+    throw ctkInvalidArgumentException("The plugin context cannot be null.");
   }
   }
 }
 }
 
 

+ 1 - 1
Libs/PluginFramework/ctkServices_p.h

@@ -87,7 +87,7 @@ public:
    * @param service The service object.
    * @param service The service object.
    * @param properties The properties for this service.
    * @param properties The properties for this service.
    * @return A ctkServiceRegistration object.
    * @return A ctkServiceRegistration object.
-   * @exception std::invalid_argument If one of the following is true:
+   * @exception ctkInvalidArgumentException If one of the following is true:
    * <ul>
    * <ul>
    * <li>The service object is 0.</li>
    * <li>The service object is 0.</li>
    * <li>The service parameter is not a ctkServiceFactory or an
    * <li>The service parameter is not a ctkServiceFactory or an

+ 2 - 2
Libs/PluginFramework/ctkVersionRange.cpp

@@ -21,7 +21,7 @@
 
 
 #include "ctkVersionRange_p.h"
 #include "ctkVersionRange_p.h"
 
 
-#include <stdexcept>
+#include <ctkException.h>
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
 ctkVersionRange ctkVersionRange::defaultVersionRange()
 ctkVersionRange ctkVersionRange::defaultVersionRange()
@@ -50,7 +50,7 @@ ctkVersionRange::ctkVersionRange(const QString& vr)
     }
     }
     else
     else
     {
     {
-      throw std::invalid_argument("Illegal version range: " + vr.toStdString());
+      throw ctkInvalidArgumentException("Illegal version range: " + vr);
     }
     }
   }
   }
   else
   else

+ 8 - 8
Libs/PluginFramework/service/cm/ctkConfiguration.h

@@ -78,7 +78,7 @@ struct CTK_PLUGINFW_EXPORT ctkConfiguration
    * Get the PID for this <code>ctkConfiguration</code> object.
    * Get the PID for this <code>ctkConfiguration</code> object.
    *
    *
    * @return the PID for this <code>ctkConfiguration</code> object.
    * @return the PID for this <code>ctkConfiguration</code> object.
-   * @throws std::logic_error if this configuration has been deleted
+   * @throws ctkIllegalStateException if this configuration has been deleted
    */
    */
   virtual QString getPid() const = 0;
   virtual QString getPid() const = 0;
 
 
@@ -126,10 +126,10 @@ struct CTK_PLUGINFW_EXPORT ctkConfiguration
    *
    *
    * @param properties the new set of properties for this configuration
    * @param properties the new set of properties for this configuration
    * @throws ctkIOException if update cannot be made persistent
    * @throws ctkIOException if update cannot be made persistent
-   * @throws std::invalid_argument if the <code>ctkDictionary</code> object
+   * @throws ctkInvalidArgumentException if the <code>ctkDictionary</code> object
    *         contains invalid configuration types or contains case variants of
    *         contains invalid configuration types or contains case variants of
    *         the same key name.
    *         the same key name.
-   * @throws std::logic_error if this configuration has been deleted
+   * @throws ctkIllegalStateException if this configuration has been deleted
    */
    */
   virtual void update(const ctkDictionary& properties) = 0;
   virtual void update(const ctkDictionary& properties) = 0;
 
 
@@ -149,7 +149,7 @@ struct CTK_PLUGINFW_EXPORT ctkConfiguration
    * <code>ctkConfigurationEvent::CM_DELETED</code> event.
    * <code>ctkConfigurationEvent::CM_DELETED</code> event.
    *
    *
    * @throws ctkIOException If delete fails
    * @throws ctkIOException If delete fails
-   * @throws std::logic_error if this configuration has been deleted
+   * @throws ctkIllegalStateException if this configuration has been deleted
    */
    */
   virtual void remove() = 0;
   virtual void remove() = 0;
 
 
@@ -158,7 +158,7 @@ struct CTK_PLUGINFW_EXPORT ctkConfiguration
    * Service Factory, else return a null QString.
    * Service Factory, else return a null QString.
    *
    *
    * @return factory PID or <code>null</code>
    * @return factory PID or <code>null</code>
-   * @throws std::logic_error if this configuration has been deleted
+   * @throws ctkIllegalStateException if this configuration has been deleted
    */
    */
   virtual QString getFactoryPid() const = 0;
   virtual QString getFactoryPid() const = 0;
 
 
@@ -178,7 +178,7 @@ struct CTK_PLUGINFW_EXPORT ctkConfiguration
    * @see ctkConfigurationPlugin
    * @see ctkConfigurationPlugin
    * @throws ctkIOException if update cannot access the properties in persistent
    * @throws ctkIOException if update cannot access the properties in persistent
    *         storage
    *         storage
-   * @throws std::logic_error if this configuration has been deleted
+   * @throws ctkIllegalStateException if this configuration has been deleted
    */
    */
   virtual void update() = 0;
   virtual void update() = 0;
 
 
@@ -194,7 +194,7 @@ struct CTK_PLUGINFW_EXPORT ctkConfiguration
    * plugin location will be set persistently.
    * plugin location will be set persistently.
    *
    *
    * @param pluginLocation a plugin location or <code>null</code>.
    * @param pluginLocation a plugin location or <code>null</code>.
-   * @throws std::logic_error If this configuration has been deleted.
+   * @throws ctkIllegalStateException If this configuration has been deleted.
    * @throws ctkSecurityException If the caller does not have
    * @throws ctkSecurityException If the caller does not have
    *         <code>ctkConfigurationPermission[*,CONFIGURE]</code>.
    *         <code>ctkConfigurationPermission[*,CONFIGURE]</code>.
    */
    */
@@ -208,7 +208,7 @@ struct CTK_PLUGINFW_EXPORT ctkConfiguration
    *
    *
    * @return location to which this configuration is bound, or
    * @return location to which this configuration is bound, or
    *         <code>null</code>.
    *         <code>null</code>.
-   * @throws std::logic_error If this <code>Configuration</code> object
+   * @throws ctkIllegalStateException If this <code>Configuration</code> object
    *         has been deleted.
    *         has been deleted.
    * @throws ctkSecurityException If the caller does not have
    * @throws ctkSecurityException If the caller does not have
    *         <code>ctkConfigurationPermission[*,CONFIGURE]</code>.
    *         <code>ctkConfigurationPermission[*,CONFIGURE]</code>.

+ 1 - 1
Libs/PluginFramework/service/cm/ctkConfigurationAdmin.h

@@ -253,7 +253,7 @@ struct CTK_PLUGINFW_EXPORT ctkConfigurationAdmin
    * @return All matching <code>ctkConfiguration</code> objects, or
    * @return All matching <code>ctkConfiguration</code> objects, or
    *         an empty list if there aren't any.
    *         an empty list if there aren't any.
    * @throws ctkIOException if access to persistent storage fails
    * @throws ctkIOException if access to persistent storage fails
-   * @throws std::invalid_argument if the filter string is invalid
+   * @throws ctkInvalidArgumentException if the filter string is invalid
    */
    */
   virtual QList<ctkConfigurationPtr> listConfigurations(const QString& filter = QString()) = 0;
   virtual QList<ctkConfigurationPtr> listConfigurations(const QString& filter = QString()) = 0;
 };
 };

+ 2 - 2
Libs/PluginFramework/service/cm/ctkConfigurationEvent.cpp

@@ -22,7 +22,7 @@
 
 
 #include "ctkConfigurationEvent.h"
 #include "ctkConfigurationEvent.h"
 
 
-#include <stdexcept>
+#include <ctkException.h>
 
 
 class ctkConfigurationEventData : public QSharedData
 class ctkConfigurationEventData : public QSharedData
 {
 {
@@ -92,7 +92,7 @@ ctkConfigurationEvent::ctkConfigurationEvent(const ctkServiceReference& referenc
 {
 {
   if (pid.isNull())
   if (pid.isNull())
   {
   {
-    throw std::invalid_argument("pid must not be null");
+    throw ctkInvalidArgumentException("pid must not be null");
   }
   }
 }
 }
 
 

+ 4 - 4
Libs/PluginFramework/service/event/ctkEvent.cpp

@@ -23,7 +23,7 @@
 
 
 #include "ctkEventConstants.h"
 #include "ctkEventConstants.h"
 
 
-#include <stdexcept>
+#include <ctkException.h>
 
 
 class ctkEventData : public QSharedData
 class ctkEventData : public QSharedData
 {
 {
@@ -41,7 +41,7 @@ public:
   {
   {
     if (topic.isEmpty())
     if (topic.isEmpty())
     {
     {
-      throw std::invalid_argument("empty topic");
+      throw ctkInvalidArgumentException("empty topic");
     }
     }
 
 
     // Can't start or end with a '/' but anywhere else is okay
     // Can't start or end with a '/' but anywhere else is okay
@@ -49,7 +49,7 @@ public:
     if (topic.startsWith("/") || topic.endsWith("/") ||
     if (topic.startsWith("/") || topic.endsWith("/") ||
         topic.contains("//"))
         topic.contains("//"))
     {
     {
-      throw std::invalid_argument(QString("invalid topic: %1").arg(topic).toStdString());
+      throw ctkInvalidArgumentException(QString("invalid topic: %1").arg(topic));
     }
     }
 
 
     QString::const_iterator topicEnd = topic.end();
     QString::const_iterator topicEnd = topic.end();
@@ -62,7 +62,7 @@ public:
       if ((a <= c) && (c <= z)) continue;
       if ((a <= c) && (c <= z)) continue;
       if ((zero <= c) && (c <= nine)) continue;
       if ((zero <= c) && (c <= nine)) continue;
       if ((c == underscore) || (c == dash) || (c == slash)) continue;
       if ((c == underscore) || (c == dash) || (c == slash)) continue;
-      throw std::invalid_argument(QString("invalid topic: %1").arg(topic).toStdString());
+      throw ctkInvalidArgumentException(QString("invalid topic: %1").arg(topic));
     }
     }
   }
   }
 
 

+ 1 - 1
Libs/PluginFramework/service/event/ctkEvent.h

@@ -69,7 +69,7 @@ public:
    *
    *
    * @param topic The topic of the event.
    * @param topic The topic of the event.
    * @param properties The event's properties (may be empty).
    * @param properties The event's properties (may be empty).
-   * @throws std::invalid_argument If topic is not a valid topic name.
+   * @throws ctkInvalidArgumentException If topic is not a valid topic name.
    */
    */
   ctkEvent(const QString& topic, const ctkDictionary& properties = ctkDictionary());
   ctkEvent(const QString& topic, const ctkDictionary& properties = ctkDictionary());
   ctkEvent(const ctkEvent& event);
   ctkEvent(const ctkEvent& event);

+ 1 - 1
Libs/PluginFramework/service/event/ctkEventAdmin.h

@@ -143,7 +143,7 @@ struct ctkEventAdmin
    *        handlers completed their tasks.
    *        handlers completed their tasks.
    * @return Returns an id which can be used to update the properties.
    * @return Returns an id which can be used to update the properties.
    *
    *
-   * @throws std::invalid_argument If <code>subscriber</code> or <code>member</code> is 0
+   * @throws ctkInvalidArgumentException If <code>subscriber</code> or <code>member</code> is 0
    *         or <code>type</code> is invalid.
    *         or <code>type</code> is invalid.
    *
    *
    * @see unsubscribeSlot(qlonglong)
    * @see unsubscribeSlot(qlonglong)

+ 1 - 1
Plugins/org.commontk.configadmin/ctkConfigurationAdminImpl.cpp

@@ -96,6 +96,6 @@ void ctkConfigurationAdminImpl::checkPID(const QString& pid)
 {
 {
   if (pid.isEmpty())
   if (pid.isEmpty())
   {
   {
-    throw std::invalid_argument("PID cannot be empty");
+    throw ctkInvalidArgumentException("PID cannot be empty");
   }
   }
 }
 }

+ 3 - 3
Plugins/org.commontk.configadmin/ctkConfigurationImpl.cpp

@@ -146,7 +146,7 @@ void ctkConfigurationImpl::unlock() const
   QThread* current = QThread::currentThread();
   QThread* current = QThread::currentThread();
   if (lockHolder != current)
   if (lockHolder != current)
   {
   {
-    throw std::logic_error("Thread not lock owner");
+    throw ctkIllegalStateException("Thread not lock owner");
   }
   }
 
 
   --lockedCount;
   --lockedCount;
@@ -163,7 +163,7 @@ void ctkConfigurationImpl::checkLocked() const
   QThread* current = QThread::currentThread();
   QThread* current = QThread::currentThread();
   if (lockHolder != current)
   if (lockHolder != current)
   {
   {
-    throw std::logic_error("Thread not lock owner");
+    throw ctkIllegalStateException("Thread not lock owner");
   }
   }
 }
 }
 
 
@@ -258,7 +258,7 @@ bool ctkConfigurationImpl::isDeleted() const
 void ctkConfigurationImpl::checkDeleted() const
 void ctkConfigurationImpl::checkDeleted() const
 {
 {
   if (deleted)
   if (deleted)
-    throw std::logic_error("deleted");
+    throw ctkIllegalStateException("deleted");
 }
 }
 
 
 void ctkConfigurationImpl::updateDictionary(const ctkDictionary& properties)
 void ctkConfigurationImpl::updateDictionary(const ctkDictionary& properties)

+ 1 - 1
Plugins/org.commontk.dah.app/ctkDicomAbstractApp.cpp

@@ -142,7 +142,7 @@ bool ctkDicomAbstractApp::setState(ctkDicomAppHosting::State newState)
 ctkDicomHostInterface* ctkDicomAbstractApp::getHostInterface() const
 ctkDicomHostInterface* ctkDicomAbstractApp::getHostInterface() const
 {
 {
   ctkDicomHostInterface* host = d_ptr->HostTracker.getService();
   ctkDicomHostInterface* host = d_ptr->HostTracker.getService();
-  if (!host) throw std::runtime_error("DICOM Host Interface not available");
+  if (!host) throw ctkRuntimeException("DICOM Host Interface not available");
   return host;
   return host;
 }
 }
 
 

+ 2 - 2
Plugins/org.commontk.dah.app/ctkDicomAppPlugin.cpp

@@ -58,13 +58,13 @@ void ctkDicomAppPlugin::start(ctkPluginContext* context)
   QUrl appURL(context->getProperty("dah.appURL").toString());
   QUrl appURL(context->getProperty("dah.appURL").toString());
   if (!appURL.isValid())
   if (!appURL.isValid())
     {
     {
-    throw std::runtime_error("The plugin framework does not contain a valid \"dah.appURL\" property");
+    throw ctkRuntimeException("The plugin framework does not contain a valid \"dah.appURL\" property");
     }
     }
 
 
   QUrl hostURL(context->getProperty("dah.hostURL").toString());
   QUrl hostURL(context->getProperty("dah.hostURL").toString());
   if (!hostURL.isValid())
   if (!hostURL.isValid())
     {
     {
-    throw std::runtime_error("The plugin framework does not contain a valid \"dah.hostURL\" property");
+    throw ctkRuntimeException("The plugin framework does not contain a valid \"dah.hostURL\" property");
     }
     }
 
 
   // start the application server
   // start the application server

+ 3 - 3
Plugins/org.commontk.dah.core/ctkDicomAppHostingTypesHelper.cpp

@@ -21,7 +21,7 @@
 
 
 #include "ctkDicomAppHostingTypesHelper.h"
 #include "ctkDicomAppHostingTypesHelper.h"
 
 
-#include <stdexcept>
+#include <ctkException.h>
 
 
 //----------------------------------------------------------------------------
 //----------------------------------------------------------------------------
 void DumpAll(const QtSoapType& type, int indent=0)
 void DumpAll(const QtSoapType& type, int indent=0)
@@ -96,7 +96,7 @@ ctkDicomAppHosting::State ctkDicomSoapState::fromString(const QString& string)
   if (string == "SUSPENDED") return ctkDicomAppHosting::SUSPENDED;
   if (string == "SUSPENDED") return ctkDicomAppHosting::SUSPENDED;
   if (string == "CANCELED") return ctkDicomAppHosting::CANCELED;
   if (string == "CANCELED") return ctkDicomAppHosting::CANCELED;
   if (string == "EXIT") return ctkDicomAppHosting::EXIT;
   if (string == "EXIT") return ctkDicomAppHosting::EXIT;
-  throw std::runtime_error((string + "Invalid STATE:").toStdString());
+  throw ctkRuntimeException(string + "Invalid STATE:");
   return ctkDicomAppHosting::EXIT;
   return ctkDicomAppHosting::EXIT;
 }
 }
 
 
@@ -118,7 +118,7 @@ QString ctkDicomSoapState::toStringValue(ctkDicomAppHosting::State state)
     case ctkDicomAppHosting::EXIT:
     case ctkDicomAppHosting::EXIT:
       return "EXIT";
       return "EXIT";
     default:
     default:
-      throw std::runtime_error( "Invalid value for state" );
+      throw ctkRuntimeException( "Invalid value for state" );
 
 
     }
     }
 }
 }

+ 1 - 1
Plugins/org.commontk.dah.core/ctkSimpleSoapClient.cpp

@@ -132,7 +132,7 @@ const QtSoapType & ctkSimpleSoapClient::submitSoapRequest(const QString& methodN
     CTK_SOAP_LOG_LOWLEVEL( << response.faultString().toString().toLatin1().constData() << endl );
     CTK_SOAP_LOG_LOWLEVEL( << response.faultString().toString().toLatin1().constData() << endl );
     CTK_SOAP_LOG_LOWLEVEL( << response.toXmlString() );
     CTK_SOAP_LOG_LOWLEVEL( << response.toXmlString() );
     return response.returnValue();
     return response.returnValue();
-    //    throw std::runtime_error("ctkSimpleSoapClient: server error (response.IsFault())");
+    //    throw ctkRuntimeException("ctkSimpleSoapClient: server error (response.IsFault())");
     }
     }
 
 
   CTK_SOAP_LOG_LOWLEVEL( << "Response: " << response.toXmlString() );
   CTK_SOAP_LOG_LOWLEVEL( << "Response: " << response.toXmlString() );

+ 1 - 1
Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppLogic.cpp

@@ -84,7 +84,7 @@ void ctkExampleDicomAppLogic::do_something()
     this->Button->move(rect.topLeft());
     this->Button->move(rect.topLeft());
     this->Button->resize(rect.size());
     this->Button->resize(rect.size());
     }
     }
-  catch (const std::runtime_error& e)
+  catch (const ctkRuntimeException& e)
     {
     {
     qCritical() << e.what();
     qCritical() << e.what();
     return;
     return;

+ 2 - 2
Plugins/org.commontk.eventadmin/adapter/ctkEAAbstractAdapter.cpp

@@ -22,14 +22,14 @@
 
 
 #include "ctkEAAbstractAdapter_p.h"
 #include "ctkEAAbstractAdapter_p.h"
 
 
-#include <stdexcept>
+#include <ctkException.h>
 
 
 ctkEAAbstractAdapter::ctkEAAbstractAdapter(ctkEventAdmin* admin)
 ctkEAAbstractAdapter::ctkEAAbstractAdapter(ctkEventAdmin* admin)
  : admin_(0)
  : admin_(0)
 {
 {
   if (admin == 0)
   if (admin == 0)
   {
   {
-    throw std::invalid_argument("EventAdmin must not be null");
+    throw ctkInvalidArgumentException("EventAdmin must not be null");
   }
   }
 
 
   admin_.testAndSetOrdered(0, admin);
   admin_.testAndSetOrdered(0, admin);

+ 1 - 1
Plugins/org.commontk.eventadmin/adapter/ctkEALogEventAdapter.cpp

@@ -130,7 +130,7 @@ void _LogListener::logged(ctkLogEntryPtr entry)
   {
   {
     adapter->getEventAdmin()->postEvent(ctkEvent(topic, properties));
     adapter->getEventAdmin()->postEvent(ctkEvent(topic, properties));
   }
   }
-  catch(const std::logic_error&)
+  catch(const ctkIllegalStateException&)
   {
   {
     // This is o.k. - indicates that we are stopped.
     // This is o.k. - indicates that we are stopped.
   }
   }

+ 1 - 1
Plugins/org.commontk.eventadmin/ctkEAConfiguration_p.h

@@ -166,7 +166,7 @@ public:
 
 
   /**
   /**
    * Called upon stopping the plugin. This will block until all pending events are
    * Called upon stopping the plugin. This will block until all pending events are
-   * delivered. An std::logic_error will be thrown on new events starting with
+   * delivered. An ctkIllegalStateException will be thrown on new events starting with
    * the begin of this method. However, it might take some time until we settle
    * the begin of this method. However, it might take some time until we settle
    * down which is somewhat cumbersome given that the spec asks for return in
    * down which is somewhat cumbersome given that the spec asks for return in
    * a timely manner.
    * a timely manner.

+ 1 - 1
Plugins/org.commontk.eventadmin/ctkEventAdminActivator_p.h

@@ -55,7 +55,7 @@ public:
 
 
   /**
   /**
    * Called upon stopping the plugin. This will block until all pending events are
    * Called upon stopping the plugin. This will block until all pending events are
-   * delivered. An std::logic_error will be thrown on new events starting with
+   * delivered. An ctkIllegalStateException will be thrown on new events starting with
    * the begin of this method. However, it might take some time until we settle
    * the begin of this method. However, it might take some time until we settle
    * down which is somewhat cumbersome given that the spec asks for return in
    * down which is somewhat cumbersome given that the spec asks for return in
    * a timely manner.
    * a timely manner.

+ 2 - 2
Plugins/org.commontk.eventadmin/ctkEventAdminImpl.tpp

@@ -105,7 +105,7 @@ void ctkEventAdminImpl<HandlerTasks,SyncDeliverTasks,AsyncDeliverTasks>::handleE
 {
 {
   if (0 < managers.size())
   if (0 < managers.size())
   {
   {
-    // This might throw an std::logic_error in case that we are stopped
+    // This might throw an ctkIllegalStateException in case that we are stopped
     // and the null object for managers was not fast enough established
     // and the null object for managers was not fast enough established
     // This is needed in the adapter/* classes due to them sending
     // This is needed in the adapter/* classes due to them sending
     // events whenever they receive an event from their source.
     // events whenever they receive an event from their source.
@@ -120,6 +120,6 @@ void ctkEventAdminImpl<HandlerTasks,SyncDeliverTasks,AsyncDeliverTasks>::checkNu
 {
 {
   if(0 == object)
   if(0 == object)
   {
   {
-    throw std::invalid_argument(qPrintable(name + " may not be null"));
+    throw ctkInvalidArgumentException(qPrintable(name + " may not be null"));
   }
   }
 }
 }

+ 8 - 8
Plugins/org.commontk.eventadmin/ctkEventAdminImpl_p.h

@@ -70,18 +70,18 @@ private:
   {
   {
     /**
     /**
      * This is a null object and this method will throw an
      * This is a null object and this method will throw an
-     * std::logic_error due to the plugin being stopped.
+     * ctkIllegalStateException due to the plugin being stopped.
      *
      *
      * @param event An event that is not used.
      * @param event An event that is not used.
      *
      *
      * @return This method does not return normally
      * @return This method does not return normally
      *
      *
-     * @throws std::logic_error - This is a null object and this method
-     *          will always throw an std::logic_error
+     * @throws ctkIllegalStateException - This is a null object and this method
+     *          will always throw an ctkIllegalStateException
      */
      */
     QList<ctkEAHandlerTask<HandlerTasks> > createHandlerTasks(const ctkEvent&)
     QList<ctkEAHandlerTask<HandlerTasks> > createHandlerTasks(const ctkEvent&)
     {
     {
-      throw std::logic_error("The EventAdmin is stopped");
+      throw ctkIllegalStateException("The EventAdmin is stopped");
     }
     }
   };
   };
 
 
@@ -112,7 +112,7 @@ public:
    *
    *
    * @param event The event to be posted by this service
    * @param event The event to be posted by this service
    *
    *
-   * @throws std::logic_error - In case we are stopped
+   * @throws ctkIllegalStateException - In case we are stopped
    *
    *
    * @see ctkEventAdmin#postEvent(const ctkEvent&)
    * @see ctkEventAdmin#postEvent(const ctkEvent&)
    */
    */
@@ -123,7 +123,7 @@ public:
    *
    *
    * @param event The event to be send by this service
    * @param event The event to be send by this service
    *
    *
-   * @throws std::logic_error - In case we are stopped
+   * @throws ctkIllegalStateException - In case we are stopped
    *
    *
    * @see ctkEventAdmin#sendEvent(const ctkEvent&)
    * @see ctkEventAdmin#sendEvent(const ctkEvent&)
    */
    */
@@ -135,7 +135,7 @@ public:
 
 
   /**
   /**
    * This method can be used to stop the delivery of events. The managers variable is
    * This method can be used to stop the delivery of events. The managers variable is
-   * replaced with a null object that throws an std::logic_error on a call
+   * replaced with a null object that throws an ctkIllegalStateException on a call
    * to <tt>createHandlerTasks()</tt>.
    * to <tt>createHandlerTasks()</tt>.
    */
    */
   void stop();
   void stop();
@@ -157,7 +157,7 @@ private:
                    DeliverTasks* manager);
                    DeliverTasks* manager);
 
 
   /**
   /**
-   * This is a utility method that will throw a <tt>std::invalid_argument</tt>
+   * This is a utility method that will throw a <tt>ctkInvalidArgumentException</tt>
    * in case that the given object is null. The message will be of the form
    * in case that the given object is null. The message will be of the form
    * "${name} + may not be null".
    * "${name} + may not be null".
    */
    */

+ 5 - 5
Plugins/org.commontk.eventadmin/ctkEventAdminService.cpp

@@ -63,7 +63,7 @@ void ctkEventAdminService::publishSignal(const QObject* publisher, const char* s
 {
 {
   if (topic.isEmpty())
   if (topic.isEmpty())
   {
   {
-    throw std::invalid_argument("topic must not be empty");
+    throw ctkInvalidArgumentException("topic must not be empty");
   }
   }
 
 
   // check if the signal was already registered under the given topic
   // check if the signal was already registered under the given topic
@@ -92,7 +92,7 @@ void ctkEventAdminService::publishSignal(const QObject* publisher, const char* s
   }
   }
   else
   else
   {
   {
-    throw std::invalid_argument("type must be either Qt::DirectConnection or Qt::QueuedConnection");
+    throw ctkInvalidArgumentException("type must be either Qt::DirectConnection or Qt::QueuedConnection");
   }
   }
 }
 }
 
 
@@ -153,12 +153,12 @@ void ctkEventAdminService::unpublishSignal(const QObject* publisher, const char*
 qlonglong ctkEventAdminService::subscribeSlot(const QObject* subscriber, const char* member,
 qlonglong ctkEventAdminService::subscribeSlot(const QObject* subscriber, const char* member,
                                               const ctkDictionary& properties, Qt::ConnectionType type)
                                               const ctkDictionary& properties, Qt::ConnectionType type)
 {
 {
-  if (subscriber == 0) throw std::invalid_argument("subscriber cannot be NULL");
-  if (member == 0) throw std::invalid_argument("slot cannot be NULL");
+  if (subscriber == 0) throw ctkInvalidArgumentException("subscriber cannot be NULL");
+  if (member == 0) throw ctkInvalidArgumentException("slot cannot be NULL");
   if (type != Qt::AutoConnection && type != Qt::DirectConnection &&
   if (type != Qt::AutoConnection && type != Qt::DirectConnection &&
       type != Qt::QueuedConnection && type != Qt::BlockingQueuedConnection)
       type != Qt::QueuedConnection && type != Qt::BlockingQueuedConnection)
   {
   {
-    throw std::invalid_argument("connection type invalid");
+    throw ctkInvalidArgumentException("connection type invalid");
   }
   }
 
 
   ctkEASlotHandler* handler = new ctkEASlotHandler();
   ctkEASlotHandler* handler = new ctkEASlotHandler();

+ 1 - 1
Plugins/org.commontk.eventadmin/ctkEventAdminService_p.h

@@ -104,7 +104,7 @@ public:
 
 
   /**
   /**
    * This method can be used to stop the delivery of events. The managers variable is
    * This method can be used to stop the delivery of events. The managers variable is
-   * replaced with a null object that throws an std::logic_error on a call
+   * replaced with a null object that throws an ctkIllegalStateException on a call
    * to <tt>createHandlerTasks()</tt>.
    * to <tt>createHandlerTasks()</tt>.
    */
    */
   void stop();
   void stop();

+ 4 - 4
Plugins/org.commontk.eventadmin/dispatch/ctkEAPooledExecutor.cpp

@@ -64,7 +64,7 @@ int ctkEAPooledExecutor::getMaximumPoolSize() const
 void ctkEAPooledExecutor::setMaximumPoolSize(int newMaximum)
 void ctkEAPooledExecutor::setMaximumPoolSize(int newMaximum)
 {
 {
   QMutexLocker lock(&mutex);
   QMutexLocker lock(&mutex);
-  if (newMaximum <= 0) throw std::invalid_argument("maximum must be > 0");
+  if (newMaximum <= 0) throw ctkInvalidArgumentException("maximum must be > 0");
   maximumPoolSize_ = newMaximum;
   maximumPoolSize_ = newMaximum;
 }
 }
 
 
@@ -77,7 +77,7 @@ int ctkEAPooledExecutor::getMinimumPoolSize() const
 void ctkEAPooledExecutor::setMinimumPoolSize(int newMinimum)
 void ctkEAPooledExecutor::setMinimumPoolSize(int newMinimum)
 {
 {
   QMutexLocker lock(&mutex);
   QMutexLocker lock(&mutex);
-  if (newMinimum < 0) throw std::invalid_argument("minimum must be >= 0");
+  if (newMinimum < 0) throw ctkInvalidArgumentException("minimum must be >= 0");
   minimumPoolSize_ = newMinimum;
   minimumPoolSize_ = newMinimum;
 }
 }
 
 
@@ -175,7 +175,7 @@ bool ctkEAPooledExecutor::awaitTerminationAfterShutdown(long maxWaitTime) const
   QMutexLocker lock(&mutex);
   QMutexLocker lock(&mutex);
   QMutexLocker shutdownLock(&shutdownMutex);
   QMutexLocker shutdownLock(&shutdownMutex);
   if (!shutdown_)
   if (!shutdown_)
-    throw std::logic_error("not in shutdown state");
+    throw ctkIllegalStateException("not in shutdown state");
   if (poolSize_ == 0)
   if (poolSize_ == 0)
     return true;
     return true;
   qint64 waitTime = static_cast<qint64>(maxWaitTime);
   qint64 waitTime = static_cast<qint64>(maxWaitTime);
@@ -199,7 +199,7 @@ void ctkEAPooledExecutor::awaitTerminationAfterShutdown() const
 {
 {
   QMutexLocker lock(&mutex);
   QMutexLocker lock(&mutex);
   if (!shutdown_)
   if (!shutdown_)
-    throw std::logic_error("not in shutdown state");
+    throw ctkIllegalStateException("not in shutdown state");
   while (poolSize_ > 0)
   while (poolSize_ > 0)
   {
   {
     lock.unlock();
     lock.unlock();

+ 4 - 4
Plugins/org.commontk.eventadmin/dispatch/ctkEAPooledExecutor_p.h

@@ -439,7 +439,7 @@ public:
    * size will not immediately kill existing threads, but they may
    * size will not immediately kill existing threads, but they may
    * later die when idle.
    * later die when idle.
    *
    *
-   * @throws std::invalid_argument if less or equal to zero.
+   * @throws ctkInvalidArgumentException if less or equal to zero.
    *         (It is not considered an error to set the maximum to be less than than
    *         (It is not considered an error to set the maximum to be less than than
    *         the minimum. However, in this case there are no guarantees
    *         the minimum. However, in this case there are no guarantees
    *         about behavior.)
    *         about behavior.)
@@ -457,7 +457,7 @@ public:
   /**
   /**
    * Set the minimum number of threads to use.
    * Set the minimum number of threads to use.
    *
    *
-   * @throws std::invalid_argument if less than zero. (It is not
+   * @throws ctkInvalidArgumentException if less than zero. (It is not
    *         considered an error to set the minimum to be greater than the
    *         considered an error to set the minimum to be greater than the
    *         maximum. However, in this case there are no guarantees about
    *         maximum. However, in this case there are no guarantees about
    *         behavior.)
    *         behavior.)
@@ -551,7 +551,7 @@ public:
    *
    *
    * @param maxWaitTime  the maximum time in milliseconds to wait
    * @param maxWaitTime  the maximum time in milliseconds to wait
    * @return true if the pool has terminated within the max wait period
    * @return true if the pool has terminated within the max wait period
-   * @throws std::logic_error if shutdown has not been requested
+   * @throws ctkIllegalStateException if shutdown has not been requested
    * @throws ctkEAInterruptedException if the current thread has been interrupted in the course of waiting
    * @throws ctkEAInterruptedException if the current thread has been interrupted in the course of waiting
    */
    */
   bool awaitTerminationAfterShutdown(long maxWaitTime) const;
   bool awaitTerminationAfterShutdown(long maxWaitTime) const;
@@ -561,7 +561,7 @@ public:
    * only be called <em>after</em> invoking shutdownNow or
    * only be called <em>after</em> invoking shutdownNow or
    * shutdownAfterProcessingCurrentlyQueuedTasks.
    * shutdownAfterProcessingCurrentlyQueuedTasks.
    *
    *
-   * @throws std::logic_error if shutdown has not been requested
+   * @throws ctkIllegalStateException if shutdown has not been requested
    * @throws ctkEAInterruptedException if the current thread has been interrupted in the course of waiting
    * @throws ctkEAInterruptedException if the current thread has been interrupted in the course of waiting
    */
    */
   void awaitTerminationAfterShutdown() const;
   void awaitTerminationAfterShutdown() const;

+ 3 - 3
Plugins/org.commontk.eventadmin/handler/ctkEABlacklistingHandlerTasks.tpp

@@ -57,7 +57,7 @@ createHandlerTasks(const ctkEvent& event)
     handlerRefs = context->getServiceReferences<ctkEventHandler>(
     handlerRefs = context->getServiceReferences<ctkEventHandler>(
           topicHandlerFilters->createFilterForTopic(event.getTopic()));
           topicHandlerFilters->createFilterForTopic(event.getTopic()));
   }
   }
-  catch (const std::invalid_argument& e)
+  catch (const ctkInvalidArgumentException& e)
   {
   {
     CTK_WARN_EXC(ctkEventAdminActivator::getLogService(), &e)
     CTK_WARN_EXC(ctkEventAdminActivator::getLogService(), &e)
         << "Invalid EVENT_TOPIC [" << event.getTopic() << "]";
         << "Invalid EVENT_TOPIC [" << event.getTopic() << "]";
@@ -80,7 +80,7 @@ createHandlerTasks(const ctkEvent& event)
           result.push_back(ctkEAHandlerTask<Self>(ref, event, this));
           result.push_back(ctkEAHandlerTask<Self>(ref, event, this));
         }
         }
       }
       }
-      catch (const std::invalid_argument& e)
+      catch (const ctkInvalidArgumentException& e)
       {
       {
         CTK_WARN_SR_EXC(ctkEventAdminActivator::getLogService(), ref, &e)
         CTK_WARN_SR_EXC(ctkEventAdminActivator::getLogService(), ref, &e)
             << "Invalid EVENT_FILTER - Blacklisting ServiceReference ["
             << "Invalid EVENT_FILTER - Blacklisting ServiceReference ["
@@ -141,7 +141,7 @@ checkNull(void* object, const QString& name)
 {
 {
   if(object == 0)
   if(object == 0)
   {
   {
-    throw std::invalid_argument(qPrintable(name + " may not be null"));
+    throw ctkInvalidArgumentException(qPrintable(name + " may not be null"));
   }
   }
 }
 }
 
 

+ 1 - 1
Plugins/org.commontk.eventadmin/handler/ctkEABlacklistingHandlerTasks_p.h

@@ -153,7 +153,7 @@ private:
   NullEventHandler nullEventHandler;
   NullEventHandler nullEventHandler;
 
 
   /*
   /*
-   * This is a utility method that will throw a <tt>std::invalid_argument</tt>
+   * This is a utility method that will throw a <tt>ctkInvalidArgumentException</tt>
    * in case that the given object is null. The message will be of the form name +
    * in case that the given object is null. The message will be of the form name +
    * may not be null.
    * may not be null.
    */
    */

+ 2 - 2
Plugins/org.commontk.eventadmin/handler/ctkEACacheFilters.tpp

@@ -27,12 +27,12 @@ ctkEACacheFilters(CacheMap* cache,
 {
 {
   if(cache == 0)
   if(cache == 0)
   {
   {
-    throw std::invalid_argument("Cache may not be null");
+    throw ctkInvalidArgumentException("Cache may not be null");
   }
   }
 
 
   if(context == 0)
   if(context == 0)
   {
   {
-    throw std::invalid_argument("Context may not be null");
+    throw ctkInvalidArgumentException("Context may not be null");
   }
   }
 }
 }
 
 

+ 2 - 2
Plugins/org.commontk.eventadmin/handler/ctkEACacheFilters_p.h

@@ -63,8 +63,8 @@ public:
   * @param filter The filter as a string
   * @param filter The filter as a string
   * @return The <tt>ctkLDAPSearchFilter</tt> of the filter string or the TRUE_FILTER if the
   * @return The <tt>ctkLDAPSearchFilter</tt> of the filter string or the TRUE_FILTER if the
   *      filter string was <tt>null</tt>
   *      filter string was <tt>null</tt>
-  * @throws std::invalid_argument if <tt>ctkLDAPSearchFilter()</tt>
-  *      throws an <tt>std::invalid_argument</tt>
+  * @throws ctkInvalidArgumentException if <tt>ctkLDAPSearchFilter()</tt>
+  *      throws an <tt>ctkInvalidArgumentException</tt>
   *
   *
   * @see ctkEAFilters#createFilter(const QString&)
   * @see ctkEAFilters#createFilter(const QString&)
   */
   */

+ 1 - 1
Plugins/org.commontk.eventadmin/handler/ctkEACacheTopicHandlerFilters.tpp

@@ -27,7 +27,7 @@ ctkEACacheTopicHandlerFilters(CacheMapInterface* cache, bool requireTopic)
 {
 {
   if(cache == 0)
   if(cache == 0)
   {
   {
-    throw std::invalid_argument("Cache may not be null");
+    throw ctkInvalidArgumentException("Cache may not be null");
   }
   }
 
 
   filterStart = QString("(|")
   filterStart = QString("(|")

+ 2 - 2
Plugins/org.commontk.eventadmin/handler/ctkEAFilters_p.h

@@ -46,8 +46,8 @@ struct ctkEAFilters
    * @param filter The filter as a string
    * @param filter The filter as a string
    * @return The <tt>ctkLDAPSearchFilter</tt> of the filter string or the TRUE_FILTER if the
    * @return The <tt>ctkLDAPSearchFilter</tt> of the filter string or the TRUE_FILTER if the
    *      filter string was null
    *      filter string was null
-   * @throws std::invalid_argument if <tt>ctkLDAPSearchFilter()</tt>
-   *      throws an <tt>std::invalid_argument</tt>
+   * @throws ctkInvalidArgumentException if <tt>ctkLDAPSearchFilter()</tt>
+   *      throws an <tt>ctkInvalidArgumentException</tt>
    */
    */
   ctkLDAPSearchFilter createFilter(const QString& filter)
   ctkLDAPSearchFilter createFilter(const QString& filter)
   {
   {

+ 1 - 1
Plugins/org.commontk.eventadmin/tasks/ctkEASyncDeliverTasks.tpp

@@ -54,7 +54,7 @@ public:
       // stop the timer
       // stop the timer
       timerBarrier.waitForRendezvous();
       timerBarrier.waitForRendezvous();
     }
     }
-    catch (const std::logic_error& )
+    catch (const ctkIllegalStateException& )
     {
     {
       // this can happen on shutdown, so we ignore it
       // this can happen on shutdown, so we ignore it
     }
     }

+ 1 - 1
Plugins/org.commontk.eventadmin/util/ctkEACyclicBarrier_p.h

@@ -117,7 +117,7 @@ public:
   /**
   /**
    * Create a ctkEACyclicBarrier for the indicated number of parties.
    * Create a ctkEACyclicBarrier for the indicated number of parties.
    * and the given command to run at each barrier point.
    * and the given command to run at each barrier point.
-   * @throws std::invalid_argument if parties less than or equal to zero.
+   * @throws ctkInvalidArgumentException if parties less than or equal to zero.
    **/
    **/
   ctkEACyclicBarrier(int parties, ctkEARunnable* command = 0);
   ctkEACyclicBarrier(int parties, ctkEARunnable* command = 0);
 
 

+ 1 - 1
Plugins/org.commontk.eventadmin/util/ctkEALeastRecentlyUsedCacheMap.tpp

@@ -27,7 +27,7 @@ ctkEALeastRecentlyUsedCacheMap(int maxSize)
 {
 {
   if(0 >= maxSize)
   if(0 >= maxSize)
   {
   {
-    throw std::invalid_argument("Size must be positive");
+    throw ctkInvalidArgumentException("Size must be positive");
   }
   }
 
 
   // We need one more entry then m_maxSize in the cache and a HashMap is
   // We need one more entry then m_maxSize in the cache and a HashMap is

+ 4 - 4
Plugins/org.commontk.eventbus/ctkBusEvent.cpp

@@ -21,7 +21,7 @@
 
 
 #include "ctkBusEvent.h"
 #include "ctkBusEvent.h"
 #include "ctkEventDefinitions.h"
 #include "ctkEventDefinitions.h"
-#include <stdexcept>
+#include <ctkException.h>
 
 
 class ctkBusEventData : public QSharedData
 class ctkBusEventData : public QSharedData
 {
 {
@@ -50,7 +50,7 @@ public:
   {
   {
     if (topic.isEmpty())
     if (topic.isEmpty())
     {
     {
-      throw std::invalid_argument("empty topic");
+      throw ctkInvalidArgumentException("empty topic");
     }
     }
 
 
     // Can't start or end with a '/' but anywhere else is okay
     // Can't start or end with a '/' but anywhere else is okay
@@ -58,7 +58,7 @@ public:
     if (topic.startsWith("/") || topic.endsWith("/") ||
     if (topic.startsWith("/") || topic.endsWith("/") ||
         topic.contains("//"))
         topic.contains("//"))
     {
     {
-      throw std::invalid_argument(QString("invalid topic: %1").arg(topic).toStdString());
+      throw ctkInvalidArgumentException(QString("invalid topic: %1").arg(topic));
     }
     }
 
 
     QString::const_iterator topicEnd = topic.end();
     QString::const_iterator topicEnd = topic.end();
@@ -71,7 +71,7 @@ public:
       if ((a <= c) && (c <= z)) continue;
       if ((a <= c) && (c <= z)) continue;
       if ((zero <= c) && (c <= nine)) continue;
       if ((zero <= c) && (c <= nine)) continue;
       if ((c == underscore) || (c == dash) || (c == slash)) continue;
       if ((c == underscore) || (c == dash) || (c == slash)) continue;
-      throw std::invalid_argument(QString("invalid topic: %1").arg(topic).toStdString());
+      throw ctkInvalidArgumentException(QString("invalid topic: %1").arg(topic));
     }
     }
   }
   }
 
 

+ 1 - 1
Plugins/org.commontk.eventbus/ctkBusEvent.h

@@ -55,7 +55,7 @@ public:
    *
    *
    * @param topic The topic of the event.
    * @param topic The topic of the event.
    * @param properties The event's properties (may be empty).
    * @param properties The event's properties (may be empty).
-   * @throws std::invalid_argument If topic is not a valid topic name.
+   * @throws ctkInvalidArgumentException If topic is not a valid topic name.
    */
    */
   ctkBusEvent(const QString& topic, const ctkDictionary& properties = ctkDictionary());
   ctkBusEvent(const QString& topic, const ctkDictionary& properties = ctkDictionary());
   ctkBusEvent(const ctkBusEvent& event);
   ctkBusEvent(const ctkBusEvent& event);

+ 2 - 1
Plugins/org.commontk.metatype/ctkMetaTypeProviderImpl.cpp

@@ -28,6 +28,7 @@
 #include "ctkMTDataParser_p.h"
 #include "ctkMTDataParser_p.h"
 
 
 #include <ctkPluginConstants.h>
 #include <ctkPluginConstants.h>
+#include <ctkException.h>
 #include <service/log/ctkLogService.h>
 #include <service/log/ctkLogService.h>
 #include <service/metatype/ctkMetaTypeService.h>
 #include <service/metatype/ctkMetaTypeService.h>
 
 
@@ -78,7 +79,7 @@ ctkObjectClassDefinitionPtr ctkMetaTypeProviderImpl::getObjectClassDefinition(
   else
   else
   {
   {
     QString msg = QCoreApplication::translate(ctkMTMsg::CONTEXT, ctkMTMsg::OCD_ID_NOT_FOUND).arg(pid);
     QString msg = QCoreApplication::translate(ctkMTMsg::CONTEXT, ctkMTMsg::OCD_ID_NOT_FOUND).arg(pid);
-    throw std::invalid_argument(msg.toStdString());
+    throw ctkInvalidArgumentException(msg);
   }
   }
 }
 }
 
 

+ 4 - 4
Plugins/org.commontk.plugingenerator.core/ctkPluginGeneratorCodeModel.cpp

@@ -25,7 +25,7 @@
 #include <QDir>
 #include <QDir>
 #include <QHash>
 #include <QHash>
 
 
-#include <stdexcept>
+#include <ctkException.h>
 
 
 
 
 class ctkPluginGeneratorCodeModelPrivate
 class ctkPluginGeneratorCodeModelPrivate
@@ -69,7 +69,7 @@ public:
     }
     }
     else
     else
     {
     {
-      throw std::runtime_error(std::string("The directory ") + (location + this->objectName()).toStdString() + " could not be created");
+      throw ctkRuntimeException("The directory " + location + this->objectName() + " could not be created");
     }
     }
   }
   }
 };
 };
@@ -177,7 +177,7 @@ void ctkPluginGeneratorCodeModel::addTemplate(ctkPluginGeneratorAbstractTemplate
       {
       {
         if (!dynamic_cast<ctkPluginGeneratorFolderTemplate*>(d->rootTemplates[rootEntry]))
         if (!dynamic_cast<ctkPluginGeneratorFolderTemplate*>(d->rootTemplates[rootEntry]))
         {
         {
-          throw std::runtime_error(std::string("The segment \"") + rootEntry.toStdString() + "\" in \"" + path.toStdString() + "\" is not a folder");
+          throw ctkRuntimeException("The segment \"" + rootEntry + "\" in \"" + path + "\" is not a folder");
         }
         }
         parentTemplate = d->rootTemplates[rootEntry];
         parentTemplate = d->rootTemplates[rootEntry];
       }
       }
@@ -200,7 +200,7 @@ void ctkPluginGeneratorCodeModel::addTemplate(ctkPluginGeneratorAbstractTemplate
             parentTemplate = qobject_cast<ctkPluginGeneratorAbstractTemplate*>(child);
             parentTemplate = qobject_cast<ctkPluginGeneratorAbstractTemplate*>(child);
             if (parentTemplate == 0)
             if (parentTemplate == 0)
             {
             {
-              throw std::runtime_error(std::string("The segment \"") + currEntry.toStdString() + "\" in \"" + path.toStdString() + "\" is not a folder");
+              throw ctkRuntimeException("The segment \"" + currEntry + "\" in \"" + path + "\" is not a folder");
             }
             }
             break;
             break;
           }
           }

+ 3 - 3
Plugins/org.commontk.slicermodule/ctkSlicerModuleReader.cpp

@@ -84,7 +84,7 @@ bool ctkSlicerModuleReader::validate()const
   if (!res)
   if (!res)
     {
     {
     QString error = errorHandler.statusMessage();
     QString error = errorHandler.statusMessage();
-    throw std::runtime_error( tr("Invalid Schema %1")
+    throw ctkRuntimeException( tr("Invalid Schema %1")
       .arg(errorHandler.statusMessage()).toStdString() );
       .arg(errorHandler.statusMessage()).toStdString() );
     }
     }
 
 
@@ -93,7 +93,7 @@ bool ctkSlicerModuleReader::validate()const
 
 
   if (!res)
   if (!res)
     {
     {
-    throw std::runtime_error( tr("Invalid XML(%1,%2):\n %3")
+    throw ctkRuntimeException( tr("Invalid XML(%1,%2):\n %3")
       .arg(errorHandler.line())
       .arg(errorHandler.line())
       .arg(errorHandler.column())
       .arg(errorHandler.column())
       .arg(errorHandler.statusMessage()).toStdString());
       .arg(errorHandler.statusMessage()).toStdString());
@@ -120,7 +120,7 @@ void ctkSlicerModuleReader::update()
 
 
   if (!res)
   if (!res)
     {
     {
-    throw std::runtime_error( tr("Parse error %1")
+    throw ctkRuntimeException( tr("Parse error %1")
       .arg(handler.errorString()).toStdString() );
       .arg(handler.errorString()).toStdString() );
     }
     }
 }
 }