[Vala] ValueHash modeled after ValueList tuturial
- From: Franz Fasching <vala-list drfasching com>
- To: vala-list gnome org
- Subject: [Vala] ValueHash modeled after ValueList tuturial
- Date: Sun, 17 Nov 2013 14:10:39 +0100
Hi Vala-List,
I'm trying to model a ValueHash after the ValueList example in the Vala
tutorial:
[Compact]
public class ValueHash : HashTable<string, Value?> {
[CCode (has_construct_function = false)]
protected ValueHash () {}
}
Compiling this yields (using valac-0.22):
error: unable to chain up to base constructor requiring arguments
protected ValueHash () {}
^^^^^^^^^^^^^^^^^^^
Searching the net I figured a call to the base() method is needed in the
constructor - but how?
...
protected ValueHash () { base(null, null); }
yields:
error: too few arguments to function ‘g_hash_table_new_full’
protected ValueHash () { base(null, null); }
^
...but:
protected ValueHash () { base(null, null, null); }
yields:
error: Too many arguments, method `GLib.HashTable<string,GLib.Value?>'
does not take 3 arguments
protected ValueHash () { base(null, null, null); }
^^^^^^^^^^^^^^^^^^^^^^
NB: As gobject already defines a ValueArray in the GLib namespace, a
ValueHash would come in handy there, but incidentally this is defined in
libsoup-2.4, but I don't want to introduce a dependency on libsoup in my
code.
Thanks a lot for any hints,
-Franz
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]