Choreonoid  1.8
MultiDeviceStateSeq.h
Go to the documentation of this file.
1 
6 #ifndef CNOID_BODY_MULTI_DEVICE_STATE_SEQ_H
7 #define CNOID_BODY_MULTI_DEVICE_STATE_SEQ_H
8 
9 #include "Device.h"
10 #include <cnoid/DeviceList>
11 #include <cnoid/MultiSeq>
12 #include "exportdecl.h"
13 
14 namespace cnoid {
15 
16 class CNOID_EXPORT MultiDeviceStateSeq : public MultiSeq<DeviceStatePtr>
17 {
19 
20 public:
21  static const std::string& key();
22 
24  MultiDeviceStateSeq(int numFrames, int numDevices = 1);
26  virtual ~MultiDeviceStateSeq();
27 
28  using BaseSeqType::operator=;
29  MultiDeviceStateSeq& operator=(const MultiDeviceStateSeq& rhs);
30  virtual std::shared_ptr<AbstractSeq> cloneSeq() const override;
31 
32  void initialize(const DeviceList<>& devices);
33 
34  virtual int partIndex(const std::string& partLabel) const override;
35  virtual const std::string& partLabel(int partIndex) const override;
36 
37 protected:
38  virtual bool doWriteSeq(YAMLWriter& writer, std::function<void()> additionalPartCallback) override;
39 
40 private:
41  void writeDeviceStateSeq(YAMLWriter& writer, int deviceIndex);
42 
43  std::vector<std::string> deviceNames;
44 };
45 
46 class BodyMotion;
47 
48 CNOID_EXPORT std::shared_ptr<MultiDeviceStateSeq> getMultiDeviceStateSeq(const BodyMotion& motion);
49 CNOID_EXPORT std::shared_ptr<MultiDeviceStateSeq> getOrCreateMultiDeviceStateSeq(BodyMotion& motion);
50 CNOID_EXPORT void clearMultiDeviceStateSeq(BodyMotion& motion);
51 }
52 
53 #endif
cnoid::clearMultiDeviceStateSeq
CNOID_EXPORT void clearMultiDeviceStateSeq(BodyMotion &motion)
Definition: MultiDeviceStateSeq.cpp:89
Device.h
cnoid::getMultiDeviceStateSeq
CNOID_EXPORT std::shared_ptr< MultiDeviceStateSeq > getMultiDeviceStateSeq(const BodyMotion &motion)
Definition: MultiDeviceStateSeq.cpp:77
cnoid::YAMLWriter
Definition: YAMLWriter.h:16
cnoid::BodyMotion
Definition: BodyMotion.h:20
cnoid::MultiSeq
Definition: MultiSeq.h:17
cnoid::getOrCreateMultiDeviceStateSeq
CNOID_EXPORT std::shared_ptr< MultiDeviceStateSeq > getOrCreateMultiDeviceStateSeq(BodyMotion &motion)
Definition: MultiDeviceStateSeq.cpp:83
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::MultiDeviceStateSeq
Definition: MultiDeviceStateSeq.h:16
cnoid::DeviceList
Definition: DeviceList.h:16