G_DECLARE_*_TYPE
Last week Ryan Lortie blogged about some new macros I really have been missing for years of doing GObject development.
This commit adds G_DECLARE_{FINAL,DERIVABLE}_TYPE
to gtype.h so that some of the GObject boilerplate code could be omitted.
Sweet! It will be available in next version of GLib. Version 2.44.
One thing I would personally like in the macro, as I tend to add to most GStreamer classes, is {OBJ_NAME}_CAST
!
This would do a simple cast without any run-time checks.
Also known as type punning according to wikipedia.
Which basically is like reinterpret_cast
in C++.