implementation of an algorithm, non generated checking code. More...
#include <AlgoImpl.h>
Public Member Functions | |
AlgoImpl (AlgoPos *, std::string label) | |
subclass must provide a similar constructor and call this one More... | |
Protected Member Functions | |
virtual bool | checkParameters ()=0 |
subclass must check the supplied parameters ParE_, ParS_ More... | |
virtual void | checkTermination () |
for algorithms with incr_==0 the algorithm must check whether to terminate More... | |
virtual int | copyno () const |
copy-number calculation More... | |
virtual DDRotationMatrix | rotation ()=0 |
subclass must calculate a rotation matrix More... | |
void | terminate () |
stop the current iteration of the algorithm (for incr_==0 types of algorithms) More... | |
virtual DD3Vector | translation ()=0 |
subclass must calculate a translation std::vector More... | |
virtual | ~AlgoImpl () |
Static Protected Member Functions | |
static std::string | d2s (double x) |
ahh, converts a double into a std::string ... yet another one of this kind! More... | |
Protected Attributes | |
const int & | count_ |
const int & | curr_ |
const int & | end_ |
std::string & | err_ |
const int & | incr_ |
std::string | label_ |
parE_type & | ParE_ |
parS_type & | ParS_ |
const int & | start_ |
bool & | terminate_ |
Friends | |
class | AlgoPos |
implementation of an algorithm, non generated checking code.
objects of this class must register themselves with the representation of the algorithm AlgoPos.
All methods will be called appropriately by AlgoPos.
Definition at line 19 of file AlgoImpl.h.
AlgoImpl::AlgoImpl | ( | AlgoPos * | al, |
std::string | label | ||
) |
subclass must provide a similar constructor and call this one
Definition at line 6 of file AlgoImpl.cc.
References AlgoPos::registerAlgo().
|
protectedvirtual |
Definition at line 18 of file AlgoImpl.cc.
|
protectedpure virtual |
subclass must check the supplied parameters ParE_, ParS_
whether they are correct and should select this paricular algorithm.
If the parameters are correct by should not select this particular algorithm, checkParamters must return false otherwise true.
The std::string err_ is to be used to be extended with error information in case any errors have been detected. Error information must be attached to err_ because of the possibility of already contained error information.
In case of errors: If an DDException is thrown by the algorithm implementation, further processing of any other implementations of the algorithm will be stopped. If no exception is thrown, checkParamters must return false. It's preferable not to throw an exception in case of errors. The algorithm implementation will throw if all checkParamters() of all registered algorithm implementations have returned false.
Implemented in global_simpleAngular_2, global_simpleAngular_1, global_linear_1, global_simpleAngular_0, global_linear_0, and global_angular_0.
|
protectedvirtual |
for algorithms with incr_==0 the algorithm must check whether to terminate
Overload this function in case the algorithm is a 'incr_==0' type. In this case provide some code which checks using perhaps the value of count_ and/or supplied algorithm parameters to check whether terminate() has to be called or not. If terminate() is called, the current iteration of the algorithm is not taken into account!
The default implementation will immidiately terminate the algorithm in case incr_==0.
In case of incr_!=0: checkTermination() is not called at all; the algorithm will terminate automatically when the specified range [start_, end_, incr_] has been covered or terminate() has been called from within translation() or rotation().
Reimplemented in global_simpleAngular_2, global_simpleAngular_1, global_simpleAngular_0, and global_angular_0.
Definition at line 34 of file AlgoImpl.cc.
References terminate().
Referenced by AlgoPos::checkTermination().
|
protectedvirtual |
copy-number calculation
In case incr_==0 it makes sense to overload this method, otherwise the invocation-count count_ will be returned as copy-number
If incr_ !=0 the copy-number will be curr_, the actual position in the range [start_,end_,incr_], unless this methods is overloaded.
Reimplemented in global_angular_0.
Definition at line 22 of file AlgoImpl.cc.
References count_, curr_, and incr_.
Referenced by global_angular_0::copyno(), and AlgoPos::copyno().
|
staticprotected |
ahh, converts a double into a std::string ... yet another one of this kind!
Definition at line 40 of file AlgoImpl.cc.
Referenced by global_angular_0::checkParameters(), and AlgoPos::setParameters().
|
protectedpure virtual |
subclass must calculate a rotation matrix
depending on the current position curr_ in the range [start_,end_,incr_] and the user supplied parameters ParE_, ParS_
Implemented in global_simpleAngular_2, global_simpleAngular_1, global_linear_1, global_simpleAngular_0, global_linear_0, and global_angular_0.
Referenced by AlgoPos::rotation().
|
protected |
stop the current iteration of the algorithm (for incr_==0 types of algorithms)
terminate() should be called in translation() or rotation() whenever the algorithm detects its termination condition. The current iteration of the algorithm then is not taken into account for algorithmic positioning.
If the algorithm is of type incr_ != 0 it will terminate automatically after its range [start_,end_,incr_] has been covered unless the algorithm calls terminate() from within translation() or rotation().
If the algorithm is of type incr_ == 0 the algorithm implementation has to provide code in checkTermination() which must call terminate() when it detects a termination condition (depending on the invocation-count of the algorithm , ...)
Definition at line 28 of file AlgoImpl.cc.
References terminate_.
Referenced by global_angular_0::checkTermination(), global_simpleAngular_0::checkTermination(), global_simpleAngular_1::checkTermination(), checkTermination(), and global_simpleAngular_2::checkTermination().
|
protectedpure virtual |
subclass must calculate a translation std::vector
depending on the current position curr_ in the range [start_,end_,incr_] and the user supplied parameters ParE_, ParS_
Implemented in global_simpleAngular_2, global_simpleAngular_1, global_linear_1, global_simpleAngular_0, global_linear_0, and global_angular_0.
Referenced by AlgoPos::translation().
|
friend |
Definition at line 21 of file AlgoImpl.h.
|
protected |
Definition at line 118 of file AlgoImpl.h.
Referenced by global_angular_0::checkTermination(), global_simpleAngular_0::checkTermination(), global_simpleAngular_1::checkTermination(), global_simpleAngular_2::checkTermination(), copyno(), global_angular_0::rotation(), global_simpleAngular_0::rotation(), global_simpleAngular_1::rotation(), global_simpleAngular_2::rotation(), global_angular_0::translation(), global_simpleAngular_0::translation(), global_simpleAngular_1::translation(), and global_simpleAngular_2::translation().
|
protected |
Definition at line 117 of file AlgoImpl.h.
Referenced by copyno(), global_linear_0::translation(), and global_linear_1::translation().
|
protected |
Definition at line 115 of file AlgoImpl.h.
|
protected |
|
protected |
Definition at line 116 of file AlgoImpl.h.
Referenced by copyno().
|
protected |
Definition at line 121 of file AlgoImpl.h.
Referenced by Mixins._Labelable::_findDependencies(), and Mixins._TypedParameterizable::dumpPython().
|
protected |
Definition at line 113 of file AlgoImpl.h.
Referenced by global_angular_0::checkParameters(), global_linear_0::checkParameters(), global_simpleAngular_0::checkParameters(), global_linear_1::checkParameters(), global_simpleAngular_1::checkParameters(), global_simpleAngular_2::checkParameters(), global_simpleAngular_0::checkTermination(), global_simpleAngular_1::checkTermination(), global_simpleAngular_2::checkTermination(), global_simpleAngular_0::rotation(), global_simpleAngular_1::rotation(), global_simpleAngular_2::rotation(), global_linear_0::translation(), global_simpleAngular_0::translation(), global_linear_1::translation(), global_simpleAngular_1::translation(), and global_simpleAngular_2::translation().
|
protected |
Definition at line 112 of file AlgoImpl.h.
Referenced by global_angular_0::checkParameters(), global_simpleAngular_0::rotation(), global_simpleAngular_1::rotation(), and global_simpleAngular_2::rotation().
|
protected |
Definition at line 114 of file AlgoImpl.h.
|
protected |
Definition at line 119 of file AlgoImpl.h.
Referenced by terminate().