X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FJoins.hh;h=6c260c086eff7161a34fcd5221240ae138f72c05;hb=1e7062482bb6d99a0c36b641069c73a4a93da9cc;hp=3f7087cc2d19acec7183ff579a42739a081d9e2c;hpb=69255c0f1669fc80b0e4a2bf524715f336b127ad;p=senf.git diff --git a/PPI/Joins.hh b/PPI/Joins.hh index 3f7087c..6c260c0 100644 --- a/PPI/Joins.hh +++ b/PPI/Joins.hh @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY +// 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,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 @@ -120,11 +102,12 @@ 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 - : 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