From: g0dil Date: Mon, 29 Jun 2009 08:49:33 +0000 (+0000) Subject: PPI: Rename DynamicConnectorMixin to MultiConnectorMixin X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=745cd102229014f9f48f690b30b47cddb9401b70;p=senf.git PPI: Rename DynamicConnectorMixin to MultiConnectorMixin git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1243 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/PPI/AnnotationRouter.ct b/PPI/AnnotationRouter.ct index 6231164..29a9cab 100644 --- a/PPI/AnnotationRouter.ct +++ b/PPI/AnnotationRouter.ct @@ -52,7 +52,7 @@ template prefix_ void senf::ppi::module::AnnotationRouter::request() { Packet p (input()); - typename AnnotationRouter::DynamicConnectorContainer::iterator i ( + typename AnnotationRouter::ContainerType::iterator i ( this->connectors().find(p.annotation())); if (i == this->connectors().end()) defaultOutput(p); diff --git a/PPI/AnnotationRouter.hh b/PPI/AnnotationRouter.hh index 7badaaf..ff12b97 100644 --- a/PPI/AnnotationRouter.hh +++ b/PPI/AnnotationRouter.hh @@ -31,7 +31,7 @@ #include "../Utils/String.hh" #include "Module.hh" #include "Connectors.hh" -#include "DynamicConnectorMixin.hh" +#include "MultiConnectorMixin.hh" //#include "AnnotationRouter.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -96,7 +96,7 @@ namespace module { template class AnnotationRouter : public Module, - public DynamicConnectorMixin< AnnotationRouter, + public MultiConnectorMixin< AnnotationRouter, connector::ActiveOutput<>, AnnotationType > { @@ -119,7 +119,7 @@ namespace module { typedef boost::ptr_map > Outputs; Outputs outputs_; - friend class DynamicConnectorMixin< AnnotationRouter, + friend class MultiConnectorMixin< AnnotationRouter, connector::ActiveOutput<>, AnnotationType >; }; diff --git a/PPI/Duplicators.cc b/PPI/Duplicators.cc index b6dd077..dfbfaf9 100644 --- a/PPI/Duplicators.cc +++ b/PPI/Duplicators.cc @@ -33,7 +33,7 @@ ///////////////////////////////cc.p//////////////////////////////////////// prefix_ void -senf::ppi::module::ActiveDuplicator::connectorSetup(ActiveDuplicator::DynamicConnector & conn) +senf::ppi::module::ActiveDuplicator::connectorSetup(ActiveDuplicator::ConnectorType & conn) { route(input, conn); } @@ -41,8 +41,8 @@ senf::ppi::module::ActiveDuplicator::connectorSetup(ActiveDuplicator::DynamicCon prefix_ void senf::ppi::module::ActiveDuplicator::request() { Packet p (input()); - ActiveDuplicator::ConnectorContainer::iterator i (connectors().begin()); - ActiveDuplicator::ConnectorContainer::iterator const i_end (connectors().end()); + ActiveDuplicator::ContainerType::iterator i (connectors().begin()); + ActiveDuplicator::ContainerType::iterator const i_end (connectors().end()); for (; i != i_end; ++i) (*i)(p); } diff --git a/PPI/Duplicators.hh b/PPI/Duplicators.hh index fea0a46..1f58c73 100644 --- a/PPI/Duplicators.hh +++ b/PPI/Duplicators.hh @@ -31,7 +31,7 @@ #include "predecl.hh" #include "Connectors.hh" #include "Module.hh" -#include "DynamicConnectorMixin.hh" +#include "MultiConnectorMixin.hh" //#include "Duplicators.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -59,7 +59,7 @@ namespace module { */ class ActiveDuplicator : public Module, - public DynamicConnectorMixin > + public MultiConnectorMixin > { SENF_PPI_MODULE(ActiveDuplicator); public: @@ -68,10 +68,10 @@ namespace module { ActiveDuplicator(); private: - void connectorSetup(ActiveDuplicator::DynamicConnector & conn); + void connectorSetup(ActiveDuplicator::ConnectorType & conn); void request(); - friend class DynamicConnectorMixin >; + friend class MultiConnectorMixin >; }; }}} diff --git a/PPI/Joins.cc b/PPI/Joins.cc index 2ecccf3..653149a 100644 --- a/PPI/Joins.cc +++ b/PPI/Joins.cc @@ -76,7 +76,7 @@ prefix_ void senf::ppi::module::PassiveJoin::onUnthrottle() // private members prefix_ void -senf::ppi::module::PriorityJoin::connectorSetup(PriorityJoin::DynamicConnector & conn, +senf::ppi::module::PriorityJoin::connectorSetup(PriorityJoin::ConnectorType & conn, int priority) { noroute(conn); @@ -98,7 +98,7 @@ prefix_ void senf::ppi::module::PriorityJoin::request() { using boost::lambda::_1; using boost::lambda::bind; - PriorityJoin::ConnectorContainer::iterator i ( + PriorityJoin::ContainerType::iterator i ( std::find_if(connectors().begin(), connectors().end(), ! bind(&connector::GenericActiveInput::throttled, _1))); if (i != connectors().end()) diff --git a/PPI/Joins.hh b/PPI/Joins.hh index a11ac41..6c260c0 100644 --- a/PPI/Joins.hh +++ b/PPI/Joins.hh @@ -31,7 +31,7 @@ #include "predecl.hh" #include "Connectors.hh" #include "Module.hh" -#include "DynamicConnectorMixin.hh" +#include "MultiConnectorMixin.hh" //#include "Joins.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -62,7 +62,7 @@ namespace module { */ class PassiveJoin : public Module, - public DynamicConnectorMixin > + public MultiConnectorMixin > { SENF_PPI_MODULE(PassiveJoin); public: @@ -76,7 +76,7 @@ namespace module { void onThrottle(); void onUnthrottle(); - friend class DynamicConnectorMixin >; + friend class MultiConnectorMixin >; }; /** \brief Join multiple packet streams with active inputs @@ -107,7 +107,7 @@ namespace module { */ class PriorityJoin : public Module, - public DynamicConnectorMixin > + public MultiConnectorMixin > { SENF_PPI_MODULE(PriorityJoin); public: @@ -116,12 +116,12 @@ namespace module { PriorityJoin(); private: - void connectorSetup(PriorityJoin::DynamicConnector & conn, int priority=-1); + void connectorSetup(PriorityJoin::ConnectorType & conn, int priority=-1); void request(); void onThrottle(); void onUnthrottle(); - friend class DynamicConnectorMixin >; + friend class MultiConnectorMixin >; }; }}} diff --git a/PPI/DynamicConnectorMixin.cti b/PPI/MultiConnectorMixin.cti similarity index 71% rename from PPI/DynamicConnectorMixin.cti rename to PPI/MultiConnectorMixin.cti index 97742b2..4b563e0 100644 --- a/PPI/DynamicConnectorMixin.cti +++ b/PPI/MultiConnectorMixin.cti @@ -21,33 +21,33 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief DynamicConnectorMixin inline template implementation */ + \brief MultiConnectorMixin inline template implementation */ -//#include "DynamicConnectorMixin.ih" +//#include "MultiConnectorMixin.ih" // Custom includes #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// -template -prefix_ ContainerType & -senf::ppi::module::DynamicConnectorMixin::connectors() +template +prefix_ ContainerType_ & +senf::ppi::module::MultiConnectorMixin::connectors() { return connectors_; } -template -prefix_ ContainerType & -senf::ppi::module::DynamicConnectorMixin::connectors() +template +prefix_ ContainerType_ & +senf::ppi::module::MultiConnectorMixin::connectors() { return connectors_; } #define BOOST_PP_ITERATION_PARAMS_1 (4, ( \ 0, \ - SENF_DYNAMIC_CONNECTOR_MAX_ARGS, \ - SENF_ABSOLUTE_INCLUDE_PATH(PPI/DynamicConnectorMixin.mpp), \ + SENF_MULTI_CONNECTOR_MAX_ARGS, \ + SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \ 3 )) #include BOOST_PP_ITERATE() diff --git a/PPI/DynamicConnectorMixin.hh b/PPI/MultiConnectorMixin.hh similarity index 66% rename from PPI/DynamicConnectorMixin.hh rename to PPI/MultiConnectorMixin.hh index 996dc05..85c1133 100644 --- a/PPI/DynamicConnectorMixin.hh +++ b/PPI/MultiConnectorMixin.hh @@ -21,10 +21,10 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief DynamicConnectorMixin public header */ + \brief MultiConnectorMixin public header */ -#ifndef HH_SENF_PPI_DynamicConnectorMixin_ -#define HH_SENF_PPI_DynamicConnectorMixin_ 1 +#ifndef HH_SENF_PPI_MultiConnectorMixin_ +#define HH_SENF_PPI_MultiConnectorMixin_ 1 // Custom includes #include "../config.hh" @@ -34,11 +34,11 @@ #include "Connectors.hh" #include "Setup.hh" -#include "DynamicConnectorMixin.mpp" +#include "MultiConnectorMixin.mpp" ///////////////////////////////hh.p//////////////////////////////////////// -#ifndef SENF_DYNAMIC_CONNECTOR_MAX_ARGS -#define SENF_DYNAMIC_CONNECTOR_MAX_ARGS 3 +#ifndef SENF_MULTI_CONNECTOR_MAX_ARGS +#define SENF_MULTI_CONNECTOR_MAX_ARGS 3 #endif namespace senf { @@ -46,8 +46,8 @@ namespace ppi { # define BOOST_PP_ITERATION_PARAMS_1 (4, ( \ 0, \ - SENF_DYNAMIC_CONNECTOR_MAX_ARGS, \ - SENF_ABSOLUTE_INCLUDE_PATH(PPI/DynamicConnectorMixin.mpp), \ + SENF_MULTI_CONNECTOR_MAX_ARGS, \ + SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \ 2 )) # include BOOST_PP_ITERATE() @@ -55,11 +55,11 @@ namespace module { namespace detail { template - struct DefaultDynamicContainer + struct DefaultMultiConnectorContainer { typedef boost::ptr_map type; }; template - struct DefaultDynamicContainer + struct DefaultMultiConnectorContainer { typedef boost::ptr_vector type; }; template @@ -90,62 +90,62 @@ namespace detail { The list manager will insert the new connector at the end of the list BEFORE calling connetorSetup. This allows the setup routine to manipulate the position. */ - template ::type> - class DynamicConnectorMixin - : private detail::DynamicDisableType::type + template ::type> + class MultiConnectorMixin + : private detail::DynamicDisableType::type { public: - typedef ConnectorType DynamicConnector; + typedef ConnectorType_ ConnectorType; protected: - typedef ContainerType DynamicConnectorContainer; - ContainerType & connectors(); + typedef ContainerType_ ContainerType; + ContainerType_ & connectors(); private: # define BOOST_PP_ITERATION_PARAMS_1 (4, ( \ 0, \ - SENF_DYNAMIC_CONNECTOR_MAX_ARGS, \ - SENF_ABSOLUTE_INCLUDE_PATH(PPI/DynamicConnectorMixin.mpp), \ + SENF_MULTI_CONNECTOR_MAX_ARGS, \ + SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \ 1 )) # include BOOST_PP_ITERATE() - ContainerType connectors_; + ContainerType_ connectors_; }; - template - class DynamicConnectorMixin - : private detail::DynamicDisableType::type + template + class MultiConnectorMixin + : private detail::DynamicDisableType::type { public: - typedef ConnectorType DynamicConnector; + typedef ConnectorType_ ConnectorType; protected: - typedef ContainerType ConnectorContainer; - ContainerType & connectors(); + typedef ContainerType_ ContainerType; + ContainerType_ & connectors(); private: # define BOOST_PP_ITERATION_PARAMS_1 (4, ( \ 0, \ - SENF_DYNAMIC_CONNECTOR_MAX_ARGS, \ - SENF_ABSOLUTE_INCLUDE_PATH(PPI/DynamicConnectorMixin.mpp), \ + SENF_MULTI_CONNECTOR_MAX_ARGS, \ + SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \ 1 )) # include BOOST_PP_ITERATE() - ContainerType connectors_; + ContainerType_ connectors_; }; }}} ///////////////////////////////hh.e//////////////////////////////////////// -//#include "DynamicConnectorMixin.cci" -//#include "DynamicConnectorMixin.ct" -#include "DynamicConnectorMixin.cti" +//#include "MultiConnectorMixin.cci" +//#include "MultiConnectorMixin.ct" +#include "MultiConnectorMixin.cti" #endif diff --git a/PPI/DynamicConnectorMixin.mpp b/PPI/MultiConnectorMixin.mpp similarity index 82% rename from PPI/DynamicConnectorMixin.mpp rename to PPI/MultiConnectorMixin.mpp index 19d6b8c..be0c920 100644 --- a/PPI/DynamicConnectorMixin.mpp +++ b/PPI/MultiConnectorMixin.mpp @@ -21,10 +21,10 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief DynamicConnectorMixin Boost.Preprocesser external iteration include */ + \brief MultiConnectorMixin Boost.Preprocesser external iteration include */ -#if !BOOST_PP_IS_ITERATING && !defined(MPP_SENF_PPI_DynamicConnectorMixin_) -#define MPP_SENF_PPI_DynamicConnectorMixin_ 1 +#if !BOOST_PP_IS_ITERATING && !defined(MPP_SENF_PPI_MultiConnectorMixin_) +#define MPP_SENF_PPI_MultiConnectorMixin_ 1 // Custom includes #include @@ -63,21 +63,21 @@ // //////////////////////////////////////////////////////////////////////// #if BOOST_PP_ITERATION_FLAGS()==1 // ////////////////////////////////////// // //////////////////////////////////////////////////////////////////////// -// DynamicConnectorMixin member declaration +// MultiConnectorMixin member declaration mpp_TplParams() -ConnectorType & newConnector( mpp_FnParams() ); +ConnectorType_ & newConnector( mpp_FnParams() ); template friend typename boost::enable_if< - boost::is_base_of, - typename Source::DynamicConnector & >::type + boost::is_base_of, + typename Source::ConnectorType & >::type senf::ppi::connect(Source & source, Target & target mpp_FnParamsKomma()); template friend typename boost::enable_if< - boost::is_base_of, - typename Target::DynamicConnector & >::type + boost::is_base_of, + typename Target::ConnectorType & >::type senf::ppi::connect(Source & source, Target & target mpp_FnParamsKomma()); // //////////////////////////////////////////////////////////////////////// @@ -87,14 +87,14 @@ friend typename boost::enable_if< template typename boost::enable_if< - boost::is_base_of, - typename Source::DynamicConnector & >::type + boost::is_base_of, + typename Source::ConnectorType & >::type connect(Source & source, Target & target mpp_FnParamsKomma()); template typename boost::enable_if< - boost::is_base_of, - typename Target::DynamicConnector & >::type + boost::is_base_of, + typename Target::ConnectorType & >::type connect(Source & source, Target & target mpp_FnParamsKomma()); // //////////////////////////////////////////////////////////////////////// @@ -102,34 +102,34 @@ connect(Source & source, Target & target mpp_FnParamsKomma()); // //////////////////////////////////////////////////////////////////////// // Implementation -template +template mpp_TplParams() -prefix_ ConnectorType & -senf::ppi::module::DynamicConnectorMixin:: +prefix_ ConnectorType_ & +senf::ppi::module::MultiConnectorMixin:: newConnector(mpp_FnParams()) { - std::auto_ptr conn (new ConnectorType); - KeyType key (static_cast(this)->connectorSetup(*conn mpp_CallParamsKomma())); + std::auto_ptr conn (new ConnectorType_); + KeyType_ key (static_cast(this)->connectorSetup(*conn mpp_CallParamsKomma())); return * connectors_.insert(key, conn).first->second; } -template +template mpp_TplParams() -prefix_ ConnectorType & -senf::ppi::module::DynamicConnectorMixin:: +prefix_ ConnectorType_ & +senf::ppi::module::MultiConnectorMixin:: newConnector(mpp_FnParams()) { - connectors_.push_back(new ConnectorType); - ConnectorType & conn (connectors_.back()); - try { static_cast(this)->connectorSetup(conn mpp_CallParamsKomma()); } + connectors_.push_back(new ConnectorType_); + ConnectorType_ & conn (connectors_.back()); + try { static_cast(this)->connectorSetup(conn mpp_CallParamsKomma()); } catch (...) { connectors_.pop_back(); throw; } return conn; } template typename boost::enable_if< - boost::is_base_of, - typename Source::DynamicConnector & >::type + boost::is_base_of, + typename Source::ConnectorType & >::type senf::ppi::connect(Source & source, Target & target mpp_FnParamsKomma()) { connect(source.newConnector(mpp_CallParams()), target); @@ -137,8 +137,8 @@ senf::ppi::connect(Source & source, Target & target mpp_FnParamsKomma()) template typename boost::enable_if< - boost::is_base_of, - typename Target::DynamicConnector & >::type + boost::is_base_of, + typename Target::ConnectorType & >::type senf::ppi::connect(Source & source, Target & target mpp_FnParamsKomma()) { connect(source, target.newConnector(mpp_CallParams())); diff --git a/PPI/DynamicConnectorMixin.test.cc b/PPI/MultiConnectorMixin.test.cc similarity index 89% rename from PPI/DynamicConnectorMixin.test.cc rename to PPI/MultiConnectorMixin.test.cc index 9eb5c3d..34b76d5 100644 --- a/PPI/DynamicConnectorMixin.test.cc +++ b/PPI/MultiConnectorMixin.test.cc @@ -21,13 +21,13 @@ // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file - \brief DynamicConnectorMixin.test unit tests */ + \brief MultiConnectorMixin.test unit tests */ -//#include "DynamicConnectorMixin.test.hh" -//#include "DynamicConnectorMixin.test.ih" +//#include "MultiConnectorMixin.test.hh" +//#include "MultiConnectorMixin.test.ih" // Custom includes -#include "DynamicConnectorMixin.hh" +#include "MultiConnectorMixin.hh" #include "../Utils/auto_unit_test.hh" #include