PPI: Rename DynamicConnectorMixin to MultiConnectorMixin
g0dil [Mon, 29 Jun 2009 08:49:33 +0000 (08:49 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1243 270642c3-0616-0410-b53a-bc976706d245

PPI/AnnotationRouter.ct
PPI/AnnotationRouter.hh
PPI/Duplicators.cc
PPI/Duplicators.hh
PPI/Joins.cc
PPI/Joins.hh
PPI/MultiConnectorMixin.cti [moved from PPI/DynamicConnectorMixin.cti with 71% similarity]
PPI/MultiConnectorMixin.hh [moved from PPI/DynamicConnectorMixin.hh with 66% similarity]
PPI/MultiConnectorMixin.mpp [moved from PPI/DynamicConnectorMixin.mpp with 82% similarity]
PPI/MultiConnectorMixin.test.cc [moved from PPI/DynamicConnectorMixin.test.cc with 89% similarity]

index 6231164..29a9cab 100644 (file)
@@ -52,7 +52,7 @@ template <class AnnotationType>
 prefix_ void senf::ppi::module::AnnotationRouter<AnnotationType>::request()
 {
     Packet p (input());
-    typename AnnotationRouter::DynamicConnectorContainer::iterator i (
+    typename AnnotationRouter::ContainerType::iterator i (
         this->connectors().find(p.annotation<AnnotationType>()));
     if (i == this->connectors().end())
         defaultOutput(p);
index 7badaaf..ff12b97 100644 (file)
@@ -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 AnnotationType>
     class AnnotationRouter 
         : public Module, 
-          public DynamicConnectorMixin< AnnotationRouter<AnnotationType>,
+          public MultiConnectorMixin< AnnotationRouter<AnnotationType>,
                                         connector::ActiveOutput<>,
                                         AnnotationType >
     {
@@ -119,7 +119,7 @@ namespace module {
         typedef boost::ptr_map<AnnotationType, connector::ActiveOutput<> > Outputs;
         Outputs outputs_;
 
-        friend class DynamicConnectorMixin< AnnotationRouter<AnnotationType>,
+        friend class MultiConnectorMixin< AnnotationRouter<AnnotationType>,
                                             connector::ActiveOutput<>,
                                             AnnotationType >;
     };
index b6dd077..dfbfaf9 100644 (file)
@@ -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);
 }
index fea0a46..1f58c73 100644 (file)
@@ -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<ActiveDuplicator, connector::ActiveOutput<> >
+          public MultiConnectorMixin<ActiveDuplicator, connector::ActiveOutput<> >
     {
         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<ActiveDuplicator, connector::ActiveOutput<> >;
+        friend class MultiConnectorMixin<ActiveDuplicator, connector::ActiveOutput<> >;
     };
 
 }}}
index 2ecccf3..653149a 100644 (file)
@@ -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())
index a11ac41..6c260c0 100644 (file)
@@ -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<PassiveJoin, connector::PassiveInput<> >
+          public MultiConnectorMixin<PassiveJoin, connector::PassiveInput<> >
     {
         SENF_PPI_MODULE(PassiveJoin);
     public:
@@ -76,7 +76,7 @@ namespace module {
         void onThrottle();
         void onUnthrottle();
 
-        friend class DynamicConnectorMixin<PassiveJoin, connector::PassiveInput<> >;
+        friend class MultiConnectorMixin<PassiveJoin, connector::PassiveInput<> >;
     };
 
     /** \brief Join multiple packet streams with active inputs
@@ -107,7 +107,7 @@ namespace module {
      */
     class PriorityJoin
         : public Module,
-          public DynamicConnectorMixin<PriorityJoin, connector::ActiveInput<> >
+          public MultiConnectorMixin<PriorityJoin, connector::ActiveInput<> >
     {
         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<PriorityJoin, connector::ActiveInput<> >;
+        friend class MultiConnectorMixin<PriorityJoin, connector::ActiveInput<> >;
     };
 
 }}}
similarity index 71%
rename from PPI/DynamicConnectorMixin.cti
rename to PPI/MultiConnectorMixin.cti
index 97742b2..4b563e0 100644 (file)
 // 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 <class Self, class ConnectorType, class KeyType, class ContainerType>
