GNOME Bugzilla – Bug 771782
Overload get_property(), so it can return value
Last modified: 2016-11-24 14:19:57 UTC
Currently, to get a property from the object, you have to do the following: T property_value; // declare object of property value type obj->get_property("name", property_value); // get property value However, it's very inconvenient, especially when you want to pass the value as an argument to a function. I'm proposing the following API: template<typename T> T get_property(const Glib::ustring &property_name); So we can easily get and use the property directly: foo(obj->get_property<int>("name")); I know that usually people should use property_*() API, but it's not a case in gstreamermm, where we can operate with dynamic elements. If you don't want to add one more method to the Glib::ObjectBase, I'll do it only for Gst* classes, however, I think it's nice-to-have API in general.
Created attachment 336026 [details] [review] proposed solution
I agree that your patch fits well in ObjectBase. Murray, do you agree? We should just wait with pushing it to the git repository until a glibmm-2-50 branch has been created. It's not included in glibmm 2.50.0, and no new API shall be added in any glibmm 2.50.x, x > 0.
There is a gtkmm-2-50 branch now. I have pushed the patch to the master branch.