diff options
author | Greg Kurz | 2019-12-11 14:32:41 +0100 |
---|---|---|
committer | Paolo Bonzini | 2019-12-17 19:32:46 +0100 |
commit | 55deffdb5ca626689b3e08d7e9adeab9f0e5ad5f (patch) | |
tree | 2cb8b9e786c4bd1b427592f1c62a2519b3768b06 /Makefile | |
parent | Makefile: remove unused variables (diff) | |
download | qemu-55deffdb5ca626689b3e08d7e9adeab9f0e5ad5f.tar.gz qemu-55deffdb5ca626689b3e08d7e9adeab9f0e5ad5f.tar.xz qemu-55deffdb5ca626689b3e08d7e9adeab9f0e5ad5f.zip |
object: Improve documentation of interfaces
QOM interfaces allow a limited form of multiple inheritance, at the
condition of being stateless. That is, they cannot be instantiated
and a pointer to an interface shouldn't be dereferenceable in any way.
This is achieved by making the QOM instance type an incomplete type,
which is, as mentioned by Markus Armbruster, the closest you can get
to abstract class in C.
Incomplete types are widely used to hide implementation details, but
people usually expect to find at least one place where the type is
fully defined. The fact that it doesn't happen with QOM interfaces is
quite disturbing, especially since it isn't documented anywhere as
recently discussed in this thread:
https://lists.gnu.org/archive/html/qemu-devel/2019-12/msg01579.html
Amend the documentation in the object.h header file to provide more
details about why and how to implement QOM interfaces using incomplete
types.
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions