File indexing completed on 2024-05-12 03:47:27

0001 /*
0002     File                 : CopyThroughFilter.cpp
0003     Project              : SciDAVis
0004     Description          : Filter which copies all provided inputs unaltered
0005     to an equal number of outputs.
0006     --------------------------------------------------------------------
0007     SPDX-FileCopyrightText: 2007 Knut Franke <knut.franke*gmx.de (use @ for *)>
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 */
0010 
0011 #include "CopyThroughFilter.h"
0012 
0013 /**
0014  * \class CopyThroughFilter
0015  * \brief Filter which copies all provided inputs unaltered to an equal number of outputs.
0016  *
0017  * This is probably the simplest filter you can possibly write.
0018  * It accepts an arbitrary number of inputs and provides the same AbstractColumn objects
0019  * as outputs again.
0020  */
0021 
0022 /**
0023  * \brief Accept any number of inputs.
0024  */
0025 int CopyThroughFilter::inputCount() const {
0026     return -1;
0027 }
0028 
0029 /**
0030  * \brief Provide as many output ports as inputs have been connected.
0031  */
0032 int CopyThroughFilter::outputCount() const {
0033     return m_inputs.size();
0034 }
0035 
0036 /**
0037  * \brief When asked for an output port, just return the corresponding input port.
0038  */
0039 AbstractColumn* CopyThroughFilter::output(int port) const {
0040     return 0;
0041     // TODO: return m_inputs.value(port);
0042 }