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 Joins public header */
26 #ifndef HH_SENF_PPI_Joins_
27 #define HH_SENF_PPI_Joins_ 1
30 #include <boost/ptr_container/ptr_vector.hpp>
32 #include "Connectors.hh"
34 #include "DynamicConnectorMixin.hh"
36 //#include "Joins.mpp"
37 ///////////////////////////////hh.p////////////////////////////////////////
44 /** \brief Join multiple packet streams with passive inputs
46 The PassiveJoin will combine any number of packet streams. You may connect any number of
47 ActiveOutput<>'s to the PassiveJoin instance. The combined stream is then provided on the
48 ActiveOutput<> \a output.
50 Since PassiveJoin allows any number of incoming packet streams, the input connectors are
51 dynamically managed. A special senf::ppi::connect() overload is used to dynamically create
52 the needed input connectors. This hides this extra functionality from the user.
54 senf::ppi::module::PassiveJoin join;
56 ppi::connect(module1,join); // Connect first module to join's input
57 ppi::connect(module2.some_output,join); // Connect another module to join's input
58 ppi::connect(join,module3); // Forward combined stream to module3
61 \ingroup routing_modules
65 public DynamicConnectorMixin<PassiveJoin, connector::PassiveInput<> >
67 SENF_PPI_MODULE(PassiveJoin);
69 connector::ActiveOutput<> output;
74 void connectorSetup(connector::PassiveInput<> & conn);
75 void request(connector::GenericPassiveInput & input);
79 friend class DynamicConnectorMixin<PassiveJoin, connector::PassiveInput<> >;
82 /** \brief Join multiple packet streams with active inputs
84 The PriorityJoin will combine any number of packet streams. You may connect any number of
85 PassiveInput<>'s to the PassiveJoin instance. The combined stream is then provided on the
86 PassiveOutput<> \a output.
88 When a packet request is received on Priorityjoin's \a output, The request will be serviced
89 from the first unthrottled input. The order, in which connectors are connected to the
90 PriorityJoin's input is important: The earlier connected peer has the higher priority and
91 will be serviced first.
93 Since PriorityJoin allows any number of incoming packet streams, the input connectors are
94 dynamically managed. A special senf::ppi::connect() overload is used to dynamically create
95 the needed input connectors. This hides this extra functionality from the user.
97 senf::ppi::module::PriorityJoin join;
99 ppi::connect(module1,join); // Connect first module to join's input
100 ppi::connect(module2.some_output,join); // Connect another module to join's input
101 ppi::connect(join,module3); // Forward combined stream to module3
103 Here, \a module1 has higher priority than \a module2 which will only be queried if \a
104 module1 is throttled.
106 \ingroup routing_modules
110 public DynamicConnectorMixin<PriorityJoin, connector::ActiveInput<> >
112 SENF_PPI_MODULE(PriorityJoin);
114 connector::PassiveOutput<> output;
119 void connectorSetup(PriorityJoin::DynamicConnector & conn, int priority=-1);
124 friend class DynamicConnectorMixin<PriorityJoin, connector::ActiveInput<> >;
129 ///////////////////////////////hh.e////////////////////////////////////////
131 //#include "Joins.ct"
132 //#include "Joins.cti"
139 // comment-column: 40
140 // c-file-style: "senf"
141 // indent-tabs-mode: nil
142 // ispell-local-dictionary: "american"
143 // compile-command: "scons -u test"