cModule::GateIterator Class Reference

Iterates through the gates of a module. More...

#include <cmodule.h>

List of all members.

Public Member Functions

 GateIterator (const cModule *m)
void init (const cModule *m)
cGateoperator() () const
bool end () const
cGateoperator++ (int)
cGateoperator+= (int k)

Detailed Description

Iterates through the gates of a module.

Example:

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

Constructor & Destructor Documentation

cModule::GateIterator::GateIterator ( const cModule m  )  [inline]

Constructor.

It takes the module on which to iterate.


Member Function Documentation

cGate* cModule::GateIterator::operator() (  )  const [inline]

Returns a pointer to the current gate.

Only returns NULL if the iterator has reached the end of the list.

cGate* cModule::GateIterator::operator++ ( int   ) 

Returns the current gate, then moves the iterator to the next gate.

Only returns NULL if the iterator has already reached the end of the list.

cGate* cModule::GateIterator::operator+= ( int  k  ) 

Advances the iterator by k gates.

Equivalent to calling "++" k times, but more efficient.


The documentation for this class was generated from the following file:
Generated on Tue Dec 2 11:16:29 2014 for OMNeT++ Simulation Library by  doxygen 1.6.3