common: Simplify SyncableObject macros and usage
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 23 Aug 2018 21:40:36 +0000 (23:40 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
Since the C++11 standard defines "__func__", and modern versions
of MSVC support this, we can remove the workaround for MSVC from
the SyncableObject macros. It is no longer necessary to derive
the function name from MSVC's __FUNCTION__ (which contains the
enclosing class name), and thus the _classNameOffset__ function
declared by the SYNCABLE_OBJECT macro is no longer needed.

Repurpose the macro to define the syncMetaObject() member function
instead, and remove the no-longer needed INIT_SYNCABLE_OBJECT
macro.
The syncMetaObject() function is used by the signal proxy for
accessing the metaObject() of the base class in case there are
client- or core-specific specializations of a syncable object;
i.e. if you have Foo directly inheriting from SyncableObject,
and ClientFoo derived from Foo, the function must only be
declared in Foo, otherwise syncing won't work.

Thus, the SYNCABLE_OBJECT macro declares the function as final,
so it can't be accidentally overridden.

While we're at it, replace include guards with #pragma once in
files we touched.


No differences found