OMNeT++ Simulation Library  5.6.1
cModule::SubmoduleIterator Class Reference

#include <cmodule.h>

Description

Iterates through the submodules of a compound module.

Usage:

for (cModule::SubmoduleIterator it(module); !it.end(); ++it) {
cModule *submodule = *it;
...
}

Public Member Functions

 SubmoduleIterator (const cModule *m)
 
void init (const cModule *m)
 
cModuleoperator* () const
 
_OPPDEPRECATED cModuleoperator() () const
 
bool end () const
 
SubmoduleIteratoroperator++ ()
 
SubmoduleIterator operator++ (int)
 
SubmoduleIteratoroperator-- ()
 
SubmoduleIterator operator-- (int)
 

Constructor & Destructor Documentation

◆ SubmoduleIterator()

SubmoduleIterator ( const cModule m)
inline

Constructor. It takes the parent module on which to iterate.

Member Function Documentation

◆ init()

void init ( const cModule m)
inline

Reinitializes the iterator.

◆ operator*()

cModule* operator* ( ) const
inline

Returns a pointer to the current module. Returns nullptr if the iterator has reached the end of the list.

◆ operator()()

_OPPDEPRECATED cModule* operator() ( ) const
inline

DEPRECATED. Use the * operator to access the object the iterator is at.

◆ end()

bool end ( ) const
inline

Returns true if the iterator reached the end of the list.

◆ operator++() [1/2]

SubmoduleIterator& operator++ ( )
inline

Prefix increment operator (++it). Moves the iterator to the next submodule. It has no effect if the iterator has reached either end of the list.

◆ operator++() [2/2]

SubmoduleIterator operator++ ( int  )
inline

Postfix increment operator (it++). Moves the iterator to the next submodule, and returns the iterator's previous state. It has no effect if the iterator has reached either end of the list.

◆ operator--() [1/2]

SubmoduleIterator& operator-- ( )
inline

Prefix decrement operator (–it). Moves the iterator to the previous submodule. It has no effect if the iterator has reached either end of the list.

◆ operator--() [2/2]

SubmoduleIterator operator-- ( int  )
inline

Postfix decrement operator (it–). Moves the iterator to the previous submodule, and returns the iterator's previous state. It has no effect if the iterator has reached either end of the list.


The documentation for this class was generated from the following file: