X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParametersPlugin%2FParametersPlugin_PyInterp.h;h=6764db13a2112c211243269215043921aee352ba;hb=34a3bcfe3a83f8b809593e55a614a941500bd0ea;hp=6bb2a210d46ccd8e5f217716854a39da7bfc8005;hpb=80d9dcc9384a77fb31ecf668598129083dca6675;p=modules%2Fshaper.git diff --git a/src/ParametersPlugin/ParametersPlugin_PyInterp.h b/src/ParametersPlugin/ParametersPlugin_PyInterp.h index 6bb2a210d..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&); - double evaluate(const std::string&, std::string&); + /// 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(); + /// Evaluates theExpression and returns its value. + double evaluate(const std::string& theExpression, std::string& theError); protected: - std::list _compile(const std::string&); - void _extendLocalContext(const std::list&); - double _evaluate(const std::string&, std::string&); + /// Returns error message. std::string errorMessage(); + /// Overrides PyInterp_Interp. + virtual bool initContext(); + /// Reimplemented from PyInterp_Interp::closeContext(). + virtual void closeContext(); }; #endif /* PARAMETERSPLUGIN_PYINTERP_H_ */