MCPcopy
hub / github.com/cayleygraph/cayley / NewRecursive

Function NewRecursive

graph/iterator/recursive.go:29–37  ·  view source on GitHub ↗
(sub graph.Iterator, morphism Morphism, maxDepth int)

Source from the content-addressed store, hash-verified

27var DefaultMaxRecursiveSteps = 50
28
29func NewRecursive(sub graph.Iterator, morphism Morphism, maxDepth int) *Recursive {
30 it := &Recursive{
31 it: newRecursive(graph.AsShape(sub), func(it graph.IteratorShape) graph.IteratorShape {
32 return graph.AsShape(morphism(graph.AsLegacy(it)))
33 }, maxDepth),
34 }
35 it.Iterator = graph.NewLegacy(it.it, it)
36 return it
37}
38
39func (it *Recursive) AddDepthTag(s string) {
40 it.it.AddDepthTag(s)

Callers 4

followRecursiveMorphismFunction · 0.92
TestRecursiveNextFunction · 0.85
TestRecursiveContainsFunction · 0.85
TestRecursiveNextPathFunction · 0.85

Calls 5

AsShapeFunction · 0.92
AsLegacyFunction · 0.92
NewLegacyFunction · 0.92
newRecursiveFunction · 0.85
morphismStruct · 0.85

Tested by 3

TestRecursiveNextFunction · 0.68
TestRecursiveContainsFunction · 0.68
TestRecursiveNextPathFunction · 0.68