Move UID handling from Base
Also clean up some of the value creation code.
This commit is contained in:
parent
1604dca737
commit
01b7278c3a
13 changed files with 198 additions and 92 deletions
|
|
@ -41,6 +41,7 @@ import (
|
|||
// `next_it` is the tempoarary iterator held per result in `primary_it`.
|
||||
type LinksTo struct {
|
||||
Base
|
||||
uid uint64
|
||||
tags graph.Tagger
|
||||
ts graph.TripleStore
|
||||
primaryIt graph.Iterator
|
||||
|
|
@ -51,15 +52,21 @@ type LinksTo struct {
|
|||
// Construct a new LinksTo iterator around a direction and a subiterator of
|
||||
// nodes.
|
||||
func NewLinksTo(ts graph.TripleStore, it graph.Iterator, d graph.Direction) *LinksTo {
|
||||
var lto LinksTo
|
||||
lto := LinksTo{
|
||||
uid: NextUID(),
|
||||
ts: ts,
|
||||
primaryIt: it,
|
||||
dir: d,
|
||||
nextIt: &Null{},
|
||||
}
|
||||
BaseInit(<o.Base)
|
||||
lto.ts = ts
|
||||
lto.primaryIt = it
|
||||
lto.dir = d
|
||||
lto.nextIt = &Null{}
|
||||
return <o
|
||||
}
|
||||
|
||||
func (it *LinksTo) UID() uint64 {
|
||||
return it.uid
|
||||
}
|
||||
|
||||
func (it *LinksTo) Reset() {
|
||||
it.primaryIt.Reset()
|
||||
if it.nextIt != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue