X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPPI%2FMultiConnectorMixin.hh;h=22d3a13c38e95e7837091603cd7acc48fc6a69fe;hb=93d9568d448749dc187e7622b733a4a3caa319df;hp=e9b42b0a39a330588c308409b7d5f4660549deee;hpb=45b346fa3a120720280b67b0f405b1954c0885d4;p=senf.git diff --git a/senf/PPI/MultiConnectorMixin.hh b/senf/PPI/MultiConnectorMixin.hh index e9b42b0..22d3a13 100644 --- a/senf/PPI/MultiConnectorMixin.hh +++ b/senf/PPI/MultiConnectorMixin.hh @@ -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 @@ -31,8 +31,6 @@ #include #include #include -#include "Connectors.hh" -#include "Setup.hh" #ifndef SENF_MULTI_CONNECTOR_MAX_ARGS #define SENF_MULTI_CONNECTOR_MAX_ARGS 3 @@ -40,11 +38,11 @@ #include "MultiConnectorMixin.mpp" #include "MultiConnectorMixin.ih" -///////////////////////////////hh.p//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// namespace senf { namespace ppi { - + #ifdef DOXYGEN // For exposition only. @@ -62,7 +60,7 @@ namespace ppi { template MultiConnectorSource::ConnectorType & connect( MultiConnectorSource & source, A1 const & a1, Target & target); - + /** \brief Connect arbitrary source to MultiConnector target Additional implementations with 0..SENF_MULTI_CONNECTOR_MAX_ARGS arguments. @@ -94,13 +92,13 @@ namespace module { namespace detail { class MultiConnectorMixinAccess; } - /** \brief Multi connector management + /** \brief Multi-Connector management This mixin provides a module with support for a runtime configurable number of input or output connectors. \code - class MyModule - : public senf::ppi::module::Modulem, + class MyModule + : public senf::ppi::module::Module, public senf::ppi::module::MultiConnectorMixin< MyModule, senf::ppi::connector::ActiveInput<> > { @@ -116,7 +114,7 @@ namespace module { route(input, output); input.onThrottle(&MyModule::doThrottle); } - + // Optional void connectorDestroy(senf::ppi::connector::ActiveInput const & input) { @@ -124,12 +122,12 @@ namespace module { } void doThrottle() - { + { // ... } friend class senf::ppi::module::MultiConnectorMixin< - MyModule, senf::ppi::connector::ActiveInput<> > + MyModule, senf::ppi::connector::ActiveInput<> >; } \endcode @@ -180,7 +178,7 @@ namespace module { allocate a new connector \code MyModule muModule; - + senf::ppi::connect(someModule, myModule); \endcode Some modules will expect additional arguments to be passed (see below) @@ -202,7 +200,7 @@ namespace module { \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 non-const reference and wrap the real argument using \c boost::ref() (The reason for - this is known as 'The forwarding problem' + this is known as 'The forwarding problem'). \section senf_ppi_multiconnector_advanced Advanced usage: Managing your own container @@ -214,7 +212,7 @@ namespace module { Implementing \c connectorDestroy now is \e mandatory. The signature is changed to take a pointer as argument \code - class MyModule + class MyModule : public senf::ppi::module::Module, public senf::ppi::module::MultiConnectorMixin< MyModule, senf::ppi::connector::ActiveInput<>, void, void > @@ -249,12 +247,12 @@ namespace module { successfully, otherwise your code will break. */ - template ::type> - class MultiConnectorMixin + class MultiConnectorMixin : private detail::MultiConnectorSelectBase::type { public: @@ -286,7 +284,7 @@ namespace module { friend class detail::MultiConnectorMixinAccess; friend class detail::MultiConnectorWrapper; - + ContainerType_ connectors_; }; @@ -300,7 +298,7 @@ namespace module { { public: typedef ConnectorType_ ConnectorType; - + protected: typedef ContainerType_ ContainerType; @@ -320,14 +318,14 @@ namespace module { # include BOOST_PP_ITERATE() void disconnected(ConnectorType_ const & c); - + friend class detail::MultiConnectorMixinAccess; friend class detail::MultiConnectorWrapper; ContainerType_ connectors_; }; - template class MultiConnectorMixin : private detail::MultiConnectorSelectBase::type @@ -352,10 +350,10 @@ namespace module { }; #endif - + }}} -///////////////////////////////hh.e//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// //#include "MultiConnectorMixin.cci" #include "MultiConnectorMixin.ct" #include "MultiConnectorMixin.cti"