unicorn/qemu/qobject
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
..
Makefile.objs qlit: move qlit from check-qjson to qobject/ 2018-03-07 17:08:17 -05:00
qbool.c qapi: Remove qobject_to_X() functions 2018-03-20 10:58:44 -04:00
qdict.c qapi: Make more of qobject_to() 2018-03-20 11:05:44 -04:00
qlist.c qapi: Remove qobject_to_X() functions 2018-03-20 10:58:44 -04:00
qlit.c qapi: Replace qobject_to_X(o) by qobject_to(X, o) 2018-03-20 10:55:57 -04:00
qnull.c qapi: Add qobject_is_equal() 2018-03-08 08:41:43 -05:00
qnum.c qapi: Remove qobject_to_X() functions 2018-03-20 10:58:44 -04:00
qobject.c qobject: use a QObjectBase_ struct 2018-05-04 10:11:24 -04:00
qstring.c qobject: introduce qobject_get_try_str() 2018-03-20 11:10:03 -04:00