Console: SystemException in parseFile() should include filename
[senf.git] / senf / PPI / MultiConnectorMixin.mpp
index 78a3f8f..8000c67 100644 (file)
@@ -38,7 +38,6 @@
 #include <boost/mpl/and.hpp>
 #include <boost/mpl/not.hpp>
 #include <boost/tuple/tuple.hpp>
-#include <senf/Utils/type_traits.hh>
 
 // ///////////////////////////mpp.p////////////////////////////////////////
 #elif BOOST_PP_IS_ITERATING // ////////////////////////////////////////////
@@ -92,15 +91,6 @@ mpp_TplParams()
 ConnectorType_ & newConnector( mpp_FnParams() );
 
 // ////////////////////////////////////////////////////////////////////////
-#elif BOOST_PP_ITERATION_FLAGS()==9 // ////////////////////////////////////
-// ////////////////////////////////////////////////////////////////////////
-// senf::ppi::module::MultiConnectorMixin member declaration 1..2*MAX_ARGS
-
-template <class Source, class Target mpp_TplParamsKomma()>
-static boost::tuple<typename Source::ConnectorType &, typename Target::ConnectorType &>
-connect_(Source & source, Target & target mpp_FnParamsKomma());
-
-// ////////////////////////////////////////////////////////////////////////
 #elif BOOST_PP_ITERATION_FLAGS()==2 // ////////////////////////////////////
 // ////////////////////////////////////////////////////////////////////////
 // senf::ppi namespace member declaration 1..MAX_ARGS
@@ -167,7 +157,7 @@ prefix_ ConnectorType_ &
 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>::
 newConnector(mpp_FnParams())
 {
-    std::auto_ptr<ConnectorType_> conn (new ConnectorType_);
+    std::auto_ptr<ConnectorType_> conn (new detail::MultiConnectorWrapper<Self_,ConnectorType_>);
     KeyType_ key (static_cast<Self_*>(this)->connectorSetup(*conn mpp_CallParamsKomma()));
     return * connectors_.insert(key, conn).first->second;
 }
@@ -181,10 +171,10 @@ prefix_ ConnectorType_ &
 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>::
 newConnector(mpp_FnParams())
 {
-    connectors_.push_back(new ConnectorType_);
+    connectors_.push_back(new detail::MultiConnectorWrapper<Self_,ConnectorType_>);
     ConnectorType_ & conn (connectors_.back());
     try { static_cast<Self_*>(this)->connectorSetup(conn mpp_CallParamsKomma()); }
-    catch (...) { connectors_.pop_back(); throw; }
+    catch (...) { disconnected(conn); throw; }
     return conn;
 }
 
@@ -197,7 +187,7 @@ prefix_ ConnectorType_ &
 senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,void>::
 newConnector(mpp_FnParams())
 {
-    std::auto_ptr<ConnectorType_> cp (new ConnectorType_);
+    std::auto_ptr<ConnectorType_> cp (new detail::MultiConnectorWrapper<Self_,ConnectorType_>);
     ConnectorType_ & cref (*cp);
     static_cast<Self_*>(this)->connectorSetup(cp mpp_CallParamsKomma());
     return cref;