#define NEPOMUK_DBUS_REGISTER_SERVICE_TYPE(TYPE, INTERFACE) \ template<> \ struct ServicePublisherTypeInterfaceFactory< INTERFACE > : public Nepomuk::Backbone::ServicePublisherInterfaceFactory { \ Nepomuk::Backbone::DBus::ServicePublisherInterface* createInterface( Nepomuk::Backbone::ServicePublisher* s ) const { \ return new INTERFACE( s ); \ } \ }; namespace Nepomuk { namespace Backbone { class ServicePublisher; namespace DBus { class ServicePublisherInterface : public QDBusAdaptor { Q_OBJECT public: virtual ~ServicePublisherInterface(); ServicePublisher* servicePublisher() const; protected: ServicePublisherInterface( ServicePublisher* parent ); private: ServicePublisher* m_servicePublisher; }; class ServicePublisherInterfaceFactory { public: virtual ~ServicePublisherInterfaceFactory() {} virtual ServicePublisherInterface* createInterface( ServicePublisher* s ) const = 0; protected: ServicePublisherInterfaceFactory() {} }; int registerServiceType( const QString& type, ServiceTypeInterfaceFactory* factory ); } } } #endif