Type t = typeof(Foo);

On Wed, Mar 14, 2012 at 10:47 AM, Derek Dai <[email protected]> wrote:
> In vala, before you can invoke a class method, you need an instance. Valac
> generated C code will get class from instance and pass it in class method
> as first argument.
>
> For example,
> class Foo
> {
>    public class void bar() { }
> }
>
> If we invoke bar() like vala code below
> var foo = new Foo();
> foo.bar();
>
> Generated C code will look like
> Foo * foo = foo_new();
> foo_bar(FOO_GET_CLASS(foo));
>
> So, if we invoke bar with difference instance of subclass of Foo, the
> actual class pass in bar() varying.
>
> The question is, if I want access the class argument (say get GType of that
> class) just like "this" in instance method, how can I do it? Thanks!
>
> Derek Dai
>
> _______________________________________________
> vala-list mailing list
> [email protected]
> http://mail.gnome.org/mailman/listinfo/vala-list
>
_______________________________________________
vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to