Changeset 185 in pacpusframework for trunk/include/Pacpus/kernel/InputOutputBase.h


Ignore:
Timestamp:
10/23/13 10:32:21 (11 years ago)
Author:
morasjul
Message:

Fixed: dependencies.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/Pacpus/kernel/InputOutputBase.h

    r182 r185  
    6666    virtual ~InputInterfaceBase();
    6767
    68     virtual void customEvent(QEvent* e);
     68    virtual void customEvent(QEvent * e);
    6969
    7070    ReadingMode & readingMode();
    71     const ReadingMode & readingMode() const;
     71    const ReadingMode & getReadingMode() const;
    7272    void setReadingMode(ReadingMode mode);
    7373
     
    9696    QStringList getInputConnectedList();
    9797
    98     // TODO for serialization prupose (not yet implemented !!!)
    9998    void send(/*const*/ QByteArray & data);
    10099};
    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 connection
    110         out->addConnection(ConnectionBase(in, priority));  // TODO make connect function
    111         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 } // namespace
    122100
    123101} // namespace pacpus
Note: See TracChangeset for help on using the changeset viewer.