unicorn/qemu/include/qapi/qmp
Marc-André Lureau f4b3c5d0bd
qobject: use a QObjectBase_ struct
By moving the base fields to a QObjectBase_, QObject can be a type
which also has a 'base' field. This allows writing a generic QOBJECT()
macro that will work with any QObject type, including QObject
itself. The container_of() macro ensures that the object to cast has a
QObjectBase_ base field, giving some type safety guarantees. QObject
must have no members but QObjectBase_ base, or else QOBJECT() breaks.

QObjectBase_ is not a typedef and uses a trailing underscore to make
it obvious it is not for normal use and to avoid potential abuse.

Backports commit 3d3eacaeccaab718ea0e2ddaa578bfae9e311c59 from qemu
2018-05-04 10:11:24 -04:00
..
qbool.h qobject: use a QObjectBase_ struct 2018-05-04 10:11:24 -04:00
qdict.h qobject: use a QObjectBase_ struct 2018-05-04 10:11:24 -04:00
qerror.h qmp: Eliminate silly QERR_QMP_* macros 2018-03-02 11:28:17 -05:00
qjson.h import 2015-08-21 15:04:50 +08:00
qlist.h qobject: use a QObjectBase_ struct 2018-05-04 10:11:24 -04:00
qlit.h qlit: add qobject_from_qlit() 2018-03-20 10:30:41 -04:00
qnull.h qobject: use a QObjectBase_ struct 2018-05-04 10:11:24 -04:00
qnum.h qobject: use a QObjectBase_ struct 2018-05-04 10:11:24 -04:00
qobject.h qobject: use a QObjectBase_ struct 2018-05-04 10:11:24 -04:00
qstring.h qobject: use a QObjectBase_ struct 2018-05-04 10:11:24 -04:00