4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief Duplicators public header */
26 #ifndef HH_SENF_PPI_Duplicators_
27 #define HH_SENF_PPI_Duplicators_ 1
30 #include <boost/ptr_container/ptr_vector.hpp>
32 #include "Connectors.hh"
35 //#include "Duplicators.mpp"
36 ///////////////////////////////hh.p////////////////////////////////////////
43 template <class Target>
44 connector::GenericActiveOutput & connect(module::ActiveDuplicator & source, Target & target);
50 /** \brief Copy every incoming packet to each output
52 ActiveDuplicator will take every received packet and push it out to each connected output.
54 Since ActiveDuplicator allows any number of incoming packet streams, the input connectors
55 are dynamically managed. A special senf::ppi::connect() overload is used to dynamically
56 create the needed input connectors. This hides this extra functionality from the user.
58 senf::ppi::module::ActiveDuplicator dup;
60 senf::ppi::connect(sourceModule, dup);
61 senf::ppi::connect(dup, targetModule1);
62 senf::ppi::connect(dup, targetModule2.some_input);
65 \ingroup routing_modules
67 class ActiveDuplicator
70 SENF_PPI_MODULE(ActiveDuplicator);
72 connector::PassiveInput<> input;
77 connector::ActiveOutput<> & newOutput();
82 template <class Target>
83 connector::GenericActiveOutput & connect(Target & target);
88 typedef boost::ptr_vector<connector::ActiveOutput<> > Outputs;
96 ///////////////////////////////hh.e////////////////////////////////////////
97 #include "Duplicators.cci"
98 //#include "Duplicators.ct"
99 #include "Duplicators.cti"
106 // comment-column: 40
107 // c-file-style: "senf"
108 // indent-tabs-mode: nil
109 // ispell-local-dictionary: "american"
110 // compile-command: "scons -u test"