Clink

Clinks are links that are always arranged in circular lists.

Members

Aliases

Ref
alias Ref = Type*
Undocumented in source.
Type
alias Type = Clink!(V)
Undocumented in source.

Functions

addNext
void addNext(V v, Ref delegate() alloc)

* Make a cell holding v and link it immediately after current cell

addPrev
Ref addPrev(V v, Ref delegate() alloc)

* make a node holding v, link it before the current cell, and return it

copyList
Ref copyList(Ref delegate() alloc)

* Make a copy of the list and return new head.

count
int count(V element)

* return the number of cells holding element found in a circular * traversal

find
Ref find(V element)

* return the first cell holding element found in a circular traversal starting * at current cell, or null if no such

linkNext
void linkNext(Ref p)
Undocumented in source. Be warned that the author may not have intended to support it.
linkPrev
void linkPrev(Ref p)

* link p before current cell

nth
Ref nth(size_t n)

* return the nth cell traversed from here. It may wrap around.

set
Ref set(V v)

Set to point to ourselves

set
Ref set(V v, Ref p, Ref n)

Set to point to n as next cell and p as the prior cell

singleton
bool singleton()

* Return true if current cell is the only one on the list

size
int size()

* return the number of cells in the list

unlink
void unlink()

* Unlink self from list it is in. * Causes it to be a singleton

unlinkNext
void unlinkNext()

* Unlink the next cell. * This has no effect on the list if isSingleton()

unlinkPrev
void unlinkPrev()

* Unlink the previous cell. * This has no effect on the list if isSingleton()

Variables

next
Ref next;
Undocumented in source.
prev
Ref prev;
Undocumented in source.
value
V value;
Undocumented in source.

Meta