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

#include <cmodule.h>

Description

Iterates through the gates of a module.

Usage:

for (cModule::GateIterator it(module); !it.end(); ++it) {
cGate *gate = *it;
...
}

Public Member Functions

 GateIterator (const cModule *m)
 
void init (const cModule *m)
 
cGateoperator* () const
 
_OPPDEPRECATED cGateoperator() () const
 
bool end () const
 
GateIteratoroperator++ ()
 
GateIterator operator++ (int)
 

Constructor & Destructor Documentation

◆ GateIterator()

GateIterator ( const cModule m)
inline

Constructor. It takes the module on which to iterate.

Member Function Documentation

◆ init()

void init ( const cModule m)

Reinitializes the iterator.

◆ operator*()

cGate* operator* ( ) const
inline

Returns the current gate, or nullptr if the iterator is not at a valid position.

◆ operator()()

_OPPDEPRECATED cGate* operator() ( ) const
inline

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

◆ end()

bool end ( ) const

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

◆ operator++() [1/2]

GateIterator& operator++ ( )
inline

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

◆ operator++() [2/2]

GateIterator operator++ ( int  )
inline

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