4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at
9 // http://senf.berlios.de/license.html
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
15 // Software distributed under the License is distributed on an "AS IS" basis,
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17 // for the specific language governing rights and limitations under the License.
19 // The Original Code is Fraunhofer FOKUS code.
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
23 // All Rights Reserved.
26 // Stefan Bund <g0dil@berlios.de>
29 \brief Joins public header */
31 #ifndef HH_SENF_PPI_Joins_
32 #define HH_SENF_PPI_Joins_ 1
35 #include <boost/ptr_container/ptr_vector.hpp>
37 #include "Connectors.hh"
39 #include "MultiConnectorMixin.hh"
41 //#include "Joins.mpp"
42 //-/////////////////////////////////////////////////////////////////////////////////////////////////
49 /** \brief Join multiple packet streams with passive inputs
51 The PassiveJoin will combine any number of packet streams. You may connect any number of
52 ActiveOutput<>'s to the PassiveJoin instance. The combined stream is then provided on the
53 ActiveOutput<> \a output.
55 Since PassiveJoin allows any number of incoming packet streams, the input connectors are
56 dynamically managed. A special senf::ppi::connect() overload is used to dynamically create
57 the needed input connectors. This hides this extra functionality from the user.
59 senf::ppi::module::PassiveJoin join;
61 ppi::connect(module1,join); // Connect first module to join's input
62 ppi::connect(module2.some_output,join); // Connect another module to join's input
63 ppi::connect(join,module3); // Forward combined stream to module3
66 \ingroup routing_modules
70 public MultiConnectorMixin<PassiveJoin, connector::PassiveInput<> >
72 SENF_PPI_MODULE(PassiveJoin);
74 connector::ActiveOutput<> output;
79 void connectorSetup(connector::PassiveInput<> & conn);
80 void request(connector::GenericPassiveInput & input);
84 friend class MultiConnectorMixin<PassiveJoin, connector::PassiveInput<> >;
87 /** \brief Join multiple packet streams with active inputs
89 The PriorityJoin will combine any number of packet streams. You may connect any number of
90 PassiveInput<>'s to the PassiveJoin instance. The combined stream is then provided on the
91 PassiveOutput<> \a output.
93 When a packet request is received on Priorityjoin's \a output, The request will be serviced
94 from the first unthrottled input. The order, in which connectors are connected to the
95 PriorityJoin's input is important: The earlier connected peer has the higher priority and
96 will be serviced first.
98 Since PriorityJoin allows any number of incoming packet streams, the input connectors are
99 dynamically managed. A special senf::ppi::connect() overload is used to dynamically create
100 the needed input connectors. This hides this extra functionality from the user.
102 senf::ppi::module::PriorityJoin join;
104 ppi::connect(module1,join); // Connect first module to join's input
105 ppi::connect(module2.some_output,join); // Connect another module to join's input
106 ppi::connect(join,module3); // Forward combined stream to module3
108 Here, \a module1 has higher priority than \a module2 which will only be queried if \a
109 module1 is throttled.
111 \ingroup routing_modules
115 public MultiConnectorMixin<PriorityJoin, connector::ActiveInput<> >
117 SENF_PPI_MODULE(PriorityJoin);
119 connector::PassiveOutput<> output;
124 void connectorSetup(PriorityJoin::ConnectorType & conn, int priority=-1);
129 friend class MultiConnectorMixin<PriorityJoin, connector::ActiveInput<> >;
134 //-/////////////////////////////////////////////////////////////////////////////////////////////////
136 //#include "Joins.ct"
137 //#include "Joins.cti"
144 // comment-column: 40
145 // c-file-style: "senf"
146 // indent-tabs-mode: nil
147 // ispell-local-dictionary: "american"
148 // compile-command: "scons -u test"