Skip to content
This repository
tree: 3d7999ae0b
Fetching contributors…

Cannot retrieve contributors at this time

file 43 lines (37 sloc) 1.018 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
/* Iterator Base Class
    This is a base for making iterator subclasses.
    You cannot use this class directly. Use a subclass instead
*/
class Rosella.IteratorBase
{
    var data;

    // Determine if the iterator has more data.
    function get_bool[vtable]()
    {
        return self.data != null && elements(self.data) > 0;
    }

    // Get a string from the iterator
    function shift_string[vtable]()
    {
        Rosella.Error.must_subclass(__CLASS__);
    }

    // Get a PMC from the iterator
    function shift_pmc[vtable]()
    {
        Rosella.Error.must_subclass(__CLASS__);
    }

    // Get an integer from the iterator
    function shift_integer[vtable]()
    {
        Rosella.Error.must_subclass(__CLASS__);
    }

    // IteratorBase does "iterator"
    function does[vtable](string role)
    {
        if (role == "iterator")
            return true;
        return false;
    }

    // do nothing. IteratorBase does not do reversing
    function set_integer_native[vtable](int dummy) { }
}
Something went wrong with that request. Please try again.