Changeset 185 in pacpusframework for trunk/src/PacpusLib/ComponentManager.cpp


Ignore:
Timestamp:
Oct 23, 2013, 10:32:21 AM (11 years ago)
Author:
morasjul
Message:

Fixed: dependencies.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/PacpusLib/ComponentManager.cpp

    r184 r185  
    1818
    1919DECLARE_STATIC_LOGGER("pacpus.core.ComponentManager");
     20
     21////////////////////////////////////////////////////////////////////////////////
     22
     23bool connectInterface(OutputInterfaceBase * out, InputInterfaceBase * in, int priority, InputInterfaceBase::ReadingMode mode = InputInterfaceBase::GetLast);
     24
     25////////////////////////////////////////////////////////////////////////////////
     26
     27bool connectInterface(OutputInterfaceBase * out, InputInterfaceBase * in, int priority, InputInterfaceBase::ReadingMode mode)
     28{
     29    if (out->getDataType() == in->getDataType() || out->getDataType() == QString(typeid(QByteArray).name()) || in->getDataType() == QString(typeid(QByteArray).name())) {
     30        // Add connection
     31        out->addConnection(ConnectionBase(in, priority));  // TODO make connect function
     32        in->addConnection(ConnectionBase(out, priority));
     33        in->setReadingMode(mode);
     34        //LOG_INFO("connection : Output " << out->getSignature() << " => Input " << in->getSignature());
     35        return true;
     36    } else {
     37        //LOG_WARN("connecting " << out->getSignature() << ":" << out->getDataType() << " to " << in->getSignature() << ":" << in->getDataType() << " failled : DataType incompatible " <<  QString(typeid(QByteArray).name()));
     38        return false;
     39    }
     40}
     41
     42////////////////////////////////////////////////////////////////////////////////
    2043
    2144ComponentManager * ComponentManager::mInstance = NULL;
Note: See TracChangeset for help on using the changeset viewer.