Salome HOME
32b5c6d31a7fc19de72e355af8290405a7ad7722
[modules/shaper.git] / src / ParametersPlugin / ParametersPlugin_PyInterp.h
1 /*
2  * ParametersPlugin_PyInterp.h
3  *
4  *  Created on: Apr 2, 2015
5  *      Author: sbh
6  */
7
8 #ifndef PARAMETERSPLUGIN_PYINTERP_H_
9 #define PARAMETERSPLUGIN_PYINTERP_H_
10
11 #include <PyInterp_Interp.h>
12 #include <ParametersPlugin.h>
13
14 #include <list>
15 #include <string>
16 #include <utility>
17
18 class PARAMETERSPLUGIN_EXPORT ParametersPlugin_PyInterp : public PyInterp_Interp
19 {
20  public:
21   ParametersPlugin_PyInterp();
22   virtual ~ParametersPlugin_PyInterp();
23
24   std::list<std::pair<int, int> > positions(const std::string& theExpression,
25                                             const std::string& theName);
26   std::list<std::string> compile(const std::string&);
27   void extendLocalContext(const std::list<std::string>&);
28   void clearLocalContext();
29   double evaluate(const std::string&, std::string&);
30
31  protected:
32   std::string errorMessage();
33   // Overrides PyInterp_Interp
34   virtual bool initContext();
35   virtual void closeContext();
36 };
37
38 #endif /* PARAMETERSPLUGIN_PYINTERP_H_ */