Fix documentation build under maverick (doxygen 1.7.1)
[senf.git] / senf / PPI / MultiConnectorMixin.mpp
index 78a3f8f..afbfbd8 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 //
-// Copyright (C) 2009 
+// Copyright (C) 2009
 // Fraunhofer Institute for Open Communication Systems (FOKUS)
 // Competence Center NETwork research (NET), St. Augustin, GERMANY
 //     Stefan Bund <g0dil@berlios.de>
 // Custom includes
 #include <boost/preprocessor/iteration/iterate.hpp>
 #include <boost/preprocessor/control/if.hpp>
-#include <boost/preprocessor/facilities/empty.hpp> 
+#include <boost/preprocessor/facilities/empty.hpp>
 #include <boost/preprocessor/repetition/enum_params.hpp>
 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
 #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
-#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp> 
+#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
 #include <boost/type_traits/is_base_of.hpp>
 #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 // ////////////////////////////////////////////
-// ////////////////////////////////////////////////////////////////////////
+//-///////////////////////////mpp.p////////////////////////////////////////
+#elif BOOST_PP_IS_ITERATING //-////////////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
 // Local Macros
 
 // => template <class A0, class A1, ...>
 #define mpp_CallParamsKomma2()                                           \
     BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_FRAME_ITERATION(1), b)
 
-// ////////////////////////////////////////////////////////////////////////
-#if BOOST_PP_ITERATION_FLAGS()==1 // //////////////////////////////////////
-// ////////////////////////////////////////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
+#if BOOST_PP_ITERATION_FLAGS()==1 //-//////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
 // senf::ppi::module::MultiConnectorMixin member declaration 1..MAX_ARGS
 
 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 // ////////////////////////////////////
-// ////////////////////////////////////////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
+#elif BOOST_PP_ITERATION_FLAGS()==2 //-////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
 // senf::ppi namespace member declaration 1..MAX_ARGS
 
 // Here the reference to Source::ConnectorType / Target::ConnectorType
@@ -131,9 +121,9 @@ connect(Source & source, Target & target mpp_FnParamsKomma());
         4 ))
 #include BOOST_PP_ITERATE()
 
-// ////////////////////////////////////////////////////////////////////////
-#elif BOOST_PP_ITERATION_FLAGS()==4 // ////////////////////////////////////
-// ////////////////////////////////////////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
+#elif BOOST_PP_ITERATION_FLAGS()==4 //-////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
 // senf::ppi namespace member declaration 1..MAX_ARGS x 1..MAX_ARGS
 
 template <class Source, class Target mpp_TplParamsKomma() mpp_TplParamsKomma2()>
@@ -144,21 +134,21 @@ typename boost::enable_if<
     boost::tuple<typename Source::ConnectorType &, typename Target::ConnectorType &> >::type
 connect(Source & source mpp_FnParamsKomma(), Target & target mpp_FnParamsKomma2());
 
-// ////////////////////////////////////////////////////////////////////////
-#elif BOOST_PP_ITERATION_FLAGS()==8 // ////////////////////////////////////
-// ////////////////////////////////////////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
+#elif BOOST_PP_ITERATION_FLAGS()==8 //-////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
 // senf::ppi::module::detail::MultiConnectorMixinAccess member declaration 1..MAX_ARGS
 
 template <class Module mpp_TplParamsKomma()>
-static typename Module::ConnectorType & 
+static typename Module::ConnectorType &
 newConnector(Module & module mpp_FnParamsKomma());
 
-// ////////////////////////////////////////////////////////////////////////
-#elif BOOST_PP_ITERATION_FLAGS()==3 // ////////////////////////////////////
-// ////////////////////////////////////////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
+#elif BOOST_PP_ITERATION_FLAGS()==3 //-////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
 // Implementation 1..MAX_ARGS
 
-////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 // Map container
 
 template <class Self_, class ConnectorType_, class KeyType_, class ContainerType_>
