Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

simth::LoopControl< T > Class Template Reference

Loop controls are used to control the process flow of a simulation run. More...

#include <loopcontrol.h>

Inheritance diagram for simth::LoopControl< T >:

simth::CounterLoopControl simth::LinearLoopControl< T > List of all members.

Public Member Functions

 LoopControl ()
virtual ~LoopControl ()
virtual const std::string & name () const =0
virtual std::string currentIteration () const =0
virtual std::string lastIteration () const =0
virtual bool nextIteration ()=0
virtual void connectControlInterface (ControlInterface *interface)=0
virtual bool reachedEnd ()=0
virtual void reset ()=0

Detailed Description

template<class T>
class simth::LoopControl< T >

Loop controls are used to control the process flow of a simulation run.

This abstract class is the base class of all loop controls. When processing the function next iteration, a derived class should (or must) call the function callFunc() of the connected control interfaces in order to invoke the functions wrapped by these control interfaces. A wrapped function with a certain argument list needs a certain loop control it is connected with, because the loop control has to consider this argument list when calling the wrapped function. Until now, argument lists with none and with one arbitrary argument are considered.

See also:
loopcontrol.h


Constructor & Destructor Documentation

template<class T>
simth::LoopControl< T >::LoopControl  )  [inline]
 

Default Constructor

template<class T>
virtual simth::LoopControl< T >::~LoopControl  )  [inline, virtual]
 

Default Destructor


Member Function Documentation

template<class T>
virtual const std::string& simth::LoopControl< T >::name  )  const [pure virtual]
 

Each loop control has a unique name to be adressed in a simulation system.

Returns:
name of the loop control in the simulation system

Implemented in simth::CounterLoopControl, and simth::LinearLoopControl< T >.

template<class T>
virtual std::string simth::LoopControl< T >::currentIteration  )  const [pure virtual]
 

Returns a string that describes the current iteration value.

Implemented in simth::CounterLoopControl, and simth::LinearLoopControl< T >.

template<class T>
virtual std::string simth::LoopControl< T >::lastIteration  )  const [pure virtual]
 

Returns a string that describes the last iteration value, i.e. the iteration value when reachedEnd() equals true.

Implemented in simth::CounterLoopControl, and simth::LinearLoopControl< T >.

template<class T>
virtual bool simth::LoopControl< T >::nextIteration  )  [pure virtual]
 

In derived classes the implemented functions must provide the following behaviour:

Proceed to the next iteration step. If the loop control does not reach its end, it returns true and calls the function of all connected loop interfaces. If it reaches its end, it returns false and does not call any function of the connected loop interfaces.

Implemented in simth::CounterLoopControl, and simth::LinearLoopControl< T >.

template<class T>
virtual void simth::LoopControl< T >::connectControlInterface ControlInterface interface  )  [pure virtual]
 

Connect the loop control to a ControlInterface: each time the function nextIteration() is called, the function of a Device that is wrapped by the given ControlInterface is called also. (This is similar to the signal slot concept of QT.)

Parameters:
interface pointer to ControlInterface that wrapps a function.

Implemented in simth::CounterLoopControl, and simth::LinearLoopControl< T >.

template<class T>
virtual bool simth::LoopControl< T >::reachedEnd  )  [pure virtual]
 

Request the state of the loop control. Returns true if the last iteration has been executed.

Implemented in simth::CounterLoopControl, and simth::LinearLoopControl< T >.

template<class T>
virtual void simth::LoopControl< T >::reset  )  [pure virtual]
 

Reset the state of the loop control to its starting state and calls the functions of the connected loop interface.

Implemented in simth::CounterLoopControl, and simth::LinearLoopControl< T >.


Generated on Mon Apr 24 21:19:19 2006 for simthetic by  doxygen 1.4.1