X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fsignalproxy.h;h=23dbc9f2c7ecabc5569a1df23a021eb24b088321;hp=be2c9ffd95343d45c04952e210c23b1327876ab3;hb=17a902604b2631d1165fb8c7af65e064e37a49d7;hpb=e008cd12ef319c4b5f9fe5a8cc1524829551771d diff --git a/src/common/signalproxy.h b/src/common/signalproxy.h index be2c9ffd..23dbc9f2 100644 --- a/src/common/signalproxy.h +++ b/src/common/signalproxy.h @@ -29,6 +29,8 @@ #include #include +#include + class SignalRelay; class QMetaObject; @@ -62,16 +64,15 @@ public: bool attachSlot(const QByteArray& sigName, QObject *recv, const char *slot); void synchronize(QObject *obj); - void synchronizeAsMaster(QObject *obj); - void synchronizeAsSlave(QObject *obj); void setInitialized(QObject *obj); bool initialized(QObject *obj); void requestInit(QObject *obj); - + void detachObject(QObject *obj); void detachSignals(QObject *sender); void detachSlots(QObject *receiver); + void stopSync(QObject *obj); //! Writes a QVariant to a device. /** The data item is prefixed with the resulting blocksize, @@ -90,14 +91,14 @@ public: const QList &argTypes(QObject *obj, int methodId); const QByteArray &methodName(QObject *obj, int methodId); - const QHash &syncMap(QObject *obj); + const QHash &syncMap(QObject *obj); typedef QHash > ArgHash; typedef QHash MethodNameHash; struct ClassInfo { ArgHash argTypes; MethodNameHash methodNames; - QHash syncMap; + QHash syncMap; }; void dumpProxyStats(); @@ -142,9 +143,13 @@ private: void _detachSignals(QObject *sender); void _detachSlots(QObject *receiver); + void _stopSync(QObject *obj); - void dumpSyncMap(QObject *object); + void dumpSyncMap(QObject *object); + // Hash of used QIODevices + QHash _peerByteCount; + // containg a list of argtypes for fast access QHash _classInfo; @@ -160,11 +165,14 @@ private: typedef QHash ObjectId; QHash _syncSlave; - // Hash of used QIODevices - QHash _peerByteCount; ProxyMode _proxyMode; + // the slaveMutex protects both containers: + // - _syncSlaves for sync and init calls + // - _attachedSlots + QMutex slaveMutex; + friend class SignalRelay; };