Issie logo Issie

IdAllocator Module

The uuid generator's replacement: integer id allocation, lowest unallocated first.

Types

Type Description

Allocator

Which integers are taken, one flag per value: assignment is a first-zero scan from a cursor that only advances, so ids come out dense and seeding is one pass.

Functions and values

Function or value Description

componentIdUsed arg1

Full Usage: componentIdUsed arg1

Parameters:
Returns: bool
arg0 : ComponentId
Returns: bool

isUsed alloc id

Full Usage: isUsed alloc id

Parameters:
Returns: bool
alloc : Allocator
id : int
Returns: bool

makeAllocator initialSize

Full Usage: makeAllocator initialSize

Parameters:
    initialSize : int

Returns: Allocator

Allocators are cheap: sheet-scoped ones are made, seeded and dropped per operation.

initialSize : int
Returns: Allocator

newComponentId ()

Full Usage: newComponentId ()

Parameters:
    () : unit

Returns: ComponentId

A fresh component id, unique across the open design.

() : unit
Returns: ComponentId

newConnectionId ()

Full Usage: newConnectionId ()

Parameters:
    () : unit

Returns: ConnectionId

A fresh connection id; as newPortId, over-unique by construction.

() : unit
Returns: ConnectionId

newPortId ()

Full Usage: newPortId ()

Parameters:
    () : unit

Returns: PortId

A fresh port id. Unique across the design in practice (one allocator serves every sheet), though only uniqueness within a sheet is required of it.

() : unit
Returns: PortId

next alloc

Full Usage: next alloc

Parameters:
Returns: int

The smallest unused positive integer, marked taken as it is handed out.

alloc : Allocator
Returns: int

reserve alloc id

Full Usage: reserve alloc id

Parameters:

Mark an id as taken. Sentinels (0 and below) are ignored.

alloc : Allocator
id : int

reserveComponentId arg1

Full Usage: reserveComponentId arg1

Parameters:
arg0 : ComponentId

reserveConnectionId arg1

Full Usage: reserveConnectionId arg1

Parameters:
arg0 : ConnectionId

reservePortId arg1

Full Usage: reservePortId arg1

Parameters:
arg0 : PortId

reset alloc

Full Usage: reset alloc

Parameters:
alloc : Allocator

resetAll ()

Full Usage: resetAll ()

Parameters:
    () : unit

() : unit

Type something to start searching.