std::cout<<"providerComponent does not have required interface"<<std::endl;
return0;
}
// connect value interfaces
this->Set(providerInterface);// due to the input argument being uniquely defined in the multiple inheritance tree, all versions of Set() are accessible
// An Optimizer3rdParty expects that Metric3rdParty will be set as input. All accepted interfaces by the Optimizer3rdPartyCompoment will be delegated to the Metric3rdPartyWrapper object.
// An Optimizer4thParty expects that Metric4thParty will be set as input. All accepted interfaces by the Optimizer4thPartyCompoment will be delegated to the Metric4thPartyWrapper object.
// test case: there are two (slightly) incompatible codebases (i.e. 3rd party and 4th party!), each with an optimizer object and a metric object.
// test case: Assume there are two (slightly) incompatible codebases (i.e. 3rd party and 4th! party), each with an optimizer object and a metric object. The example classes of 3rd and 4th party code bases cannot be changed, but the wrapping is in our control.
// goal: make elastix components of all objects and define a handshake that checks if connections can be made.
/*************** below: example implementations of 3rd and 4th party code base (assume we cannot change that) *********************/
classMetric3rdPartyBase{
public:
virtualintGetValue()=0;
virtualintGetDerivative()=0;
};
#include"SSDMetric3rdPartyComponent.h"
#include"GDOptimizer3rdPartyComponent.h"
#include"SSDMetric4thPartyComponent.h"
#include"GDOptimizer4thPartyComponent.h"
classOptimizer3rdPartyBase{
public:
virtualintSetMetric(Metric3rdPartyBase*)=0;
virtualintOptimize()=0;
protected:
Metric3rdPartyBase*theMetric;
};
classMetric4rdPartyBase{
public:
virtualintGetCost()=0;// with different naming convention than 3rd party
};
classOptimizer4rdPartyBase{
public:
virtualintSetMetric(Metric4rdPartyBase*)=0;
virtualintDoOptimization()=0;// with different naming convention than 3rd party