|
Mac Dev Center
Mac OS X Reference Library Drivers, Kernel, & Hardware: Kernel Device Drivers Kernel Framework Reference
|
OSIterator |
| Inherits from: | |
| Declared In: |
The abstract superclass for Libkern iterators.
OSIterator is the abstract superclass for all Libkern C++ object iterators. It defines the basic interface for iterating and resetting. See OSCollection and OSCollectionIterator for more information.
With very few exceptions in the I/O Kit, all Libkern-based C++ classes, functions, and macros are unsafe to use in a primary interrupt context. Consult the I/O Kit documentation related to primary interrupts for more information.
OSIterator provides no concurrency protection.
Advances to and returns the next object in the iteration.
Check that the collection hasn't been modified during iteration.
Resets the iterator to the beginning of the collection, as if it had just been created.
getNextObject |
Advances to and returns the next object in the iteration.
public
virtual OSObject *getNextObject() = 0;
The next object in the iteration context,
NULL if there is no next object
or if the iterator is no longer valid.
The returned object will be released if removed from the collection;
if you plan to store the reference, you should call
retain
on that object.
Subclasses must implement this pure virtual function
to check for validity with
isValid,
and then to advance the iteration context to the next object (if any)
and return that next object, or NULL if there is none.
isValid |
Check that the collection hasn't been modified during iteration.
public
virtual bool isValid() = 0;
true if the iterator is valid for continued use,
false otherwise
(typically because the collection being iterated has been modified).
Subclasses must implement this pure virtual member function.
reset |
Resets the iterator to the beginning of the collection, as if it had just been created.
public
virtual void reset() = 0;
Subclasses must implement this pure virtual member function.
Last Updated: 2009-10-14