Public Member Functions

dsim_connection_iterator Class Reference

Iterator for connections within a network. More...

List of all members.

Public Member Functions

dsim_connectionconnection ()
 Retrieves the connection associated with the iterator's current state.
dsim_connection_iteratornext ()
 Moves the iterator to the next connection in the set.
bool finished ()
 Determines whether or not the iterator now points to an invalid connection, indicating that the iteration has completed.

Detailed Description

Iterator for connections within a network.

Models can make use of a connection iterator, returned from dsim_network::connection_iterator(), to loop through the set of connections within a network.

It is important to note that the set of connections is in fact a set- it is not ordered in any fashion. If the controlling model would like to do any ordering on it, managing that order via the dsim_network::object_identifier() functon is the best way to go about it.

A dsim_connection_iterator is not a STL iterator. Do not attempt to use it in place of an STL iterator; such attempts will fail.


Member Function Documentation

dsim_connection* dsim_connection_iterator::connection (  ) [inline]

Retrieves the connection associated with the iterator's current state.

Returns:
The connection associated with the iterator's current state. If finished() would return true on this iterator, the return value is undefined.
bool dsim_connection_iterator::finished (  )

Determines whether or not the iterator now points to an invalid connection, indicating that the iteration has completed.

Once finished() returns true, next() should no longer be called on this iterator.

Returns:
true if the iterator has iterated over all of the connections, or false if not.
dsim_connection_iterator& dsim_connection_iterator::next (  ) [inline]

Moves the iterator to the next connection in the set.

The iterator object is mutated by this function call.

Returns:
A reference to the same iterator, after being updated to point to the next connection.
 All Classes Files Functions Typedefs Enumerations Enumerator