GNU Radio 3.6.0 C++ API
stream_selector.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2011 Free Software Foundation, Inc.
00003  * 
00004  * This file is part of GNU Radio
00005  * 
00006  * GNU Radio is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 3, or (at your option)
00009  * any later version.
00010  * 
00011  * GNU Radio is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  * 
00016  * You should have received a copy of the GNU General Public License
00017  * along with GNU Radio; see the file COPYING.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street,
00019  * Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef INCLUDED_GR_EXTRAS_STREAM_SELECTOR_H
00023 #define INCLUDED_GR_EXTRAS_STREAM_SELECTOR_H
00024 
00025 #include <gnuradio/extras/api.h>
00026 #include <gr_hier_block2.h>
00027 
00028 namespace gnuradio{ namespace extras{
00029 
00030 /*!
00031  * The sector extras allows streams to be dynamically routed at runtime.
00032  */
00033 class GR_EXTRAS_API stream_selector : virtual public gr_hier_block2{
00034 public:
00035     typedef boost::shared_ptr<stream_selector> sptr;
00036 
00037     /*!
00038      * Make a new stream selector block
00039      * \param in_sig signature to describe inputs
00040      * \param out_sig signature to describe outputs
00041      */
00042     static sptr make(gr_io_signature_sptr in_sig, gr_io_signature_sptr out_sig);
00043 
00044     /*!
00045      * Set the path for samples for each input ports.
00046      * Element i of paths specifies the output port index for input port i.
00047      * The value of the element may also be: -1 to block or -2 to consume.
00048      * \param paths a list of stream destinations for each port
00049      */
00050     virtual void set_paths(const std::vector<int> &paths) = 0;
00051 
00052 };
00053 
00054 }}
00055 
00056 #endif /* INCLUDED_GR_EXTRAS_STREAM_SELECTOR_H */