-prefix_ ContainerType &
-senf::ppi::module::DynamicConnectorMixin<Self,ConnectorType,KeyType,ContainerType>::connectors()
+template <class Self_, class ConnectorType_, class KeyType_, class ContainerType_>
+prefix_ ContainerType_ &
+senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>::connectors()
 {
     return connectors_;
 }
 
-template <class Self, class ConnectorType, class ContainerType>
-prefix_ ContainerType &
-senf::ppi::module::DynamicConnectorMixin<Self, ConnectorType, void, ContainerType>::connectors()
+template <class Self_, class ConnectorType_, class ContainerType_>
+prefix_ ContainerType_ &
+senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>::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()
 
similarity index 66%
rename from PPI/DynamicConnectorMixin.hh
rename to PPI/MultiConnectorMixin.hh
index 996dc05..85c1133 100644 (file)
 // 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"
 #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 <class KeyType, class ConnectorType>
-    struct DefaultDynamicContainer 
+    struct DefaultMultiConnectorContainer 
     { typedef boost::ptr_map<KeyType, ConnectorType> type; };
 
     template <class ConnectorType>
-    struct DefaultDynamicContainer<void,ConnectorType> 
+    struct DefaultMultiConnectorContainer<void,ConnectorType> 
     { typedef boost::ptr_vector<ConnectorType> type; };
 
     template <class ConnectorType>
@@ -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 <class Self, 
-              class ConnectorType, 
-              class KeyType=void, 
-              class ContainerType=typename detail::DefaultDynamicContainer<
-                                               KeyType,ConnectorType>::type>
-    class DynamicConnectorMixin 
-        : private detail::DynamicDisableType<ConnectorType>::type
+    template <class Self_, 
+              class ConnectorType_, 
+              class KeyType_=void, 
+              class ContainerType_=typename detail::DefaultMultiConnectorContainer<
+                                               KeyType_,ConnectorType_>::type>
+    class MultiConnectorMixin 
+        : private detail::DynamicDisableType<ConnectorType_>::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 Self,
-              class ConnectorType,
-              class ContainerType>
-    class DynamicConnectorMixin<Self, ConnectorType, void, ContainerType>
-        : private detail::DynamicDisableType<ConnectorType>::type
+    template <class Self_,
+              class ConnectorType_,
+              class ContainerType_>
+    class MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>
+        : private detail::DynamicDisableType<ConnectorType_>::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
 
 \f
similarity index 82%
rename from PPI/DynamicConnectorMixin.mpp
rename to PPI/MultiConnectorMixin.mpp
index 19d6b8c..be0c920 100644 (file)
 // 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 <boost/preprocessor/iteration/iterate.hpp>
 // ////////////////////////////////////////////////////////////////////////
 #if BOOST_PP_ITERATION_FLAGS()==1 // //////////////////////////////////////
 // ////////////////////////////////////////////////////////////////////////
-// DynamicConnectorMixin member declaration
+// MultiConnectorMixin member declaration
 
 mpp_TplParams()
-ConnectorType & newConnector( mpp_FnParams() );
+ConnectorType_ & newConnector( mpp_FnParams() );
 
 template <class Source, class Target mpp_TplParamsKomma()>
 friend typename boost::enable_if<
-        boost::is_base_of<connector::OutputConnector, typename Source::DynamicConnector>,
-        typename Source::DynamicConnector & >::type
+        boost::is_base_of<connector::OutputConnector, typename Source::ConnectorType>,
+        typename Source::ConnectorType & >::type
     senf::ppi::connect(Source & source, Target & target mpp_FnParamsKomma());
 
 template <class Source, class Target mpp_TplParamsKomma()>
 friend typename boost::enable_if<
-        boost::is_base_of<connector::InputConnector, typename Target::DynamicConnector>,
-        typename Target::DynamicConnector & >::type
+        boost::is_base_of<connector::InputConnector, typename Target::ConnectorType>,
+        typename Target::ConnectorType & >::type
     senf::ppi::connect(Source & source, Target & target mpp_FnParamsKomma());
 
 // ////////////////////////////////////////////////////////////////////////
