Choreonoid  1.8
PythonScriptItem.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_PYTHON_PLUGIN_PYTHON_SCRIPT_ITEM_H
7 #define CNOID_PYTHON_PLUGIN_PYTHON_SCRIPT_ITEM_H
8 
9 #include <cnoid/ScriptItem>
10 #include "exportdecl.h"
11 
12 namespace cnoid {
13 
14 class PythonScriptItemImpl;
15 
16 class CNOID_EXPORT PythonScriptItem : public ScriptItem
17 {
18 public:
19  static void initializeClass(ExtensionManager* ext);
20 
23 
24  bool setScriptFilename(const std::string& filename);
25  virtual const std::string& scriptFilename() const override;
26 
27  virtual void setBackgroundMode(bool on) override;
28  virtual bool isBackgroundMode() const override;
29  virtual bool isRunning() const override;
30 
31  virtual bool execute() override;
32  virtual bool executeCode(const char* code) override;
33  virtual bool waitToFinish(double timeout = 0.0) override;
34  virtual std::string resultString() const override;
35  virtual SignalProxy<void()> sigScriptFinished() override;
36 
37  virtual bool terminate() override;
38 
39 protected:
40  virtual ~PythonScriptItem();
41  virtual void onDisconnectedFromRoot() override;
42  virtual Item* doDuplicate() const override;
43  virtual void doPutProperties(PutPropertyFunction& putProperty) override;
44  virtual bool store(Archive& archive) override;
45  virtual bool restore(const Archive& archive) override;
46 
47 private:
49  bool doExecuteOnProjectLoading;
50 };
51 
53 
54 }
55 
56 #endif
cnoid::ScriptItem
Definition: ScriptItem.h:14
cnoid::ExtensionManager
Definition: ExtensionManager.h:23
cnoid::PutPropertyFunction
Definition: PutPropertyFunction.h:51
cnoid::Archive
Definition: Archive.h:22
cnoid::ref_ptr
Definition: Referenced.h:103
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::Item
Definition: Item.h:29
cnoid::PythonScriptItem
Definition: PythonScriptItem.h:16
cnoid::PythonScriptItemPtr
ref_ptr< PythonScriptItem > PythonScriptItemPtr
Definition: PythonScriptItem.h:52
cnoid::PythonScriptItemImpl
Definition: PythonScriptItemImpl.h:16
cnoid::SignalProxy
Definition: Signal.h:470