[gst-devel] Why wrapping GLib interfaces?
Murray.Cumming at Comneon.com
Murray.Cumming at Comneon.com
Tue Oct 14 07:01:05 CEST 2003
> From: Ronald Bultje [mailto:rbultje at ronald.bitfreak.net]
> No. The API/ABI is exactly the same. The functions will still work.
>
> An instance will always *implement* the interface. However,
> calling the functions won't do anything except possibly
> triggering a runtime warning from within the virtual
> functions in the object implementing the interface that this
> instance doesn't support it.
Hmm, that's not too bad then, and C++ can probably live with it. It would
just demand more care from the programmer, instead of the compiler checking
the API for him.
I still think that aggregation would be the more obvious way to do it. It's
easier to know that none of the aggregated interface's method would work if
I get a NULL when I try to get the interface itself. I think that's easier
than trying to remember that I need to check the return code of method 1 in
order to call method 2. Again, gtk_tree_view_get_selection() is a fairly
good example of this.
Murray Cumming
www.murrayc.com
murrayc at usa.net
More information about the gstreamer-devel
mailing list