Move iterators into separate package

Also reduce API exposure and use standard library more - and fix bugs I
previously introduces in mongo.
This commit is contained in:
kortschak 2014-06-30 22:22:50 +09:30
parent 88be6bee37
commit 1768e593a8
62 changed files with 3240 additions and 3130 deletions

View file

@ -22,10 +22,11 @@ import (
"github.com/petar/GoLLRB/llrb"
"github.com/google/cayley/graph"
"github.com/google/cayley/graph/iterator"
)
type Iterator struct {
graph.BaseIterator
iterator.Base
tree *llrb.LLRB
data string
isRunning bool
@ -53,7 +54,7 @@ func IterateOne(tree *llrb.LLRB, last Int64) Int64 {
func NewLlrbIterator(tree *llrb.LLRB, data string) *Iterator {
var it Iterator
graph.BaseIteratorInit(&it.BaseIterator)
iterator.BaseInit(&it.Base)
it.tree = tree
it.iterLast = Int64(-1)
it.data = data