ParametersPlugin_Parameter::ParametersPlugin_Parameter()
{
myInterp = new ParametersPlugin_PyInterp();
+ myInterp->initialize();
}
ParametersPlugin_Parameter::~ParametersPlugin_Parameter()
double ParametersPlugin_Parameter::evaluate(const std::string& theExpression, std::string& theError)
{
- myInterp->initialize();
+
std::list<std::string> anExprParams = myInterp->compile(theExpression);
// find expression's params in the model
std::list<std::string> aContext;
}
myInterp->extendLocalContext(aContext);
double result = myInterp->evaluate(theExpression, theError);
- myInterp->destroy();
+ myInterp->clearLocalContext();
return result;
}
std::list<std::string> compile(const std::string&);
void extendLocalContext(const std::list<std::string>&);
+ void clearLocalContext();
double evaluate(const std::string&, std::string&);
protected: