X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fsyncableobject.h;h=28e14720e4ea15f3067e3fb04ada16770facc813;hp=01fb39534be732d124b914069228cfa7e0a2a906;hb=328b48e6fbd78d6158eb55296c0843fc5a41bcfa;hpb=39eb2fda3eaef2de78a8134556015ff86e9b85d4 diff --git a/src/common/syncableobject.h b/src/common/syncableobject.h index 01fb3953..28e14720 100644 --- a/src/common/syncableobject.h +++ b/src/common/syncableobject.h @@ -28,7 +28,29 @@ #include "signalproxy.h" + + +#define SYNCABLE_OBJECT static const int _classNameOffset__; +#define INIT_SYNCABLE_OBJECT(x) const int x ::_classNameOffset__ = QByteArray(staticMetaObject.className()).length() + 2; + +#ifdef Q_WS_WIN +# define SYNC(...) sync_call__(SignalProxy::Server, (__FUNCTION__ + _classNameOffset__), __VA_ARGS__); +# define REQUEST(...) sync_call__(SignalProxy::Client, (__FUNCTION__ + _classNameOffset__) , __VA_ARGS__); +#else +# define SYNC(...) sync_call__(SignalProxy::Server, __func__, __VA_ARGS__); +# define REQUEST(...) sync_call__(SignalProxy::Client, __func__, __VA_ARGS__); +#endif //Q_WS_WIN + +#define SYNC_OTHER(x, ...) sync_call__(SignalProxy::Server, #x, __VA_ARGS__); +#define REQUEST_OTHER(x, ...) sync_call__(SignalProxy::Client, #x, __VA_ARGS__); + + +#define ARG(x) const_cast(reinterpret_cast(&x)) +#define NO_ARG 0 + + class SyncableObject : public QObject { + SYNCABLE_OBJECT Q_OBJECT public: @@ -92,21 +114,4 @@ private: friend class SignalProxy; }; -#define SYNCABLE_OBJECT static const int _classNameOffset__; -#define INIT_SYNCABLE_OBJECT(x) const int x ::_classNameOffset__ = QByteArray(staticMetaObject.className()).length() + 2; - -#ifdef Q_WS_WIN -# define SYNC(...) sync_call__(SignalProxy::Server, (__FUNCTION__ + _classNameOffset__), __VA_ARGS__); -# define REQUEST(...) sync_call__(SignalProxy::Client, (__FUNCTION__ + _classNameOffset__) , __VA_ARGS__); -#else -# define SYNC(...) sync_call__(SignalProxy::Server, __func__, __VA_ARGS__); -# define SYNC_OTHER(x, ...) sync_call__(SignalProxy::Server, #x, __VA_ARGS__); -# define REQUEST(...) sync_call__(SignalProxy::Client, __func__, __VA_ARGS__); -# define REQUEST_OTHER(x, ...) sync_call__(SignalProxy::Client, #x, __VA_ARGS__); -#endif //Q_WS_WIN - - -#define ARG(x) const_cast(reinterpret_cast(&x)) -#define NO_ARG 0 - #endif