Re: glib abstract class vs interface
- From: David Nečas (Yeti) <yeti physics muni cz>
- To: gtk-list gnome org
- Subject: Re: glib abstract class vs interface
- Date: Mon, 12 Mar 2007 15:37:27 +0100
On Mon, Mar 12, 2007 at 10:26:15PM +0800, Kuang-Chun Cheng wrote:
> I'm recently study GObject and hope someone can explain
> the difference between
>
> Abstract class defined by G_DEFINE_ABSTRACT_TYPE
> and interface.
>
> I think if I use G_DEFINE_ABSTRACT_TYPE to create a
> class and define all member functions pointer to NULL (pure
> virtual) without implementation, then I will have an interface.
It could work this way in an object system that uses
multiple inheritance + purely abstract classes to express
interfaces (in the general sense), but GObject does not
permit multiple inheritance.
> So why GType introduce a new type called INTERFACE.
> What kind of new features are introduced in GType's interface ?
A GObject class can implement any number of interfaces.
However, it has exactly one parent class.
Yeti
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]