Class ZoneTreeIterator<TKey, TValue>
Inherited Members
Namespace: Tenray.ZoneTree.Core
Assembly: ZoneTree.dll
Syntax
public sealed class ZoneTreeIterator<TKey, TValue> : IZoneTreeIterator<TKey, TValue>, IDisposable
Type Parameters
| Name | Description |
|---|---|
| TKey | |
| TValue |
Constructors
| Improve this Doc View SourceZoneTreeIterator(ZoneTreeOptions<TKey, TValue>, ZoneTree<TKey, TValue>, IRefComparer<HeapEntry<TKey, TValue>>, bool, bool, bool, bool, bool, bool)
Declaration
public ZoneTreeIterator(ZoneTreeOptions<TKey, TValue> options, ZoneTree<TKey, TValue> zoneTree, IRefComparer<HeapEntry<TKey, TValue>> heapEntryComparer, bool autoRefresh, bool isReverseIterator, bool includeDeletedRecords, bool includeMutableSegment, bool includeDiskSegment, bool includeBottomSegments)
Parameters
| Type | Name | Description |
|---|---|---|
| ZoneTreeOptions<TKey, TValue> | options | |
| ZoneTree<TKey, TValue> | zoneTree | |
| IRefComparer<HeapEntry<TKey, TValue>> | heapEntryComparer | |
| bool | autoRefresh | |
| bool | isReverseIterator | |
| bool | includeDeletedRecords | |
| bool | includeMutableSegment | |
| bool | includeDiskSegment | |
| bool | includeBottomSegments |
Properties
| Improve this Doc View SourceAutoRefresh
If true, the iterator automatically refreshes itself to include the latest segments.
Declaration
public bool AutoRefresh { get; }
Property Value
| Type | Description |
|---|---|
| bool |
BottomSegments
Declaration
public IReadOnlyList<IDiskSegment<TKey, TValue>> BottomSegments { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<IDiskSegment<TKey, TValue>> |
Current
Gets the current element at the iterator's position.
Declaration
public KeyValuePair<TKey, TValue> Current { get; }
Property Value
| Type | Description |
|---|---|
| KeyValuePair<TKey, TValue> |
CurrentKey
Returns the element key if there is an element in the iterator position.
Declaration
public TKey CurrentKey { get; }
Property Value
| Type | Description |
|---|---|
| TKey |
CurrentValue
Returns the element value if there is an element in the iterator position.
Declaration
public TValue CurrentValue { get; }
Property Value
| Type | Description |
|---|---|
| TValue |
DiskSegment
Declaration
public IDiskSegment<TKey, TValue> DiskSegment { get; }
Property Value
| Type | Description |
|---|---|
| IDiskSegment<TKey, TValue> |
HasCurrent
Returns true if there is an element in the iterator position.
Declaration
public bool HasCurrent { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
| Improve this Doc View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Next()
Iterates to the next element.
Declaration
public bool Next()
Returns
| Type | Description |
|---|---|
| bool | true if next element exists, otherwise false. |
Refresh()
Refreshes the iterator with latest segments. If AutoRefresh property is true, there is no need to call refresh manually.
Declaration
public void Refresh()
Seek(in TKey)
Seeks the iterator to the position where next item is the key. If key does not exist, forward iterator's next item is the first greater item (prefix search forward). reverse iterator's next item is the last smaller item (prefix search backward). Complexity: O(log(N))
Declaration
public void Seek(in TKey key)
Parameters
| Type | Name | Description |
|---|---|---|
| TKey | key | The search key |
SeekFirst()
Seeks the first element of the iterator.
Declaration
public void SeekFirst()
WaitUntilReadOnlySegmentsBecomeFullyFrozen()
Declaration
public void WaitUntilReadOnlySegmentsBecomeFullyFrozen()