class Crowbar::Context

Overview

Execution context passed to mutators, selectors, and rules. Manages the deterministic PRNG, iteration counter, and current metadata trail.

Defined in:

crowbar/context.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(seed : UInt64 = PRNG.default_seed) #

Instance Method Detail

def add_sample(buf : Buffer) : Nil #

def begin_iteration(input_size : Int32) : Metadata #

def current_metadata : Metadata | Nil #

def current_metadata=(current_metadata : Metadata | Nil) #

def iteration : Int64 #

def iteration=(iteration : Int64) #

def prng : PRNG #

def record_mutation(name : String, range : Tuple(Int32, Int32) | Nil = nil, description : String | Nil = nil) #

def record_step(category : StepCategory, name : String, description : String, range : Tuple(Int32, Int32) | Nil = nil, diff_bytes : Int32 = 0, details : Hash(String, String) = Hash(String, String).new) : TransformationStep | Nil #

def secondary_samples : Array(Buffer) #

def secondary_samples=(secondary_samples : Array(Buffer)) #

def seed : UInt64 #

def seed=(new_seed : UInt64) #

def seek(offset : Int) : Nil #