All Classes Namespaces Functions Variables Typedefs Enumerations
pyeval.h
1 #ifndef _MBXMLUTILS_PYEVAL_H_
2 #define _MBXMLUTILS_PYEVAL_H_
3 
4 #include "eval.h"
5 #include "py2py3cppwrapper.h"
6 
7 namespace MBXMLUtils {
8 
10 class PyEval : public Eval {
11  friend class Eval;
12 
13  protected:
15  PyEval(std::vector<boost::filesystem::path> *dependencies_=NULL);
16  public:
18  ~PyEval();
19  static std::string getNameStatic() { return "python"; }
20  virtual std::string getName() const { return getNameStatic(); }
21  virtual void addImport(const std::string &code, const xercesc::DOMElement *e);
22  virtual bool valueIsOfType(const Value &value, ValueType type) const;
23  virtual std::map<boost::filesystem::path, std::pair<boost::filesystem::path, bool> >& requiredFiles() const;
24  virtual void convertIndex(Value &v, bool evalTo1Based);
25  protected:
26  virtual Value createSwigByTypeName(const std::string &typeName) const;
27  virtual Value callFunction(const std::string &name, const std::vector<Value>& args) const;
28  virtual Value fullStringToValue(const std::string &str, const xercesc::DOMElement *e=NULL) const;
29  virtual void* getSwigThis(const Value &value) const;
30  virtual std::string getSwigType(const Value &value) const;
31  private:
32  virtual double cast_double (const Value &value) const;
33  virtual std::vector<double> cast_vector_double (const Value &value) const;
34  virtual std::vector<std::vector<double> >cast_vector_vector_double (const Value &value) const;
35  virtual std::string cast_string (const Value &value) const;
36  virtual Value create_double (const double& v) const;
37  virtual Value create_vector_double (const std::vector<double>& v) const;
38  virtual Value create_vector_vector_double(const std::vector<std::vector<double> >& v) const;
39  virtual Value create_string (const std::string& v) const;
40 };
41 
42 }
43 
44 #endif
Definition: eval.h:76
PyEval(std::vector< boost::filesystem::path > *dependencies_=NULL)
Constructor.
Definition: pyeval.cc:129
virtual void * getSwigThis(const Value &value) const
get the SWIG pointer of this value.
Definition: pyeval.cc:569
virtual Value createSwigByTypeName(const std::string &typeName) const
create a SWIG object of name typeName.
Definition: pyeval.cc:265
A evaluator based on python.
Definition: pyeval.h:10
virtual Value fullStringToValue(const std::string &str, const xercesc::DOMElement *e=NULL) const
evaluate the string str using the current parameters and return the result.
Definition: pyeval.cc:282
~PyEval()
Destructor.
Definition: pyeval.cc:134
virtual std::string getName() const
Get the type of this evaluator.
Definition: pyeval.h:20
virtual Value callFunction(const std::string &name, const std::vector< Value > &args) const
Definition: pyeval.cc:269
virtual std::map< boost::filesystem::path, std::pair< boost::filesystem::path, bool > > & requiredFiles() const
return a list of all required files of the evaluator (excluding dependent files of libraries) ...
Definition: pyeval.cc:223
virtual bool valueIsOfType(const Value &value, ValueType type) const
Definition: pyeval.cc:195
virtual std::string getSwigType(const Value &value) const
get the SWIG type (class name) of this value.
Definition: pyeval.cc:374
virtual void addImport(const std::string &code, const xercesc::DOMElement *e)
Definition: pyeval.cc:137
virtual void convertIndex(Value &v, bool evalTo1Based)
Definition: pyeval.cc:429
ValueType
Definition: eval.h:82

Impressum / Disclaimer / Datenschutz Generated by doxygen 1.8.5 Valid HTML