interpreter.hh
Go to the documentation of this file.
1 // -*- mode: c++ -*-
2 // Copyright 2011, Florent Lamiraux, CNRS.
3 
4 #ifndef DYNAMIC_GRAPH_PYTHON_INTERPRETER_H
5 #define DYNAMIC_GRAPH_PYTHON_INTERPRETER_H
6 
7 #undef _POSIX_C_SOURCE
8 #undef _XOPEN_SOURCE
10 
13 
14 namespace dynamicgraph {
15 namespace python {
21 class DYNAMIC_GRAPH_PYTHON_DLLAPI Interpreter {
22  public:
23  Interpreter();
24  ~Interpreter();
28  [[deprecated("you *SHOULD* handle error messages")]] std::string python(
29  const std::string& command);
30 
33  void python(const std::string& command, std::string& result, std::string& out,
34  std::string& err);
35 
38  void runPythonFile(std::string filename);
39  void runPythonFile(std::string filename, std::string& err);
40  void runMain(void);
41 
44  std::string processStream(std::istream& stream, std::ostream& os);
45 
47  PyObject* globals();
48 
49  private:
51  PyThreadState* _pyState;
53  PyObject* globals_;
54  PyObject* mainmod_;
55 };
56 } // namespace python
57 } // namespace dynamicgraph
58 #endif // DYNAMIC_GRAPH_PYTHON_INTERPRETER_H
dynamicgraph
dynamicgraph::python::Interpreter::_pyState
PyThreadState * _pyState
The Python thread state.
Definition: interpreter.hh:51
fwd.hh
dynamicgraph::python::Interpreter
Definition: interpreter.hh:21
python
python-compat.hh
api.hh
dynamicgraph::python::Interpreter::mainmod_
PyObject * mainmod_
Definition: interpreter.hh:54
dynamicgraph::python::Interpreter::globals_
PyObject * globals_
Pointer to the dictionary of global variables.
Definition: interpreter.hh:53


dynamic-graph-python
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Fri Oct 27 2023 02:16:36