X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FJoins.hh;h=6c260c086eff7161a34fcd5221240ae138f72c05;hb=1e7062482bb6d99a0c36b641069c73a4a93da9cc;hp=266e80740975b2e1ecb22616f2cf6efaffddd3f2;hpb=412024ed31a4ab4eaea7a4165a434f8efebee325;p=senf.git diff --git a/PPI/Joins.hh b/PPI/Joins.hh index 266e807..6c260c0 100644 --- a/PPI/Joins.hh +++ b/PPI/Joins.hh @@ -31,6 +31,7 @@ #include "predecl.hh" #include "Connectors.hh" #include "Module.hh" +#include "MultiConnectorMixin.hh" //#include "Joins.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -38,16 +39,6 @@ namespace senf { namespace ppi { -#ifndef DOXYGEN - - template - connector::GenericPassiveInput & connect(Source & source, module::PassiveJoin & target); - - template - connector::GenericActiveInput & connect(Source & source, module::PriorityJoin & target); - -#endif - namespace module { /** \brief Join multiple packet streams with passive inputs @@ -70,7 +61,8 @@ namespace module { \ingroup routing_modules */ class PassiveJoin - : public Module + : public Module, + public MultiConnectorMixin > { SENF_PPI_MODULE(PassiveJoin); public: @@ -79,22 +71,12 @@ namespace module { PassiveJoin(); private: - connector::PassiveInput<> & newInput(); - -#ifndef DOXYGEN - // I didn't get template friend functions to work ... - public: -#endif - template - connector::GenericPassiveInput & connect(Source & source); - - private: + void connectorSetup(connector::PassiveInput<> & conn); void request(connector::GenericPassiveInput & input); void onThrottle(); void onUnthrottle(); - typedef boost::ptr_vector > Inputs; - Inputs inputs_; + friend class MultiConnectorMixin >; }; /** \brief Join multiple packet streams with active inputs @@ -124,7 +106,8 @@ namespace module { \ingroup routing_modules */ class PriorityJoin - : public Module + : public Module, + public MultiConnectorMixin > { SENF_PPI_MODULE(PriorityJoin); public: @@ -133,21 +116,12 @@ namespace module { PriorityJoin(); private: - connector::ActiveInput<> & newInput(); - -#ifndef DOXYGEN - public: -#endif - template - connector::GenericActiveInput & connect(Source & source); - - private: + void connectorSetup(PriorityJoin::ConnectorType & conn, int priority=-1); void request(); void onThrottle(); void onUnthrottle(); - typedef boost::ptr_vector > Inputs; - Inputs inputs_; + friend class MultiConnectorMixin >; }; }}} @@ -155,7 +129,7 @@ namespace module { ///////////////////////////////hh.e//////////////////////////////////////// #include "Joins.cci" //#include "Joins.ct" -#include "Joins.cti" +//#include "Joins.cti" #endif