Re: [Vala] Re-entrant/Nested Iterator..
- From: Shawn Ferris <shawn ferris gmail com>
- To: Vala-list <Vala-list gnome org>
- Subject: Re: [Vala] Re-entrant/Nested Iterator..
- Date: Sat, 26 Nov 2011 01:05:15 -0700
On Fri, Nov 25, 2011 at 9:31 PM, Shawn Ferris <shawn ferris gmail com> wrote:
..snip..
class Query {
class Iterator {
next() {
.. step over query ..
if (Sqlite.DONE) return false;
if ( record.linked_child != null ) {
child = new Query(record.linked_child);
nested = true;
}
if ( nested ) {
var ret = child.next();
if ( ! ret ) nested = false;
}
return true
}
get() {
if ( nested) return child.get();
return record;
}
}
}
But, it wasn't immediately obvious to me that the nested "query"
object wouldn't expose the next and get methods. I gotta believe this
is possible, but I'm surely not seeing the solution. (an elegant one
anyway) OR, if someone knows a better way to do this, I'm all ears..
Ugh.. I said it right, but implemented it wrong.. I just needed to
Instantiate the "Iterator" like I said.. not "Query"! (And re-arrange
my next logic)
I'd still be interested if there's a better way..
Shawn :D
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]