ColaStore<T>.Iterator

Namespace: SnowBank.Collections.CacheOblivious · class

Iterator for scanning the contents of a ColaStore

Properties

Current

T Current { get; }

Value of the current entry

Direction

int Direction { get; }

Direction of the last operation

Valid

bool Valid { get; }

Checks if the current position of the iterator is valid

Methods

Debug_Dump

void Debug_Dump(string label = null)

Writes the internal state of this iterator into a log, for debugging purpose [DEBUG ONLY]

Next

bool Next()

Move the cursor the smallest value that is greater than the current value

bool Next(out T value)

Move the cursor the smallest value that is greater than the current value

  • value — Receives the next value

Previous

bool Previous()

Move the cursor the largest value that is smaller than the current value

Seek

bool Seek(T item, bool orEqual)

Seek the iterator at the smallest value that is less (or equal) to the desired item

  • item — Item to seek to
  • orEqual — When item exists: if true, then seek to this item. If false, seek to the previous entry.

SeekAfterLast

void SeekAfterLast()

Set the cursor just before the first key in the store

SeekBeforeFirst

void SeekBeforeFirst()

Set the cursor just before the first key in the store

SeekFirst

bool SeekFirst()

Seek the cursor to the smallest key in the store

SeekLast

bool SeekLast()

Seek the cursor to the largest key in the store