Changeset 185 in pacpusframework for trunk/include/Pacpus/kernel/InputOutputBase.h
- Timestamp:
- 10/23/13 10:32:21 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/Pacpus/kernel/InputOutputBase.h
r182 r185 66 66 virtual ~InputInterfaceBase(); 67 67 68 virtual void customEvent(QEvent * e);68 virtual void customEvent(QEvent * e); 69 69 70 70 ReadingMode & readingMode(); 71 const ReadingMode & readingMode() const;71 const ReadingMode & getReadingMode() const; 72 72 void setReadingMode(ReadingMode mode); 73 73 … … 96 96 QStringList getInputConnectedList(); 97 97 98 // TODO for serialization prupose (not yet implemented !!!)99 98 void send(/*const*/ QByteArray & data); 100 99 }; 101 102 namespace {103 104 bool connectInterface(OutputInterfaceBase * out, InputInterfaceBase * in, int priority, InputInterfaceBase::ReadingMode mode = InputInterfaceBase::GetLast);105 106 bool connectInterface(OutputInterfaceBase * out, InputInterfaceBase * in, int priority, InputInterfaceBase::ReadingMode mode)107 {108 if (out->getDataType() == in->getDataType() || out->getDataType() == QString(typeid(QByteArray).name()) || in->getDataType() == QString(typeid(QByteArray).name())) {109 // Add connection110 out->addConnection(ConnectionBase(in, priority)); // TODO make connect function111 in->addConnection(ConnectionBase(out, priority));112 in->setReadingMode(mode);113 //LOG_INFO("connection : Output " << out->getSignature() << " => Input " << in->getSignature());114 return true;115 } else {116 //LOG_WARN("connecting " << out->getSignature() << ":" << out->getDataType() << " to " << in->getSignature() << ":" << in->getDataType() << " failled : DataType incompatible " << QString(typeid(QByteArray).name()));117 return false;118 }119 }120 121 } // namespace122 100 123 101 } // namespace pacpus
Note:
See TracChangeset
for help on using the changeset viewer.