소스 검색

ENH: EventBus: Unified typdefs for QHash into ctkProperties

Sascha Zelzer 15 년 전
부모
커밋
a4b5e61c3f

+ 0 - 3
Libs/PluginFramework/EventBus/ctkEvent.h

@@ -16,9 +16,6 @@
 
   public:
 
-    typedef QMap<QString, QVariant> Properties;
-
-    //TODO: what are we doing about malformed topic strings? Use exceptions in CTK?
     ctkEvent(const QString& topic, const ctkDictionary& properties = ctkDictionary());
     ctkEvent(const ctkEvent& event);
     ~ctkEvent();

+ 1 - 3
Libs/PluginFramework/EventBus/ctkEventBus.h

@@ -8,8 +8,6 @@ class ctkEventBus {
 
 public:
 
-  typedef QMap<QString, QVariant> Properties;
-
   virtual ~ctkEventBus() {}
 
   virtual void postEvent(const ctkEvent& event) = 0;
@@ -17,7 +15,7 @@ public:
 
   virtual void publishSignal(const QObject* publisher, const char* signal) = 0;
 
-  virtual void subscribeSlot(const QObject* subscriber, const char* member, const Properties& properties) = 0;
+  virtual void subscribeSlot(const QObject* subscriber, const char* member, const ctkProperties& properties) = 0;
 
 };
 

+ 1 - 1
Libs/PluginFramework/ctkPluginFrameworkContext.cpp

@@ -31,7 +31,7 @@
 
 
   ctkPluginFrameworkContext::ctkPluginFrameworkContext(
-      const ctkPluginFrameworkFactory::Properties& initProps)
+      const ctkProperties& initProps)
         : plugins(0), services(this), systemPlugin(this),
         storage(this), props(initProps)
   {

+ 2 - 2
Libs/PluginFramework/ctkPluginFrameworkContext_p.h

@@ -79,13 +79,13 @@
        */
       static int globalId;
 
-      ctkPluginFrameworkFactory::Properties props;
+      ctkProperties props;
 
       /**
        * Contruct a framework context
        *
        */
-      ctkPluginFrameworkContext(const ctkPluginFrameworkFactory::Properties& initProps);
+      ctkPluginFrameworkContext(const ctkProperties& initProps);
 
 
       /**

+ 1 - 1
Libs/PluginFramework/ctkPluginFrameworkFactory.cpp

@@ -24,7 +24,7 @@
 #include "ctkPluginFrameworkContext_p.h"
 
 
-  ctkPluginFrameworkFactory::ctkPluginFrameworkFactory(const Properties& initProps)
+  ctkPluginFrameworkFactory::ctkPluginFrameworkFactory(const ctkProperties& initProps)
     : fwCtx(new ctkPluginFrameworkContext(initProps))
   {
 

+ 3 - 4
Libs/PluginFramework/ctkPluginFrameworkFactory.h

@@ -28,6 +28,7 @@
 
 #include "CTKPluginFrameworkExport.h"
 
+#include "ctkPluginFramework_global.h"
 
   class ctkPluginFramework;
   class ctkPluginFrameworkContext;
@@ -39,13 +40,11 @@
 
   public:
 
-    typedef QHash<QString, QVariant> Properties;
-
     /**
      * Create a new <code>%ctkPluginFrameworkFactory</code> instance.
      *
      * <p>
-     * The Properties map is used to configure the ctkPluginFramework. The
+     * The ctkProperties map is used to configure the ctkPluginFramework. The
      * plugin framework instance created with #getFramework() must interpret
      * the following properties:
      *
@@ -58,7 +57,7 @@
      *        must use some reasonable default configuration if certain
      *        properties are not provided.
      */
-    ctkPluginFrameworkFactory(const Properties& initProps = Properties());
+    ctkPluginFrameworkFactory(const ctkProperties& initProps = ctkProperties());
 
     ~ctkPluginFrameworkFactory();
 

+ 1 - 1
Libs/PluginFramework/ctkPluginFramework_global.h

@@ -25,8 +25,8 @@
 
 #include <QHash>
 
-
 typedef QHash<QString, QVariant> ServiceProperties;
 typedef QHash<QString, QVariant> ctkDictionary;
+typedef QHash<QString, QVariant> ctkProperties;
 
 #endif // CTKPLUGINFRAMEWORK_GLOBAL_H

+ 1 - 1
Plugins/org.commontk.eventbus/ctkEventBusImpl.cpp

@@ -32,7 +32,7 @@ void ctkEventBusImpl::publishSignal(const QObject* publisher, const char* signal
   Q_UNUSED(signal)
 }
 
-void ctkEventBusImpl::subscribeSlot(const QObject* subscriber, const char* member, const Properties& properties)
+void ctkEventBusImpl::subscribeSlot(const QObject* subscriber, const char* member, const ctkProperties& properties)
 {
 
   // TODO check for duplicates

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

@@ -24,7 +24,7 @@ public:
 
   void publishSignal(const QObject* publisher, const char* signal);
 
-  void subscribeSlot(const QObject* subscriber, const char* member, const Properties& properties);
+  void subscribeSlot(const QObject* subscriber, const char* member, const ctkProperties& properties);
 
 protected:
 

+ 2 - 2
Plugins/org.commontk.eventbus/ctkEventHandlerWrapper_p.h

@@ -15,13 +15,13 @@ class ctkEventHandlerWrapper : public QObject {
 
 private:
 
-  ctkEventBus::Properties properties;
+  ctkProperties properties;
   QStringList topicList;
   ctkLDAPSearchFilter filter;
 
 public:
 
-  ctkEventHandlerWrapper(const QObject* subscriber, const char* handler, const ctkEventBus::Properties& properties)
+  ctkEventHandlerWrapper(const QObject* subscriber, const char* handler, const ctkProperties& properties)
     : properties(properties)
   {
     connect(this, SIGNAL(notifySubscriber(Event)), subscriber, handler);