X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FJoins.hh;h=8960551b24d73f12060f4259c621acf8f33c2119;hb=fd3a0e8ac95d1158e9ea661ddf9187b67c70169f;hp=9fc9e87d8295af8127d1f69ed9e2416a622fc860;hpb=e8b91aa6a817af6d9a3714e7b66be6c0d6b0a4e5;p=senf.git diff --git a/PPI/Joins.hh b/PPI/Joins.hh index 9fc9e87..8960551 100644 --- a/PPI/Joins.hh +++ b/PPI/Joins.hh @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -23,8 +23,8 @@ /** \file \brief Joins public header */ -#ifndef HH_Joins_ -#define HH_Joins_ 1 +#ifndef HH_SENF_PPI_Joins_ +#define HH_SENF_PPI_Joins_ 1 // Custom includes #include @@ -41,10 +41,11 @@ namespace ppi { #ifndef DOXYGEN template - connector::PassiveInput & connect(Source & source, module::PassiveJoin & target); - + connector::GenericPassiveInput & connect(Source & source, module::PassiveJoin & target); + template - connector::ActiveInput & connect(Source & source, module::PriorityJoin & target); + connector::GenericActiveInput & connect(Source & source, module::PriorityJoin & target, + int priority = -1); #endif @@ -53,8 +54,8 @@ namespace module { /** \brief Join multiple packet streams with passive inputs The PassiveJoin will combine any number of packet streams. You may connect any number of - ActiveOutput's to the PassiveJoin instance. The combined stream is then provided on the - ActiveOutput \a output. + ActiveOutput<>'s to the PassiveJoin instance. The combined stream is then provided on the + ActiveOutput<> \a output. Since PassiveJoin allows any number of incoming packet streams, the input connectors are dynamically managed. A special senf::ppi::connect() overload is used to dynamically create @@ -74,34 +75,34 @@ namespace module { { SENF_PPI_MODULE(PassiveJoin); public: - connector::ActiveOutput output; + connector::ActiveOutput<> output; PassiveJoin(); private: - connector::PassiveInput & newInput(); + connector::PassiveInput<> & newInput(); #ifndef DOXYGEN // I didn't get template friend functions to work ... public: #endif template - connector::PassiveInput & connect(Source & source); + connector::GenericPassiveInput & connect(Source & source); private: - void request(connector::PassiveInput & input); + void request(connector::GenericPassiveInput & input); void onThrottle(); void onUnthrottle(); - typedef boost::ptr_vector Inputs; + typedef boost::ptr_vector > Inputs; Inputs inputs_; }; /** \brief Join multiple packet streams with active inputs The PriorityJoin will combine any number of packet streams. You may connect any number of - PassiveInput's to the PassiveJoin instance. The combined stream is then provided on the - PassiveOutput \a output. + PassiveInput<>'s to the PassiveJoin instance. The combined stream is then provided on the + PassiveOutput<> \a output. When a packet request is received on Priorityjoin's \a output, The request will be serviced from the first unthrottled input. The order, in which connectors are connected to the @@ -120,7 +121,7 @@ namespace module { \endcode Here, \a module1 has higher priority than \a module2 which will only be queried if \a module1 is throttled. - + \ingroup routing_modules */ class PriorityJoin @@ -128,25 +129,25 @@ namespace module { { SENF_PPI_MODULE(PriorityJoin); public: - connector::PassiveOutput output; + connector::PassiveOutput<> output; PriorityJoin(); private: - connector::ActiveInput & newInput(); + connector::ActiveInput<> & newInput(int priority); #ifndef DOXYGEN public: #endif template - connector::ActiveInput & connect(Source & source); + connector::GenericActiveInput & connect(Source & source, int prioricty); private: void request(); void onThrottle(); void onUnthrottle(); - typedef boost::ptr_vector Inputs; + typedef boost::ptr_vector > Inputs; Inputs inputs_; };