Choreonoid  1.8
ControllerIO.h
Go to the documentation of this file.
1 
5 #ifndef CNOID_BODY_CONTROLLER_IO_H
6 #define CNOID_BODY_CONTROLLER_IO_H
7 
8 #include "Body.h"
9 #include "exportdecl.h"
10 
11 namespace cnoid {
12 
13 class Mapping;
14 typedef ref_ptr<Mapping> MappingPtr;
15 
16 class CNOID_EXPORT ControllerIO
17 {
18 public:
19  virtual ~ControllerIO();
20 
21  virtual std::string controllerName() const = 0;
22  virtual Body* body() = 0;
23  virtual std::string optionString() const;
24  std::vector<std::string> options() const;
25  MappingPtr structuredOptions() const;
26  virtual std::ostream& os() const;
27  virtual double timeStep() const;
28  virtual double currentTime() const;
29 
30  // Call this function in the controller's initialization function to enable logging
31  virtual bool enableLog();
32 
37  virtual void outputLog(Referenced* logData);
38 
39  // The following functions are only available in simulation
40  virtual bool isNoDelayMode() const;
41  virtual bool setNoDelayMode(bool on);
42 
44  double worldTimeStep() const { return timeStep(); };
45 
46 protected:
47  std::string getIntegratedOptionString(const std::string& opt1, const std::string& opt2) const;
48 };
49 
50 }
51 
52 #endif
cnoid::ControllerIO
Definition: ControllerIO.h:16
cnoid::ControllerIO::worldTimeStep
double worldTimeStep() const
Definition: ControllerIO.h:44
cnoid::ref_ptr< Mapping >
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::Referenced
Definition: Referenced.h:54
Body.h
cnoid::Body
Definition: Body.h:28
cnoid::MappingPtr
ref_ptr< Mapping > MappingPtr
Definition: StdSceneWriter.h:12