@@ -87,14 +87,14 @@ friend typename boost::enable_if<
 
 template <class Source, class Target mpp_TplParamsKomma()>
 typename boost::enable_if<
-    boost::is_base_of<connector::OutputConnector, typename Source::DynamicConnector>,
-    typename Source::DynamicConnector & >::type
+    boost::is_base_of<connector::OutputConnector, typename Source::ConnectorType>,
+    typename Source::ConnectorType & >::type
 connect(Source & source, Target & target mpp_FnParamsKomma());
 
 template <class Source, class Target mpp_TplParamsKomma()>
 typename boost::enable_if<
-    boost::is_base_of<connector::InputConnector, typename Target::DynamicConnector>,
-    typename Target::DynamicConnector & >::type
+    boost::is_base_of<connector::InputConnector, typename Target::ConnectorType>,
+    typename Target::ConnectorType & >::type
 connect(Source & source, Target & target mpp_FnParamsKomma());
 
 // ////////////////////////////////////////////////////////////////////////
@@ -102,34 +102,34 @@ connect(Source & source, Target & target mpp_FnParamsKomma());
 // ////////////////////////////////////////////////////////////////////////
 // Implementation
 
-template <class Self, class ConnectorType, class KeyType, class ContainerType>
+template <class Self_, class ConnectorType_, class KeyType_, class ContainerType_>
 mpp_TplParams()
-prefix_ ConnectorType &
-senf::ppi::module::DynamicConnectorMixin<Self,ConnectorType,KeyType,ContainerType>::
+prefix_ ConnectorType_ &
+senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>::
 newConnector(mpp_FnParams())
 {
-    std::auto_ptr<ConnectorType> conn (new ConnectorType);
-    KeyType key (static_cast<Self*>(this)->connectorSetup(*conn mpp_CallParamsKomma()));
+    std::auto_ptr<ConnectorType_> conn (new ConnectorType_);
+    KeyType_ key (static_cast<Self_*>(this)->connectorSetup(*conn mpp_CallParamsKomma()));
     return * connectors_.insert(key, conn).first->second;
 }
 
-template <class Self, class ConnectorType, class ContainerType>
+template <class Self_, class ConnectorType_, class ContainerType_>
 mpp_TplParams()
-prefix_ ConnectorType &
-senf::ppi::module::DynamicConnectorMixin<Self,ConnectorType,void,ContainerType>::
+prefix_ ConnectorType_ &
+senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>::
 newConnector(mpp_FnParams())
 {
-    connectors_.push_back(new ConnectorType);
-    ConnectorType & conn (connectors_.back());
-    try { static_cast<Self*>(this)->connectorSetup(conn mpp_CallParamsKomma()); }
+    connectors_.push_back(new ConnectorType_);
+    ConnectorType_ & conn (connectors_.back());
+    try { static_cast<Self_*>(this)->connectorSetup(conn mpp_CallParamsKomma()); }
     catch (...) { connectors_.pop_back(); throw; }
     return conn;
 }
 
 template <class Source, class Target mpp_TplParamsKomma()>
 typename boost::enable_if<
-    boost::is_base_of<senf::ppi::connector::OutputConnector, typename Source::DynamicConnector>,
-    typename Source::DynamicConnector & >::type
+    boost::is_base_of<senf::ppi::connector::OutputConnector, typename Source::ConnectorType>,
+    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 <class Source, class Target mpp_TplParamsKomma()>
 typename boost::enable_if<
-    boost::is_base_of<senf::ppi::connector::InputConnector, typename Target::DynamicConnector>,
-    typename Target::DynamicConnector & >::type
+    boost::is_base_of<senf::ppi::connector::InputConnector, typename Target::ConnectorType>,
+    typename Target::ConnectorType & >::type
 senf::ppi::connect(Source & source, Target & target mpp_FnParamsKomma())
 {
     connect(source, target.newConnector(mpp_CallParams()));
similarity index 89%
rename from PPI/DynamicConnectorMixin.test.cc
rename to PPI/MultiConnectorMixin.test.cc
index 9eb5c3d..34b76d5 100644 (file)
 // 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 <boost/test/test_tools.hpp>