#include <loopcontrol.h>
Inheritance diagram for simth::LinearLoopControl< T >:
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 |
T | value () const |
virtual bool | nextIteration () |
virtual void | connectControlInterface (ControlInterface *interface) |
virtual bool | reachedEnd () |
virtual void | reset () |
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).
|
Class Constructor
|
|
|
|
Each loop control has a unique name to be adressed in a simulation system.
Implements simth::LoopControl< T >. |
|
Returns a string that describes the current iteration value. Implements simth::LoopControl< T >. |
|
Returns a string that describes the last iteration value, i.e. the iteration value when reachedEnd() equals true. Implements simth::LoopControl< T >. |
|
|
|
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 >. |
|
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.)
Implements simth::LoopControl< T >. |
|
Request the state of the loop control. Returns true if the last iteration has been executed. Implements simth::LoopControl< T >. |
|
Reset the state of the loop control to its starting state and calls the functions of the connected loop interface. Implements simth::LoopControl< T >. |