Click or drag to resize

Some types of content require some initial setup before random data can be generated. Other types of data benefit from some form of buffering when generating multiple instances of random data. In both of these cases, Generators can be useful, allowing the initial setup to only be performed once for a given set of parameters, and enabling any buffering behavior that needs to be performed.

Creating and Using Generators

For content that is likely to benefit from generators, there will be extension functions following the naming convention Make<function>Generator(). For example, MakeRangeOCGenerator(6) will return an IRangeGenerator<int> that will generate a number from 1 to 6 each time Next is called on the generator.

In general, generators will support a Next() method or similar method for generating random data. Some might include additional members, depending on the type of data being generated.

Support for Generators

The following types of random data have support for generators:

See Also