Move current result handling out of Base
Delete majority of Base functionality.
This commit is contained in:
parent
ee6d4c8db7
commit
375d953d93
14 changed files with 140 additions and 82 deletions
|
|
@ -36,6 +36,7 @@ type AllIterator struct {
|
|||
iter ldbit.Iterator
|
||||
ts *TripleStore
|
||||
ro *opt.ReadOptions
|
||||
result graph.Value
|
||||
}
|
||||
|
||||
func NewAllIterator(prefix string, d graph.Direction, ts *TripleStore) *AllIterator {
|
||||
|
|
@ -103,7 +104,7 @@ func (it *AllIterator) Clone() graph.Iterator {
|
|||
|
||||
func (it *AllIterator) Next() (graph.Value, bool) {
|
||||
if !it.open {
|
||||
it.Last = nil
|
||||
it.result = nil
|
||||
return nil, false
|
||||
}
|
||||
var out []byte
|
||||
|
|
@ -117,17 +118,25 @@ func (it *AllIterator) Next() (graph.Value, bool) {
|
|||
it.Close()
|
||||
return nil, false
|
||||
}
|
||||
it.Last = out
|
||||
it.result = out
|
||||
return out, true
|
||||
}
|
||||
|
||||
func (it *AllIterator) ResultTree() *graph.ResultTree {
|
||||
return graph.NewResultTree(it.Result())
|
||||
}
|
||||
|
||||
func (it *AllIterator) Result() graph.Value {
|
||||
return it.result
|
||||
}
|
||||
|
||||
// No subiterators.
|
||||
func (it *AllIterator) SubIterators() []graph.Iterator {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (it *AllIterator) Check(v graph.Value) bool {
|
||||
it.Last = v
|
||||
it.result = v
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue