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

simth::LinearLoopControl< T > Class Template Reference

Loop control that increments a value each iteration by a fixed addend. More...

#include <loopcontrol.h>

Inheritance diagram for simth::LinearLoopControl< T >:

simth::LoopControl< T > List of all members.

Public Member Functions

 LinearLoopControl (const std::string &name, T start, T end, T increment)
virtual ~LinearLoopControl ()
const std::string & name () const
virtual std::string currentIteration () const
virtual std::string lastIteration () const
value () const
virtual bool nextIteration ()
virtual void connectControlInterface (ControlInterface *interface)
virtual bool reachedEnd ()
virtual void reset ()

Detailed Description

template<class T>
class simth::LinearLoopControl< T >

Loop control that increments a value each iteration by a fixed addend.

The value is incremented each iteration until it reached a certain threshold. The type of the value is specified by the template argument T. Then nextIteration() and reachedEnd() returns false and true, respectivley. The connected control interfaces must belong to wrapped functions that takes one argument of the type specified by the template argument (see ControlInterfaces).


Constructor & Destructor Documentation

template<class T>
simth::LinearLoopControl< T >::LinearLoopControl const std::string &  name,
start,
end,
increment
 

Class Constructor

Parameters:
name name of the loop control
start start value
end end value
increment value which is added each iteration

template<class T>
simth::LinearLoopControl< T >::~LinearLoopControl  )  [virtual]
 


Member Function Documentation

template<class T>
const std::string& simth::LinearLoopControl< T >::name  )  const [inline, 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

Implements simth::LoopControl< T >.

template<class T>
std::string simth::LinearLoopControl< T >::currentIteration  )  const [inline, virtual]
 

Returns a string that describes the current iteration value.

Implements simth::LoopControl< T >.

template<class T>
std::string simth::LinearLoopControl< T >::lastIteration  )  const [inline, virtual]
 

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

Implements simth::LoopControl< T >.

template<class T>
T simth::LinearLoopControl< T >::value  )  const [inline]
 

template<class T>
bool simth::LinearLoopControl< T >::nextIteration  )  [inline, 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.

Implements simth::LoopControl< T >.

template<class T>
void simth::LinearLoopControl< T >::connectControlInterface ControlInterface interface  )  [inline, 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.

Implements simth::LoopControl< T >.

template<class T>
bool simth::LinearLoopControl< T >::reachedEnd  )  [inline, virtual]
 

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

Implements simth::LoopControl< T >.

template<class T>
void simth::LinearLoopControl< T >::reset  )  [inline, virtual]
 

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

Implements simth::LoopControl< T >.


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