Table of Contents

Class RecursiveGenerator<T>

Namespace
Hegel
Assembly
Hegel.dll

Draws recursive structures: a base case, extended by a function a bounded number of times.

public sealed class RecursiveGenerator<T> : PrintableGenerator<T>

Type Parameters

T
Inheritance
RecursiveGenerator<T>
Inherited Members

Fields

DefaultMaxDepth

The depth a recursive draw may reach unless MaxDepth(int) says otherwise.

public const int DefaultMaxDepth = 32

Field Value

int

DefaultMaxLeaves

The number of leaves a recursive draw may have unless MaxLeaves(int) says otherwise.

public const int DefaultMaxLeaves = 100

Field Value

int

Properties

Label

The span label the engine files this generator's draws under. Defaults to a label derived from the class's full name.

public override ulong Label { get; }

Property Value

ulong

Methods

DoDraw(TestCase)

Draw one value. Called inside a span labelled Label: draw from another generator through DrawSilent<T>(Generator<T>), which opens its span, rather than by calling its hook.

protected override T DoDraw(TestCase tc)

Parameters

tc TestCase

Returns

T

DoDrawAndPrint(TestCase, Printer)

Draw one value, printing it to printer (which may be Noop). Draw its parts through DrawAndPrint<T>(Generator<T>, Printer).

protected override T DoDrawAndPrint(TestCase tc, Printer printer)

Parameters

tc TestCase
printer Printer

Returns

T

MaxDepth(int)

Recurse at most maxDepth levels.

public RecursiveGenerator<T> MaxDepth(int maxDepth)

Parameters

maxDepth int

Returns

RecursiveGenerator<T>

MaxLeaves(int)

Draw at most maxLeaves base cases.

public RecursiveGenerator<T> MaxLeaves(int maxLeaves)

Parameters

maxLeaves int

Returns

RecursiveGenerator<T>