PARP Research Group University of Murcia, Spain


src/qvworkers/qvsynchronizerworker.cpp

Go to the documentation of this file.
00001 /*
00002  *      Copyright (C) 2007, 2008, 2009. PARP Research Group.
00003  *      <http://perception.inf.um.es>
00004  *      University of Murcia, Spain.
00005  *
00006  *      This file is part of the QVision library.
00007  *
00008  *      QVision is free software: you can redistribute it and/or modify
00009  *      it under the terms of the GNU Lesser General Public License as
00010  *      published by the Free Software Foundation, version 3 of the License.
00011  *
00012  *      QVision is distributed in the hope that it will be useful,
00013  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *      GNU Lesser General Public License for more details.
00016  *
00017  *      You should have received a copy of the GNU Lesser General Public
00018  *      License along with QVision. If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00024 
00025 #include <qvworkers/qvsynchronizerworker.h>
00026 
00027 bool QVSynchronizer::linkProperty(QString sourcePropName, QVPropertyContainer *destinyContainer, QString destinyPropName, LinkType linkType)
00028         {
00029         return QVPropertyContainer::linkProperty(sourcePropName, destinyContainer, destinyPropName, linkType);
00030         }
00031 
00032 bool QVSynchronizer::linkProperty(QString sourcePropertyName, QVPropertyContainer &destinyContainer, QString destinyPropertyName, LinkType linkType)
00033         {
00034         return linkProperty(sourcePropertyName, &destinyContainer, destinyPropertyName, linkType);
00035         }
00036 
00037 bool QVSynchronizer::linkProperty(QVPropertyContainer *destCont, QString propName, LinkType linkType)
00038         {
00039         if (linkType == QVWorker::SynchronousLink) {
00040                 addPropertyFromQVariant(propName, inputFlag | outputFlag, destCont->getPropertyQVariantValue(propName), destCont->getPropertyInfo(propName));
00041                 return QVPropertyContainer::linkProperty(propName, destCont, propName, linkType);
00042                 }
00043         else {
00044                 std::cerr << "ERROR: QVSychronizer::linkProperty(): a QVSychronizer new link must be Synchronous" << std::endl;
00045                 return FALSE;
00046                 }
00047         }
00048 
00049 bool QVSynchronizer::linkProperty(QVPropertyContainer &destinyContainer, QString destinyPropertyName, LinkType linkType)
00050         {
00051         return linkProperty(&destinyContainer, destinyPropertyName, linkType);
00052         }
00053 
00054 bool QVSynchronizer::linkProperty(QString sourcePropName, QVPropertyContainer *destinyContainer, LinkType linkType)
00055         {
00056         return QVPropertyContainer::linkProperty(sourcePropName, destinyContainer, linkType);
00057         }
00058 
00059 bool QVSynchronizer::linkProperty(QString sourcePropertyName, QVPropertyContainer &destinyContainer, LinkType linkType)
00060         {
00061         return linkProperty(sourcePropertyName, &destinyContainer, linkType);
00062         }
00063 
00064 void QVSynchronizer::linkProperty(QVPropertyContainer *, LinkType)
00065         {
00066         std::cerr << "ERROR: QVSychronizer::linkProperty(): a QVSychronizer has not output properties to be linked" << std::endl;
00067         }
00068 
00069 void QVSynchronizer::linkProperty(QVPropertyContainer &container, LinkType linkType)
00070         {
00071         linkProperty(&container, linkType);
00072         }
00073 
00074 bool QVSynchronizer::unlinkProperty(QString origName, QVPropertyContainer *destCont, QString destName)
00075         {
00076         return QVPropertyContainer::unlinkProperty(origName, destCont, destName);
00077         }
00078 
00079 bool QVSynchronizer::unlinkProperty(QString origName, QVPropertyContainer &destCont, QString destName)
00080         {
00081         return unlinkProperty(origName, &destCont, destName);
00082         }
00083 
00084 bool QVSynchronizer::linkUnspecifiedInputProperty(QVPropertyContainer *sourceCont, QString propName, LinkType linkType)
00085         {
00086         if (linkType == QVWorker::SynchronousLink) {
00087                 addPropertyFromQVariant(propName, inputFlag | outputFlag, sourceCont->getPropertyQVariantValue(propName), sourceCont->getPropertyInfo(propName));
00088                 return sourceCont->linkProperty(propName, this, propName, linkType);
00089                 }
00090         else {
00091                 std::cerr << "ERROR: QVSychronizer::linkProperty(): a QVSychronizer new link must be Synchronous" << std::endl;
00092                 return FALSE;
00093                 }
00094         }
00095 
00096 bool QVSynchronizer::treatUnlinkInputProperty(QString destPropName, QVPropertyContainer *, QString sourcePropName)
00097         {
00098         if ( (destPropName != "max worker iterations") && (destPropName != "stats enabled") && (destPropName != "cpu stats") )
00099                 removeProperty(sourcePropName);
00100 
00101         return true;
00102         }
00103 



QVision framework. PARP research group, copyright 2007, 2008.