Choreonoid  1.8
PythonScriptItemImpl.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_PYTHON_PLUGIN_PYTHON_SCRIPT_ITEM_IMPL_H
7 #define CNOID_PYTHON_PLUGIN_PYTHON_SCRIPT_ITEM_IMPL_H
8 
9 #include "PythonExecutor.h"
10 #include <cnoid/ScriptItem>
11 #include <cnoid/MessageView>
12 #include "exportdecl.h"
13 
14 namespace cnoid {
15 
16 class CNOID_EXPORT PythonScriptItemImpl
17 {
18 public:
19  PythonScriptItemImpl(ScriptItem* scriptItem);
20  PythonScriptItemImpl(ScriptItem* scriptItem, const PythonScriptItemImpl& org);
21  virtual ~PythonScriptItemImpl();
22  ScriptItem* scriptItem() { return scriptItem_; }
23  void onDisconnectedFromRoot();
24  bool setScriptFilename(const std::string& filename);
25  const std::string& scriptFilename() const { return scriptFilename_; }
26  void setBackgroundMode(bool on);
27  bool isBackgroundMode() const;
28  bool isRunning() const;
29  bool execute();
30  bool executeCode(const char* code);
31  bool waitToFinish(double timeout);
32  const std::string exceptionText() const;
33  Signal<void()>& sigScriptFinished() { return sigScriptFinished_; }
34  bool terminate();
35  void doPutProperties(PutPropertyFunction& putProperty);
36  bool store(Archive& archive);
37  bool restore(const Archive& archive);
38 
39 private:
40  void onScriptFinished();
41  bool onBackgroundModeChanged(bool on);
42 
43  ScriptItem* scriptItem_;
44  std::string scriptFilename_;
45  MessageView* mv;
46  PythonExecutor executor;
47  Connection sigFinishedConnection;
48  Signal<void()> sigScriptFinished_;
49 };
50 
51 }
52 
53 #endif
cnoid::PythonScriptItemImpl::scriptFilename
const std::string & scriptFilename() const
Definition: PythonScriptItemImpl.h:25
cnoid::ScriptItem
Definition: ScriptItem.h:14
cnoid::PutPropertyFunction
Definition: PutPropertyFunction.h:51
cnoid::PythonScriptItemImpl::sigScriptFinished
Signal< void()> & sigScriptFinished()
Definition: PythonScriptItemImpl.h:33
cnoid::PythonScriptItemImpl::scriptItem
ScriptItem * scriptItem()
Definition: PythonScriptItemImpl.h:22
cnoid::Archive
Definition: Archive.h:22
cnoid::PythonExecutor
Definition: PythonExecutor.h:18
cnoid::MessageView
Definition: MessageView.h:16
PythonExecutor.h
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::Signal
Definition: Signal.h:165
cnoid::PythonScriptItemImpl
Definition: PythonScriptItemImpl.h:16
cnoid::Connection
Definition: Signal.h:206