@@ -167,12 +157,12 @@ 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;
 }
 
-////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 // Vector container
 
 template <class Self_, class ConnectorType_, class ContainerType_>
@@ -181,14 +171,14 @@ 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;
 }
 
-////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 // User managed container
 
 template <class Self_, class ConnectorType_>
@@ -197,13 +187,13 @@ 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;
 }
 
-////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 // senf::ppi::connect
 
 template <class Source, class Target mpp_TplParamsKomma()>
@@ -234,11 +224,11 @@ senf::ppi::connect(Source & source, Target & target mpp_FnParamsKomma())
     return c;
 }
 
-////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
 // senf::ppi::module::detail::MultiConnectorMixinAccess members
 
 template <class Module mpp_TplParamsKomma()>
-typename Module::ConnectorType & 
+typename Module::ConnectorType &
 senf::ppi::module::detail::MultiConnectorMixinAccess::newConnector(
     Module & module mpp_FnParamsKomma())
 {
@@ -252,9 +242,9 @@ senf::ppi::module::detail::MultiConnectorMixinAccess::newConnector(
         5 ))
 #include BOOST_PP_ITERATE()
 
-////////////////////////////////////////////////////////////////////////
-#elif BOOST_PP_ITERATION_FLAGS()==5 // ////////////////////////////////////
-// ////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
+#elif BOOST_PP_ITERATION_FLAGS()==5 //-////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
 // Implementation 1..MAX_ARGS x 1..MAX_ARGS
 
 template <class Source, class Target mpp_TplParamsKomma() mpp_TplParamsKomma2()>
@@ -273,9 +263,9 @@ senf::ppi::connect(Source & source mpp_FnParamsKomma(), Target & target mpp_FnPa
     return boost::tie(s,t);
 }
 
-// ////////////////////////////////////////////////////////////////////////
-#endif // /////////////////////////////////////////////////////////////////
-// ////////////////////////////////////////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
+#endif //-/////////////////////////////////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
 // Undefine local Macros
 
 #undef mpp_CallParamsKomma2
@@ -290,15 +280,15 @@ senf::ppi::connect(Source & source mpp_FnParamsKomma(), Target & target mpp_FnPa
 #undef mpp_TplParamsKomma
 #undef mpp_TplParams_
 #undef mpp_TplParams
-            
-// ////////////////////////////////////////////////////////////////////////
+
+//-////////////////////////////////////////////////////////////////////////
 /*
  (save-excursion (re-search-backward "^// Undefine local Macros")
  (forward-line 1) (delete-region (point) (progn (search-forward
- "// ////") (forward-line -1) (point))) (insert "\n") (let ((b (point))
- (e (progn (insert (save-excursion (re-search-backward 
+ "//-////") (forward-line -1) (point))) (insert "\n") (let ((b (point))
+ (e (progn (insert (save-excursion (re-search-backward
  "^// Local Macros") (search-forward "#define") (beginning-of-line)
- (buffer-substring (point) (progn (search-forward "// ////")
+ (buffer-substring (point) (progn (search-forward "//-////")
  (search-backward "#define") (forward-line 1) (point))))) (point))))
  (reverse-region b e) (shell-command-on-region b e "grep -F '#define'" nil
  t) (goto-char b) (while (looking-at "#define") (delete-char 7) (insert
@@ -306,9 +296,9 @@ senf::ppi::connect(Source & source mpp_FnParamsKomma(), Target & target mpp_FnPa
  (delete-region (1- (point)) (progn (end-of-line) (point))) (forward-line
  1))))
 */
-// ////////////////////////////////////////////////////////////////////////
-#endif // /////////////////////////////////////////////////////////////////
-// ///////////////////////////mpp.e////////////////////////////////////////
+//-////////////////////////////////////////////////////////////////////////
+#endif //-/////////////////////////////////////////////////////////////////
+//-///////////////////////////mpp.e////////////////////////////////////////
 
 \f
 // Local Variables: