get_length


Description:

[ Version ( since = "2.4" ) ]
public uint get_length ()

Returns the number of items in this.

Example: Get the length:

public static int main () {
Queue<string> queue = new Queue<string> ();
queue.push_tail ("1");
queue.push_tail ("2");
queue.push_tail ("3");

// Output:
// ``1 (len: 2)``
// ``2 (len: 1)``
// ``3 (len: 0)``
string item = null;
while ((item = queue.pop_head ()) != null) {
print ("%s (len: %u)\n", item, queue.get_length ());
}

return 0;
}

valac --pkg glib-2.0 GLib.Queue.get_length.vala

Parameters:

this

a Queue

Returns:

the number of items in this