X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParametersPlugin%2FParametersPlugin_PyInterp.h;h=6764db13a2112c211243269215043921aee352ba;hb=09dabb6acd9664f589a0bd9415d804d7a37ab801;hp=0e3cdee56401f7819ae60e5d31ce7a63102f2a99;hpb=4b42d82d7269a3146fbe09d88f5da936bf49452f;p=modules%2Fshaper.git diff --git a/src/ParametersPlugin/ParametersPlugin_PyInterp.h b/src/ParametersPlugin/ParametersPlugin_PyInterp.h index 0e3cdee56..6764db13a 100644 --- a/src/ParametersPlugin/ParametersPlugin_PyInterp.h +++ b/src/ParametersPlugin/ParametersPlugin_PyInterp.h @@ -13,22 +13,38 @@ #include #include +#include +/** + * \class ParametersPlugin_PyInterp + * \ingroup Plugins + * \brief Helper class for using Python interpreter. + */ class PARAMETERSPLUGIN_EXPORT ParametersPlugin_PyInterp : public PyInterp_Interp { public: ParametersPlugin_PyInterp(); virtual ~ParametersPlugin_PyInterp(); - std::list compile(const std::string&); - void extendLocalContext(const std::list&); + /// Returns a list of positions for theName in theExpression. + std::list > positions(const std::string& theExpression, + const std::string& theName); + /// Compiles theExpression and returns a list of parameters used in theExpression. + std::list compile(const std::string& theExpression); + /// Extends local context with the list of parameters. + void extendLocalContext(const std::list& theParameters); + /// Clears local context. void clearLocalContext(); - double evaluate(const std::string&, std::string&); + /// Evaluates theExpression and returns its value. + double evaluate(const std::string& theExpression, std::string& theError); protected: + /// Returns error message. std::string errorMessage(); - // Overrides PyInterp_Interp + /// Overrides PyInterp_Interp. virtual bool initContext(); + /// Reimplemented from PyInterp_Interp::closeContext(). + virtual void closeContext(); }; #endif /* PARAMETERSPLUGIN_PYINTERP_H_ */