OMNeT++ API 6.1
Discrete Event Simulation Library
cModule::ChannelIterator Class Reference

Description

Walks along the channels inside a module, that is, the channels among the module and its submodules.

This is the same set of channels whose getParentModule() would return the iterated module.

Usage:

for (cModule::ChannelIterator it(module); !it.end(); ++it) {
cChannel *channel = *it;
...
}

Public Member Functions

 ChannelIterator (const cModule *module)
 
void reset ()
 
cChanneloperator* () const
 
bool end () const
 
ChannelIteratoroperator++ ()
 
ChannelIterator operator++ (int)
 

Constructor & Destructor Documentation

◆ ChannelIterator()

ChannelIterator ( const cModule module)
inline

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

Member Function Documentation

◆ reset()

void reset ( )

Reinitializes the iterator.

◆ operator*()

cChannel* operator* ( ) const
inline

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

◆ end()

bool end ( ) const
inline

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

◆ operator++() [1/2]

ChannelIterator& operator++ ( )
inline

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

◆ operator++() [2/2]

ChannelIterator operator++ ( int  )
inline

Postfix increment operator (it++). Moves the iterator to the next channel, 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: