Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public fields | Properties | Public Member Functions | Protected fields | List of all members
Loyc.Collections.AListBase< K, T >.Enumerator Class Reference

Source file:
Inheritance diagram for Loyc.Collections.AListBase< K, T >.Enumerator:
Loyc.Collections.AListBase< K, T > Loyc.Collections.IListSource< out T > Loyc.Collections.INotifyListChanging< T > Loyc.Collections.IListSource< out T > Loyc.Collections.INotifyListChanging< T > Loyc.Collections.ITryGet< in K, out V > Loyc.Collections.IIndexed< in K, out V > Loyc.Collections.INotifyListChanging< T, TCollection > Loyc.Collections.IIndexed< in K, out V > Loyc.Collections.ITryGet< in K, out V > Loyc.Collections.ISource< out T > Loyc.Collections.INotifyListChanging< T, TCollection > Loyc.Collections.IIndexed< in K, out V > Loyc.Collections.ITryGet< in K, out V > Loyc.Collections.ISource< out T >

Public fields

readonly uint FirstIndex
 
readonly uint StartIndex
 
- Public fields inherited from Loyc.Collections.AListBase< K, T >
int Count => (int)_count
 
bool IsEmpty => _count == 0
 
First => this[0]
 
bool IsFrozen => _freezeMode == FreezeMode.Frozen
 
AListReverseView< K, T > ReverseView => new AListReverseView<K
 

Properties

int CurrentIndex [get]
 Index of the last item that was enumerated. If has been enumerated yet, this will typically be one beyond the range of indexes with which this enumerator was initialized, e.g. -1 when enumerating the entire list from the beginning. More...
 
Current [get, set]
 
- Properties inherited from Loyc.Collections.AListBase< K, T >
virtual ListChangingHandler< T,
IListSource< T > > 
ListChanging
 Event for learning about changes in progress on a list. More...
 
byte TreeHeight [get]
 
Last [get]
 
this[int index] [get]
 
int ObserverCount [get]
 Returns the number of tree observers attached to this list. More...
 
- Properties inherited from Loyc.Collections.ISource< out T >
new int Count [get]
 Gets the number of items in the collection. More...
 
- Properties inherited from Loyc.Collections.ICount
int Count [get]
 Gets the number of items in the collection. More...
 
- Properties inherited from Loyc.Collections.IIsEmpty
bool IsEmpty [get]
 
- Properties inherited from Loyc.Collections.IIndexed< in K, out V >
this[K key] [get]
 Gets the value associated with the specified key. More...
 

Public Member Functions

void PrepareToStart ()
 
 Enumerator (Enumerator copy)
 
bool MoveNext ()
 
bool MovePrev ()
 
void Reset ()
 
void Dispose ()
 
- Public Member Functions inherited from Loyc.Collections.AListBase< K, T >
void RemoveAt (int index)
 
void RemoveRange (int index, int amount)
 
int RemoveAll (Predicate< T > match)
 Removes all the elements that match the conditions defined by the specified predicate. More...
 
virtual void Clear ()
 
IEnumerable< int > IndexesOf (T item)
 Returns a sequence of integers that represent the locations where a given item appears in the list. More...
 
virtual IEnumerable< int > IndexesOf (T item, int minIndex, int maxIndex)
 
int FirstIndexOf (T item, int startIndex, EqualityComparer< T >?comparer=null)
 Scans the list starting at startIndex and going upward, and returns the index of an item that matches the first argument. More...
 
int LinearScanFor (T item, int startIndex, EqualityComparer< T >?comparer=null)
 
void CopyTo (T[] array, int arrayIndex)
 
Enumerator GetEnumerator ()
 
Enumerator GetEnumerator (int startIndex)
 
Enumerator GetEnumerator (int start, int subcount)
 
Enumerator GetEnumerator (int start, int subcount, bool startAtEnd)
 
TryGet (int index, out bool fail)
 
