[Bug 76369] [next] Remove dbus-glib GTypes from public API
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Mon Apr 7 04:37:13 PDT 2014
https://bugs.freedesktop.org/show_bug.cgi?id=76369
--- Comment #13 from Simon McVittie <simon.mcvittie at collabora.co.uk> ---
> +tp_dbus_object_add_skeleton
I'm really not sure I like that API. I would like to be able to have this:
* parent class P implements interface I with one skeleton
* subclass S reimplements interface I with a different skeleton
Ideally, the parent class's skeleton for that interface would not even get
constructed if that happens. Concretely, this is necessary if we want to be
able to move new functionality from subclasses up to a parent class when it
stabilizes.
Maybe something like this:
interface Exportable {
vfunc fill_skeletons (Exportable self,
GHashTable<GQuark,GDBusInterfaceSkeleton> skeletons);
}
with a typical implementation looking like this pseudocode:
fill_skeletons (self, skeletons)
{
if (skeletons.lookup (TP_IFACE_QUARK_BADGERS) == NULL)
skeletons.insert (TP_IFACE_QUARK_BADGERS, badger_skeleton_new (self));
if (skeletons.lookup (TP_IFACE_QUARK_MUSHROOMS) == NULL)
skeletons.insert (TP_IFACE_QUARK_MUSHROOMS, mushroom_skeleton_new (self));
parent_class.fill_skeletons (self);
/* we want to override one method, or something */
snake_skeleton = skeletons.lookup (TP_IFACE_QUARK_SNAKES);
}
The fallback implementation of fill_skeletons in the GInterface would be what
tp_dbus_connection_try_register() does now:
fill_skeletons (self, skeletons)
{
foreach TpSvc interface, svc
{
if (skeletons.lookup (svc.interface_name) == NULL)
skeletons.insert (svc.interface_name, _tp_svc_interface_new (self));
}
}
(Implementation detail: tp_dbus_connection_try_register() would make the
GHashTable, iterate it, and free it before returning.)
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the telepathy-bugs
mailing list