Go to the documentation of this file. 1 #ifndef CNOID_BODY_IO_CONNECTION_MAP_H
2 #define CNOID_BODY_IO_CONNECTION_MAP_H
4 #include <cnoid/ClonableReferenced>
5 #include <cnoid/Signal>
8 #include "exportdecl.h"
12 class DigitalIoDevice;
34 int signalIndex(
int which)
const {
return signalIndex_[which]; }
35 const std::string& bodyName(
int which)
const;
36 const std::string& deviceName(
int which)
const;
39 return (device_[In] !=
nullptr) && (device_[Out] !=
nullptr);
43 void setNames(
int which,
const std::string& bodyName,
const std::string& deviceName);
48 const std::string&
outBodyName(
int which)
const {
return bodyName(Out); }
49 const std::string&
outDeviceName(
int which)
const {
return deviceName(Out); }
53 const std::string&
inBodyName(
int which)
const {
return bodyName(In); }
54 const std::string&
inDeviceName(
int which)
const {
return deviceName(In); }
61 const std::string&
note(){
return note_; }
62 void setNote(
const std::string& note){ note_ = note; }
64 bool establishConnection();
65 void releaseConnection();
77 std::string bodyName_[2];
78 std::string deviceName_[2];
97 typedef std::vector<DigitalIoConnectionPtr>
container;
113 void establishConnections();
114 void releaseConnections();
124 std::vector<DigitalIoConnectionPtr> connections_;
const std::string & outDeviceName(int which) const
Definition: IoConnectionMap.h:49
const std::string & inBodyName(int which) const
Definition: IoConnectionMap.h:53
Definition: DigitalIoDevice.h:12
Definition: ValueTree.h:253
container::iterator iterator
Definition: IoConnectionMap.h:98
void setSignalIndex(int which, int index)
Definition: IoConnectionMap.h:44
DigitalIoConnection * clone(CloneMap &cloneMap) const
Definition: IoConnectionMap.h:27
const_iterator end() const
Definition: IoConnectionMap.h:104
Listing * write(Mapping *mapping, const std::string &key, const Eigen::MatrixBase< Derived > &x)
Definition: EigenArchive.h:145
const std::string & outBodyName(int which) const
Definition: IoConnectionMap.h:48
int numConnections() const
Definition: IoConnectionMap.h:106
IoConnectionMap * clone() const
Definition: IoConnectionMap.h:90
DigitalIoDevice * inDevice()
Definition: IoConnectionMap.h:51
IoConnectionMap * clone(CloneMap &cloneMap) const
Definition: IoConnectionMap.h:93
const std::string & note()
Definition: IoConnectionMap.h:61
DigitalIoDevice * outDevice()
Definition: IoConnectionMap.h:46
int outSignalIndex() const
Definition: IoConnectionMap.h:47
IoType
Definition: IoConnectionMap.h:31
bool read(const Mapping *mapping, const std::string &key, Eigen::MatrixBase< Derived > &x)
Definition: EigenArchive.h:43
iterator end()
Definition: IoConnectionMap.h:103
bool hasDeviceInstances() const
Definition: IoConnectionMap.h:38
void setInSignalIndex(int index)
Definition: IoConnectionMap.h:57
Definition: IoConnectionMap.h:18
const_iterator begin() const
Definition: IoConnectionMap.h:102
void setOutDevice(DigitalIoDevice *device)
Definition: IoConnectionMap.h:58
ref_ptr< DigitalIoDevice > DigitalIoDevicePtr
Definition: DigitalIoDevice.h:75
Definition: IoConnectionMap.h:85
Definition: AbstractSceneLoader.h:11
Definition: ClonableReferenced.h:10
DigitalIoConnection * clone() const
Definition: IoConnectionMap.h:24
Definition: CloneMap.h:13
const DigitalIoConnection * connection(int index) const
Definition: IoConnectionMap.h:108
void setOutSignalIndex(int index)
Definition: IoConnectionMap.h:59
iterator begin()
Definition: IoConnectionMap.h:101
ref_ptr< DigitalIoConnection > DigitalIoConnectionPtr
Definition: IoConnectionMap.h:82
int signalIndex(int which) const
Definition: IoConnectionMap.h:34
int inSignalIndex() const
Definition: IoConnectionMap.h:52
const std::string & inDeviceName(int which) const
Definition: IoConnectionMap.h:54
ref_ptr< IoConnectionMap > IoConnectionMapPtr
Definition: IoConnectionMap.h:127
DigitalIoConnection * connection(int index)
Definition: IoConnectionMap.h:107
container::const_iterator const_iterator
Definition: IoConnectionMap.h:99
Definition: Referenced.h:54
DigitalIoDevice * device(int which) const
Definition: IoConnectionMap.h:33
void setInDevice(DigitalIoDevice *device)
Definition: IoConnectionMap.h:56
void setNote(const std::string ¬e)
Definition: IoConnectionMap.h:62
std::vector< DigitalIoConnectionPtr > container
Definition: IoConnectionMap.h:97