Skip to content

Theraot.Collections.Specialized.FlagArray

Alfonso J. Ramos edited this page Nov 10, 2015 · 1 revision

FlagArray

This calss is an alternative to BitArray. Internally uses an int array to keep the flags, the length constructor parameters is the minimun length of the internal array, not the number of flags.

Intead of providing bool operations like BitArray does, FlagArray provides list operations such as Contains and IndexOf. Reading and writing a single index is thread safe, and the modification will not invalidate any current enumerator.

In addition to that you can use the Flags property to get an IEnumerator<int> that allows you to iterate over all the indexes that have a true value.

FlagArray is internally used as part of the implementation of the memory transactions.