Closed rdube closed 10 years ago
No, you are right. I would do something like:
EvaluatorTypePtr getEvaluator(Time time) const {
boost::shared_ptr< Evaluator< VectorSpaceConfig > > rval( new LinearInterpolationVectorSpaceEvaluator(arg1, arg2, arg3) );
return rval;
}
This works because LinearInterpolationVectorSpaceEvaluator
is a child class of Evaluator< VectorSpaceConfig >
. Does that make sense?
Ok cool it works! Thanks!
I am trying to populate the LinearInterpolationVectorSpaceEvaluator.cpp to create an evaluator object for our linearly interpolated 1d curve. Currently the class is defined as :
class LinearInterpolationVectorSpaceEvaluator : public Evaluator< VectorSpaceConfig >
However, in LinearInterpolationVectorSpaceEvaluator.hpp the getter function is:
virtual EvaluatorTypePtr getEvaluator(Time time) const;
This functions returns a boost::shared_ptr< Evaluator< VectorSpaceConfig > > ;
Could someone comment on how to make the link between the LinearInterpolationVectorSpaceEvaluator class and the boost::shared_ptr? Am I right by trying to create a LinearInterpolationVectorSpaceEvaluator object or am I getting something wrong?
Thanks!