virtual inheritance and Glib::Interface



I was looking at Gtk::ListStore and noticed that it used multiple
inheritance.  Specifically:
class ListStore :
  public Glib::Object,
  public TreeModel,
  public TreeSortable,
  public TreeDragSource,
  public TreeDragDest

TreeModel, TreeSortable, TreeDragSource, and TreeDragDest all inherit
from Glib::Interface.  I noticed that Glib::Interface inherits
virtually from Glib::ObjectBase (as does Glib::Object), but TreeModel,
TreeSortable, TreeDragSource, and TreeDragDest don't inherit virtually
from Glib::Interface.  It seems that we're probably creating multiple
Glib::Interface objects whenever we create a Gtk::ListStore (and by
extension Gtk::TreeStore).  There may very well be more cases where
this is true, but I haven't looked any farther yet.  Is there any
reason why we wouldn't want want to inherit virtually from
Glib::Interface in these cases?

Jonner



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]