X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParametersPlugin%2FParametersPlugin_PyInterp.h;h=6764db13a2112c211243269215043921aee352ba;hb=09dabb6acd9664f589a0bd9415d804d7a37ab801;hp=32b5c6d31a7fc19de72e355af8290405a7ad7722;hpb=f0a9f97c40b8696366b1f155d076cf0a57678055;p=modules%2Fshaper.git diff --git a/src/ParametersPlugin/ParametersPlugin_PyInterp.h b/src/ParametersPlugin/ParametersPlugin_PyInterp.h index 32b5c6d31..6764db13a 100644 --- a/src/ParametersPlugin/ParametersPlugin_PyInterp.h +++ b/src/ParametersPlugin/ParametersPlugin_PyInterp.h @@ -15,23 +15,35 @@ #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(); + /// Returns a list of positions for theName in theExpression. std::list > positions(const std::string& theExpression, const std::string& theName); - std::list compile(const std::string&); - void extendLocalContext(const std::list&); + /// 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(); };