#include <QEvent>
#include <QSet>
+#include <QThreadStorage>
#include <functional>
+#include <memory>
#include "protocol.h"
void dumpProxyStats();
void dumpSyncMap(SyncableObject *object);
+ static SignalProxy *current() {
+ return _current;
+ }
+
/**@{*/
/**
* This method allows to send a signal only to a limited set of peers
/**
* @return If handling a signal, the Peer from which the current signal originates
*/
- Peer *sourcePeer() { return _sourcePeer; }
+ Peer *sourcePeer();
+ void setSourcePeer(Peer *sourcePeer);
+
+ /**
+ * @return If sending a signal, the Peer to which the current signal is directed
+ */
+ Peer *targetPeer();
+ void setTargetPeer(Peer *targetPeer);
public slots:
void detachObject(QObject *obj);
bool _restrictMessageTarget = false;
Peer *_sourcePeer = nullptr;
+ Peer *_targetPeer = nullptr;
+
+ thread_local static SignalProxy *_current;
friend class SignalRelay;
friend class SyncableObject;