ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference

 


OSCollectionIterator

Inherits from:
Declared In:

Overview

OSCollectionIterator objects provide a consistent mechanism to iterate through all OSCollection-derived collections.



Functions

free

Releases and deallocates all resources created or used by the OSCollectionIterator object.

getNextObject

Gets the next object in the collection being iterated.

initWithCollection

Initializes the intance of OSCollectionIterator with the provided colleciton object.

isValid

Determines if the collection was modified during iteration.

reset

Resets the iterator to begin the next iteration from the beginning of the collection.

withCollection(const OSCollection *)

Creates and initializes an instance of OSCollectionIterator for the provided collection object.

withCollection(const OSCollection *)

Initializes the intance of OSCollectionIterator with the provided colleciton object.


free


Releases and deallocates all resources created or used by the OSCollectionIterator object.

public

virtual void free();
Discussion

This function should not be called directly, use release() instead.


getNextObject


Gets the next object in the collection being iterated.

public

virtual OSObject *getNextObject();
Return Value

Returns the next object in the collection or 0 when the end has been reached.


initWithCollection


Initializes the intance of OSCollectionIterator with the provided colleciton object.

public

virtual bool initWithCollection( const OSCollection *inColl);
Parameters
inColl

The OSCollection-derived collection object to be iteratated.

Return Value

Returns true if the initialization was successful or false on failure.


isValid


Determines if the collection was modified during iteration.

public

virtual bool isValid();


reset


Resets the iterator to begin the next iteration from the beginning of the collection.

public

virtual void reset();


withCollection(const OSCollection *)


Creates and initializes an instance of OSCollectionIterator for the provided collection object.

public

static OSCollectionIterator *withCollection( const OSCollection *inColl);
Parameters
inColl

The OSCollection-derived collection object to be iteratated.

Return Value

Returns a new instance of OSCollection or 0 on failure.


withCollection(const OSCollection *)


Initializes the intance of OSCollectionIterator with the provided colleciton object.

public

virtual bool initWithCollection( const OSCollection *inColl);
Parameters
inColl

The OSCollection-derived collection object to be iteratated.

Return Value

Returns true if the initialization was successful or false on failure.


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.

 

Last Updated: 2008-12-19