> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor/ks.reactor.ksatomiclist-1/ks.reactor.ksatomiclist-1.iterator.md).

# Class ksAtomicList\<T>.Iterator

Namespace: [KS.Reactor](/reactor/api-reference/ks.reactor.md)\
Assembly: KSCommon.dll

Holds index and value data used when iterating an atomic list.

```csharp
public class ksAtomicList<T>.Iterator : IEnumerable<T>, IEnumerable
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [ksAtomicList\<T>.Iterator](/reactor/api-reference/ks.reactor/ks.reactor.ksatomiclist-1/ks.reactor.ksatomiclist-1.iterator.md)

#### Implements

[IEnumerable\<T>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1), [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Fields

### Index <a href="#ks_reactor_ksatomiclist_1_iterator_index" id="ks_reactor_ksatomiclist_1_iterator_index"></a>

The index being iterated.

```csharp
public int Index
```

#### Field Value

[int](https://learn.microsoft.com/dotnet/api/system.int32)

### Value <a href="#ks_reactor_ksatomiclist_1_iterator_value" id="ks_reactor_ksatomiclist_1_iterator_value"></a>

The value at the current index.

```csharp
public T Value
```

#### Field Value

T

## Methods

### GetEnumerator() <a href="#ks_reactor_ksatomiclist_1_iterator_getenumerator" id="ks_reactor_ksatomiclist_1_iterator_getenumerator"></a>

Iterates the list from the beginning. Can be used to safely iterate while other threads are iterating and/or modifying the list.

```csharp
public IEnumerator<T> GetEnumerator()
```

#### Returns

[IEnumerator](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1)\<T>

Enumerator

### Next() <a href="#ks_reactor_ksatomiclist_1_iterator_next" id="ks_reactor_ksatomiclist_1_iterator_next"></a>

Advances to the next value in the list. Can be used to safely iterate while other threads are iterating and/or modifying the list.

```csharp
public bool Next()
```

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)
