GNOME Bugzilla – Bug 709903
GstIterator should maybe be based in LibGee.Iterator
Last modified: 2013-10-11 14:57:42 UTC
Stephan and I filed bug 709901 because we're missing the type of the element of the iterator from gobject-introspection data (I know we normally have this in the <doc> tag, but that is not machine-parseable). Maybe that bug is invalid and what should happen is that GstIterator should depend on LibGee.Iterator[1], which seems to be generic in vala without problems. [1] https://people.gnome.org/~dvillevalois/libgee/doc/gee-1.0/Gee.Iterator.html
No it should not be based on the Gee.Iterator, that one is not threadsafe among other things. The problem here is that gobject-introspection has parameterized types for a fixed number of hard coded types (e.g. GList). This should be somehow extendable to handle other cases, gpointer based and GValue based. Anyway, this shouldn't be a problem for you as GstIterator works with GValues, and GValues contain the information about the type of the value. You can just get that at runtime and do a dynamic cast to the corresponding type.
(In reply to comment #1) > No it should not be based on the Gee.Iterator, that one is not threadsafe among > other things. > > The problem here is that gobject-introspection has parameterized types for a > fixed number of hard coded types (e.g. GList). This should be somehow > extendable to handle other cases, gpointer based and GValue based. So then bug 709901 is a valid bug? > Anyway, this shouldn't be a problem for you as GstIterator works with GValues, > and GValues contain the information about the type of the value. You can just > get that at runtime and do a dynamic cast to the corresponding type. Well, the main goal behind this is to obtain those types at compile-time :(