File indexing completed on 2024-05-12 15:26:39

0001 /***************************************************************************
0002     File                 : CopyThroughFilter.cpp
0003     Project              : SciDAVis
0004     --------------------------------------------------------------------
0005     Copyright            : (C) 2007 by Knut Franke
0006     Email (use @ for *)  : knut.franke*gmx.de
0007     Description          : Filter which copies all provided inputs unaltered
0008                            to an equal number of outputs.
0009 
0010  ***************************************************************************/
0011 
0012 /***************************************************************************
0013  *                                                                         *
0014  *  This program is free software; you can redistribute it and/or modify   *
0015  *  it under the terms of the GNU General Public License as published by   *
0016  *  the Free Software Foundation; either version 2 of the License, or      *
0017  *  (at your option) any later version.                                    *
0018  *                                                                         *
0019  *  This program is distributed in the hope that it will be useful,        *
0020  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
0021  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
0022  *  GNU General Public License for more details.                           *
0023  *                                                                         *
0024  *   You should have received a copy of the GNU General Public License     *
0025  *   along with this program; if not, write to the Free Software           *
0026  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
0027  *   Boston, MA  02110-1301  USA                                           *
0028  *                                                                         *
0029  ***************************************************************************/
0030 
0031 #include "CopyThroughFilter.h"
0032 
0033 /**
0034  * \class CopyThroughFilter
0035  * \brief Filter which copies all provided inputs unaltered to an equal number of outputs.
0036  *
0037  * This is probably the simplest filter you can possibly write.
0038  * It accepts an arbitrary number of inputs and provides the same AbstractColumn objects
0039  * as outputs again.
0040  */
0041 
0042 /**
0043  * \brief Accept any number of inputs.
0044  */
0045 int CopyThroughFilter::inputCount() const {
0046     return -1;
0047 }
0048 
0049 /**
0050  * \brief Provide as many output ports as inputs have been connected.
0051  */
0052 int CopyThroughFilter::outputCount() const {
0053     return m_inputs.size();
0054 }
0055 
0056 /**
0057  * \brief When asked for an output port, just return the corresponding input port.
0058  */
0059 AbstractColumn *CopyThroughFilter::output(int port) const {
0060     return 0;
0061     //TODO: return m_inputs.value(port);
0062 }
0063