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 "Connectors.hh"
37 #include "MultiConnectorMixin.hh"
39 //#include "Joins.mpp"
40 //-/////////////////////////////////////////////////////////////////////////////////////////////////
47 /** \brief Join multiple packet streams with passive inputs
49 The PassiveJoin will combine any number of packet streams. You may connect any number of
50 ActiveOutput<>'s to the PassiveJoin instance. The combined stream is then provided on the
51 ActiveOutput<> \a output.
53 Since PassiveJoin allows any number of incoming packet streams, the input connectors are
54 dynamically managed. A special senf::ppi::connect() overload is used to dynamically create
55 the needed input connectors. This hides this extra functionality from the user.
57 senf::ppi::module::PassiveJoin join;
59 ppi::connect(module1,join); // Connect first module to join's input
60 ppi::connect(module2.some_output,join); // Connect another module to join's input
61 ppi::connect(join,module3); // Forward combined stream to module3
64 \ingroup routing_modules
68 public MultiConnectorMixin<PassiveJoin, connector::PassiveInput<> >
70 SENF_PPI_MODULE(PassiveJoin);
72 connector::ActiveOutput<> output;
77 void connectorSetup(connector::PassiveInput<> & conn);
78 void request(connector::GenericPassiveInput & input);
82 friend class MultiConnectorMixin<PassiveJoin, connector::PassiveInput<> >;
85 /** \brief Join multiple packet streams with active inputs
87 The PriorityJoin will combine any number of packet streams. You may connect any number of
88 PassiveInput<>'s to the PassiveJoin instance. The combined stream is then provided on the
89 PassiveOutput<> \a output.
91 When a packet request is received on Priorityjoin's \a output, The request will be serviced
92 from the first unthrottled input. The order, in which connectors are connected to the
93 PriorityJoin's input is important: The earlier connected peer has the higher priority and
94 will be serviced first.
96 Since PriorityJoin allows any number of incoming packet streams, the input connectors are
97 dynamically managed. A special senf::ppi::connect() overload is used to dynamically create
98 the needed input connectors. This hides this extra functionality from the user.
100 senf::ppi::module::PriorityJoin join;
102 ppi::connect(module1,join); // Connect first module to join's input
103 ppi::connect(module2.some_output,join); // Connect another module to join's input
104 ppi::connect(join,module3); // Forward combined stream to module3
106 Here, \a module1 has higher priority than \a module2 which will only be queried if \a
107 module1 is throttled.
109 \ingroup routing_modules
113 public MultiConnectorMixin<PriorityJoin, connector::ActiveInput<> >
115 SENF_PPI_MODULE(PriorityJoin);
117 connector::PassiveOutput<> output;
122 void connectorSetup(PriorityJoin::ConnectorType & conn, int priority=-1);
127 friend class MultiConnectorMixin<PriorityJoin, connector::ActiveInput<> >;
132 //-/////////////////////////////////////////////////////////////////////////////////////////////////
134 //#include "Joins.ct"
135 //#include "Joins.cti"
142 // comment-column: 40
143 // c-file-style: "senf"
144 // indent-tabs-mode: nil
145 // ispell-local-dictionary: "american"
146 // compile-command: "scons -u test"