X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fsyncableobject.h;h=28e14720e4ea15f3067e3fb04ada16770facc813;hp=fda437f38ba008b556aa71f88377e9175a9be8e2;hb=26e1c7dca58f304774fe58292a553f0993d39ab0;hpb=62b7bed21f011037a34d7a4ea797d79fbdeff687 diff --git a/src/common/syncableobject.h b/src/common/syncableobject.h index fda437f3..28e14720 100644 --- a/src/common/syncableobject.h +++ b/src/common/syncableobject.h @@ -28,6 +28,27 @@ #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 @@ -93,22 +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 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 - #endif