Choreonoid  1.8
ExtCommandItem.h
Go to the documentation of this file.
1 
5 #ifndef CNOID_BASE_EXT_COMMAND_ITEM_H
6 #define CNOID_BASE_EXT_COMMAND_ITEM_H
7 
8 #include "Item.h"
9 #include "Process.h"
10 #include "exportdecl.h"
11 
12 namespace cnoid {
13 
14 class CNOID_EXPORT ExtCommandItem : public Item
15 {
16 public:
17  static void initializeClass(ExtensionManager* ext);
18 
20  ExtCommandItem(const ExtCommandItem& org);
21  virtual ~ExtCommandItem();
22 
23  void setCommand(const std::string& command);
24  const std::string& command() const { return command_; }
25  double waitingTimeAfterStarted() const { return waitingTimeAfterStarted_; }
26  void setWaitingTimeAfterStarted(double time);
27  bool execute();
28  bool terminate();
29 
30 protected:
31  virtual void onDisconnectedFromRoot();
32  virtual Item* doDuplicate() const;
33  virtual void doPutProperties(PutPropertyFunction& putProperty);
34  virtual bool store(Archive& archive);
35  virtual bool restore(const Archive& archive);
36 
37 private:
38  void onReadyReadServerProcessOutput();
39 
40  std::string command_;
41  Process process;
42  double waitingTimeAfterStarted_;
43  bool signalReadyStandardOutputConnected;
44  bool doCheckExistingProcess;
45  bool doExecuteOnLoading;
46 };
47 
49 
50 }
51 
52 #endif
Item.h
cnoid::ExtensionManager
Definition: ExtensionManager.h:23
cnoid::ExtCommandItemPtr
ref_ptr< ExtCommandItem > ExtCommandItemPtr
Definition: ExtCommandItem.h:48
cnoid::PutPropertyFunction
Definition: PutPropertyFunction.h:51
cnoid::Archive
Definition: Archive.h:22
Process.h
cnoid::ref_ptr
Definition: Referenced.h:103
cnoid::ExtCommandItem::command
const std::string & command() const
Definition: ExtCommandItem.h:24
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::Item
Definition: Item.h:29
cnoid::Process
Definition: Process.h:24
cnoid::ExtCommandItem::waitingTimeAfterStarted
double waitingTimeAfterStarted() const
Definition: ExtCommandItem.h:25
cnoid::ExtCommandItem
Definition: ExtCommandItem.h:14