Iterates through submodules of a compound module. More...
#include <cmodule.h>
Public Member Functions | |
SubmoduleIterator (const cModule *m) | |
void | init (const cModule *m) |
cModule * | operator() () const |
bool | end () const |
cModule * | operator++ (int) |
Iterates through submodules of a compound module.
Example:
for (cModule::SubmoduleIterator i(modp); !i.end(); i++) { cModule *submodp = i(); ... }
cModule::SubmoduleIterator::SubmoduleIterator | ( | const cModule * | m | ) | [inline] |
Constructor.
It takes the parent module on which to iterate.
cModule* cModule::SubmoduleIterator::operator() | ( | ) | const [inline] |
Returns pointer to the current module.
The pointer then may be cast to the appropriate cModule subclass. Returns NULL if the iterator has reached the end of the list.
cModule* cModule::SubmoduleIterator::operator++ | ( | int | ) | [inline] |
Returns the current module, then moves the iterator to the next module.
Returns NULL if the iterator has already reached the end of the list.