StackNumberAllocator:
Filter:
Classes | Control

StackNumberAllocator : Object

consecutive number allocator
Source: Engine.sc

Description

Number allocator within a specified range.

Class Methods

StackNumberAllocator.new(lo, hi)

make a new instance, with lo and hi values.

Arguments:

lo

initial value

hi

maximum

Inherited class methods

Instance Methods

.init

Reset allocator to its initial state.

.alloc

Allocate next number. After hi value returns nil.

.free(inIndex)

Set the next value of the allocator to the arbitrary inIndex (could be any object). Then continue with the counter.

Arguments:

inIndex

Inherited instance methods

Examples