Choreonoid  1.5
PythonExecutor.h
Go to the documentation of this file.
1 
5 #ifndef CNOID_PYTHON_PLUGIN_PYTHON_EXECUTOR_H
6 #define CNOID_PYTHON_PLUGIN_PYTHON_EXECUTOR_H
7 
8 #include "PythonPlugin.h"
9 #include <cnoid/Signal>
10 #include "exportdecl.h"
11 
12 namespace cnoid {
13 
14 class PythonExecutorImpl;
15 
17 {
18 public:
19  static void setModuleRefreshEnabled(bool on);
20 
22  PythonExecutor(const PythonExecutor& org);
23  ~PythonExecutor();
24 
25  void setBackgroundMode(bool on);
26  bool isBackgroundMode() const;
27 
28  enum State { NOT_RUNNING, RUNNING_FOREGROUND, RUNNING_BACKGROUND };
29 
30  State state() const;
31 
32  bool execCode(const std::string& code);
33  bool execFile(const std::string& filename);
34  bool waitToFinish(double timeout);
35  boost::python::object resultObject();
36  const std::string resultString() const;
37  SignalProxy<void()> sigFinished();
38 
39  bool hasException() const;
40  const std::string exceptionTypeName() const;
41  const std::string exceptionText() const;
42  boost::python::object exceptionType() const;
43  boost::python::object exceptionValue() const;
44 
45  bool isTerminated() const;
46 
47  bool terminate();
48 
49 private:
50  PythonExecutorImpl* impl;
51 };
52 
53 }
54 
55 #endif
Definition: PythonExecutor.h:16
State
Definition: PythonExecutor.h:28
Defines the minimum processing for performing pasing file for STL.
Definition: AbstractSceneLoader.h:9
#define CNOID_EXPORT
Definition: Util/exportdecl.h:37
Definition: Signal.h:380