virtual void Freeze ()
 Prevents further changes to the list. More...
 
Slice_< T > Slice (int start, int length)
 Returns a sub-range of this list. More...
 
int GetImmutableCount ()
 Diagnostic method. Returns the number of elements of the list that are located in immutable nodes, which will be copied if modified. Used by the test suite. More...
 
virtual long CountSizeInBytes (int sizeOfElement, int sizeOfKey=8)
 Tallies the memory use, in bytes, of the entire list including this object, the root node, all child nodes, and all arrays. More...
 
virtual bool AddObserver (IAListTreeObserver< K, T > observer)
 Attaches a tree observer to this object. More...
 
virtual bool RemoveObserver (IAListTreeObserver< K, T > observer)
 Removes a previously attached tree observer from this list. More...
 
- Public Member Functions inherited from Loyc.Collections.ITryGet< in K, out V >
TryGet (K key, out bool fail)
 Gets the item for the specified key or index, and does not throw an exception on failure. More...
 

Protected fields

readonly AListBase< K, T > _self
 
Pair< AListInnerBase< K, T >
, int >[] 
_stack
 
_current
 
ushort _expectedVersion
 
- Protected fields inherited from Loyc.Collections.AListBase< K, T >
uint _count
 
ushort _version
 
ushort _maxLeafSize
 
byte _maxInnerSize
 
byte _treeHeight
 
FreezeMode _freezeMode = FreezeMode.NotFrozen
 
int BaseClassSizeInBytes => IntPtr.Size * 5 + (IntPtr.Size <= 4 ? 12 : 16)
 

Additional Inherited Members

- Protected Member Functions inherited from Loyc.Collections.AListBase< K, T >
 AListBase (int maxNodeSize)
 
 AListBase (int maxLeafSize, int maxInnerSize)
 
 AListBase (AListBase< K, T > items, bool keepListChangingHandlers)
 Cloning constructor. Does not duplicate the observer (IAListTreeObserver{K,T}), if any, because it may not be cloneable. More...
 
 AListBase (AListBase< K, T > original, AListNode< K, T >?section)
 This is the constructor that CopySection(), which can be defined by derived classes, should call to create a sublist of a list. Used in conjunction with CopySectionHelper(). More...
 
abstract AListNode< K, T > NewRootLeaf ()
 
abstract AListInnerBase< K, T > SplitRoot (AListNode< K, T > left, AListNode< K, T > right)
 
virtual Enumerator NewEnumerator (uint start, uint firstIndex, uint lastIndex)
 
void CheckPoint ()
 
void AutoThrow ()
 
void AutoCreateOrCloneRoot ()
 
void AutoSplit (AListNode< K, T >?splitLeft, AListNode< K, T >?splitRight)
 
void HandleChangedOrUndersizedRoot (AListNode< K, T > result)
 
virtual void ClearInternal (bool forceClear)
 Clears the tree. More...
 
void ThrowIndexOutOfRange ()
 
AListNode< K, T > CopySectionHelper (int start, int subcount)
 Together with the AListBase{K,T}.AListBase(AListBase{K,T},AListNode{K,T}) constructor, this method helps implement the CopySection() method in derived classes, by cloning a section of the tree. More...
 
AListNode< K, T > CopySectionHelper (uint start, uint subcount)
 
void SwapHelper (AListBase< K, T > other, bool swapObservers)
 Swaps two ALists. More...
 
- Events inherited from Loyc.Collections.INotifyListChanging< T, TCollection >
ListChangingHandler< T,
TCollection > 
ListChanging
 Occurs when the collection associated with this interface is about to change. More...
 

Property Documentation

int Loyc.Collections.AListBase< K, T >.Enumerator.CurrentIndex
get

Index of the last item that was enumerated. If has been enumerated yet, this will typically be one beyond the range of indexes with which this enumerator was initialized, e.g. -1 when enumerating the entire list from the beginning.