note the bug spotted by Tasn.
authorbarbieri <barbieri>
Tue, 6 Mar 2012 12:35:24 +0000 (12:35 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 6 Mar 2012 12:35:24 +0000 (12:35 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@68824 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/eina_model.c

index 51b8079..ae06c1b 100644 (file)
@@ -522,6 +522,27 @@ _eina_model_interface_implements(const Eina_Model_Interface *iface, const Eina_M
 }
 
 /* apply topological sort and remove duplicates */
+/*
+ * TODO: Topological sort will only work for linked interfaces, but
+ *       will ignore original ordering provided by types. Consider the
+ *       following:
+ *
+ *         - A_Type -> X_Iface (name: "MyIface")
+ *         - B_Type -> Y_Iface (name: "MyIface")
+ *
+ *       Both X_Iface and Y_Iface are different implementations of the
+ *       "MyIface".
+ *
+ *       B_Type inherits from A_Type, then Y_Iface must be looked up
+ *       first, even though there is no link between Y_Iface and
+ *       X_Iface.
+ *
+ *       However, the way the current topological sort behaves, the
+ *       roots may come out in any order. We need a stable version
+ *       that sorts roots before removing them from graph.
+ *
+ * Thanks to Tasn to report it :-)
+ */
 static Eina_Bool
 _eina_model_description_ifaces_fix(Eina_Model_Description *desc)
 {
@@ -589,6 +610,11 @@ _eina_model_description_ifaces_fix(Eina_Model_Description *desc)
      {
         struct node *r, *d;
 
+        /* TODO: sort roots using input order?  Or at least study if
+         * it's enough to change roots append to prepend.
+         *
+         * See comments above.
+         */
         n_roots--;
         r = roots[n_roots];