X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FJoins.hh;h=6c260c086eff7161a34fcd5221240ae138f72c05;hb=b1f9349b1f3521d58cbef52ead0f2e5303a58c9e;hp=77cb333b86a238653230e5c6a79e6c822a2833dd;hpb=a1a6c76a214ad1935032826713cabaf9ac57bf07;p=senf.git diff --git a/PPI/Joins.hh b/PPI/Joins.hh index 77cb333..6c260c0 100644 --- a/PPI/Joins.hh +++ b/PPI/Joins.hh @@ -23,14 +23,15 @@ /** \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 #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