---
title: initIterator
framework: kernel
role: pseudoSymbol
path: kernel/oscollection/1808258-inititerator
---

# initIterator

Initializes the iteration context for a collection subclass.

## Declaration

```occ
virtual bool initIterator(
 void *iterationContext) const = 0; 
```

## Parameters

- `iterationContext`: The iteration context to initialize.

## Return Value

Return Value true if initialization was successful, false otherwise.

## Overview

Overview This pure virtual member function, which subclasses must implement, is called by an OSCollectionIterator object to initialize an iteration context for a collection. The collection object should interpret iterationContext appropriately and initialize its contents to begin an iteration. This function can be called repeatedly for a given context, whenever the iterator is reset via the OSCollectionIterator::reset function.

## See Also

### Miscellaneous

- [copyCollection](kernel/oscollection/1808206-copycollection.md)
- [ensureCapacity](kernel/oscollection/1808212-ensurecapacity.md)
- [flushCollection](kernel/oscollection/1808219-flushcollection.md)
- [getCapacity](kernel/oscollection/1808225-getcapacity.md)
- [getCapacityIncrement](kernel/oscollection/1808233-getcapacityincrement.md)
- [getCount](kernel/oscollection/1808238-getcount.md)
- [getNextObjectForIterator](kernel/oscollection/1808244-getnextobjectforiterator.md)
- [haveUpdated](kernel/oscollection/1808248-haveupdated.md)
- [init](kernel/oscollection/1808252-init.md)
- [iteratorSize](kernel/oscollection/1808262-iteratorsize.md)
- [setCapacityIncrement](kernel/oscollection/1808267-setcapacityincrement.md)
