Skip to content
Snippets Groups Projects
Commit 69956a6a authored by g0dil's avatar g0dil
Browse files

PPI: MultiConnectorMixin documentation fixes

parent 78027db7
No related branches found
No related tags found
No related merge requests found
...@@ -37,6 +37,15 @@ senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerTy ...@@ -37,6 +37,15 @@ senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerTy
return connectors_; return connectors_;
} }
template <class Self_, class ConnectorType_, class KeyType_, class ContainerType_>
prefix_ ContainerType_ const &
senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,KeyType_,ContainerType_>::
connectors()
const
{
return connectors_;
}
template <class Self_, class ConnectorType_, class ContainerType_> template <class Self_, class ConnectorType_, class ContainerType_>
prefix_ ContainerType_ & prefix_ ContainerType_ &
senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>::connectors() senf::ppi::module::MultiConnectorMixin<Self_,ConnectorType_,void,ContainerType_>::connectors()
...@@ -91,7 +100,7 @@ senf::ppi::connect(Source & source, Target & target , A1 const & a1) ...@@ -91,7 +100,7 @@ senf::ppi::connect(Source & source, Target & target , A1 const & a1)
connect(source, target.newConnector(a1)); connect(source, target.newConnector(a1));
} }
#endif #else
// Include 'Implementation' from MultiConnectorMixin.mpp // Include 'Implementation' from MultiConnectorMixin.mpp
#define BOOST_PP_ITERATION_PARAMS_1 (4, ( \ #define BOOST_PP_ITERATION_PARAMS_1 (4, ( \
...@@ -101,6 +110,8 @@ senf::ppi::connect(Source & source, Target & target , A1 const & a1) ...@@ -101,6 +110,8 @@ senf::ppi::connect(Source & source, Target & target , A1 const & a1)
3 )) 3 ))
#include BOOST_PP_ITERATE() #include BOOST_PP_ITERATE()
#endif
///////////////////////////////cti.e/////////////////////////////////////// ///////////////////////////////cti.e///////////////////////////////////////
#undef prefix_ #undef prefix_
......
...@@ -54,20 +54,26 @@ namespace ppi { ...@@ -54,20 +54,26 @@ namespace ppi {
// output, otherwise the second overload. // output, otherwise the second overload.
/** \brief Connect MultiConnector source to arbitrary target /** \brief Connect MultiConnector source to arbitrary target
Additional implementations with 0..SENF_MULTI_CONNECTOR_MAX_ARGS arguments. Additional implementations with 0..SENF_MULTI_CONNECTOR_MAX_ARGS arguments.
\related module::MultiConnectorMixin \related module::MultiConnectorMixin
*/ */
template <class Source, class Target, class A1> template <class MultiConnectorSource, class Target, class A1>
Source::ConnectorType & connect(Source & source, Target & target, A1 const & a1); MultiConnectorSource::ConnectorType & connect(
MultiConnectorSource & source, Target & target, A1 const & a1);
/** \brief Connect arbitrary source to MultiConnector target /** \brief Connect arbitrary source to MultiConnector target
Additional implementations with 0..SENF_MULTI_CONNECTOR_MAX_ARGS arguments. Additional implementations with 0..SENF_MULTI_CONNECTOR_MAX_ARGS arguments.
\related module::MultiConnectorMixin \related module::MultiConnectorMixin
*/ */
template <class Source, class Target> template <class Source, class MultiConnectorTarget, class A1>
Target::ConnectorType & connect(Source & source, Target & target, A1 const & a1); MultiConnectorTarget::ConnectorType & connect(
Source & source, MultiConnectorTarget & target, A1 const & a1);
#endif #else
// Include 'senf::ppi::namespace member declarations' from MultiConnectorMixin.mpp // Include 'senf::ppi::namespace member declarations' from MultiConnectorMixin.mpp
# define BOOST_PP_ITERATION_PARAMS_1 (4, ( \ # define BOOST_PP_ITERATION_PARAMS_1 (4, ( \
...@@ -77,6 +83,8 @@ namespace ppi { ...@@ -77,6 +83,8 @@ namespace ppi {
2 )) 2 ))
# include BOOST_PP_ITERATE() # include BOOST_PP_ITERATE()
#endif
namespace module { namespace module {
/** \brief Multi connector management /** \brief Multi connector management
...@@ -153,12 +161,12 @@ namespace module { ...@@ -153,12 +161,12 @@ namespace module {
\par "Example:" senf::ppi::module::AnnotationRouter \par "Example:" senf::ppi::module::AnnotationRouter
\section senf_ppi_multiconnector_connect Connect and additional \c connectorSetup() arguments \section senf_ppi_multiconnector_connect Connect and additional connectorSetup() arguments
When connecting to a module using the MultiConnectorMixin, every new connect call will When connecting to a module using the MultiConnectorMixin, every new connect call will
allocate a new connector allocate a new connector
\code \code
MuModule muModule; MyModule muModule;
senf::ppi::connect(someModule, myModule); senf::ppi::connect(someModule, myModule);
\endcode \endcode
...@@ -176,6 +184,7 @@ namespace module { ...@@ -176,6 +184,7 @@ namespace module {
{ {
container().insert(container().begin()+index, container().pop_back().release()); container().insert(container().begin()+index, container().pop_back().release());
} }
\endcode
\par "Advanced note:" These additional arguments are always passed by const-reference. If \par "Advanced note:" These additional arguments are always passed by const-reference. If
you need to pass a non-const reference, declare the \c connectorSetup() argument as you need to pass a non-const reference, declare the \c connectorSetup() argument as
...@@ -191,14 +200,15 @@ namespace module { ...@@ -191,14 +200,15 @@ namespace module {
: private detail::MultiConnectorSelectBase<ConnectorType_>::type : private detail::MultiConnectorSelectBase<ConnectorType_>::type
{ {
public: public:
typedef ConnectorType_ ConnectorType; typedef ConnectorType_ ConnectorType; ///< Type of MultiConnector connector
protected: protected:
typedef ContainerType_ ContainerType; typedef ContainerType_ ContainerType; ///< Type of connector container
ContainerType_ & connectors(); ContainerType_ & connectors(); ///< Get connector container
ContainerType_ const & connectors() const; ///< Get connectors container (const)
private: private:
#ifdef DOXYGEN #ifdef 0
// For exposition only // For exposition only
// Other implementations with 0..SENF_MULTI_CONNECTOR_MAX_ARGS arguments accordingly // Other implementations with 0..SENF_MULTI_CONNECTOR_MAX_ARGS arguments accordingly
...@@ -218,6 +228,7 @@ namespace module { ...@@ -218,6 +228,7 @@ namespace module {
Target & target, Target & target,
A1 const & a1); A1 const & a1);
#endif #endif
#ifndef DOXYGEN
// Include 'MultiConnectorMixin member declaration' from MultiConnectorMixin.mpp // Include 'MultiConnectorMixin member declaration' from MultiConnectorMixin.mpp
# define BOOST_PP_ITERATION_PARAMS_1 (4, ( \ # define BOOST_PP_ITERATION_PARAMS_1 (4, ( \
...@@ -226,10 +237,14 @@ namespace module { ...@@ -226,10 +237,14 @@ namespace module {
SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \ SENF_ABSOLUTE_INCLUDE_PATH(PPI/MultiConnectorMixin.mpp), \
1 )) 1 ))
# include BOOST_PP_ITERATE() # include BOOST_PP_ITERATE()
#endif
ContainerType_ connectors_; ContainerType_ connectors_;
}; };
#ifndef DOXYGEN
template <class Self_, template <class Self_,
class ConnectorType_, class ConnectorType_,
class ContainerType_> class ContainerType_>
...@@ -245,7 +260,7 @@ namespace module { ...@@ -245,7 +260,7 @@ namespace module {
private: private:
#ifdef DOXYGEN #if 0
// For exposition only // For exposition only
// Other implementations with 0..SENF_MULTI_CONNECTOR_MAX_ARGS arguments accordingly // Other implementations with 0..SENF_MULTI_CONNECTOR_MAX_ARGS arguments accordingly
...@@ -276,6 +291,8 @@ namespace module { ...@@ -276,6 +291,8 @@ namespace module {
ContainerType_ connectors_; ContainerType_ connectors_;
}; };
#endif
}}} }}}
......
...@@ -41,12 +41,16 @@ namespace detail { ...@@ -41,12 +41,16 @@ namespace detail {
typedef boost::ptr_map<KeyType, ConnectorType> type; typedef boost::ptr_map<KeyType, ConnectorType> type;
}; };
#ifndef DOXYGEN
template <class ConnectorType> template <class ConnectorType>
struct MultiConnectorDefaultContainer<void,ConnectorType> struct MultiConnectorDefaultContainer<void,ConnectorType>
{ {
typedef boost::ptr_vector<ConnectorType> type; typedef boost::ptr_vector<ConnectorType> type;
}; };
#endif
template <class ConnectorType> template <class ConnectorType>
struct MultiConnectorSelectBase struct MultiConnectorSelectBase
: public boost::mpl::if_< : public boost::mpl::if_<
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment