X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPPI%2FMultiConnectorMixin.hh;h=135c517cf7088ffb5c8ce3da99386cbd483ac174;hb=HEAD;hp=34a784fb84cb4833b20464b6af926fb1fce2b32c;hpb=57524bfa72e4536b15700a83eae94093ed32106a;p=senf.git diff --git a/senf/PPI/MultiConnectorMixin.hh b/senf/PPI/MultiConnectorMixin.hh index 34a784f..135c517 100644 --- a/senf/PPI/MultiConnectorMixin.hh +++ b/senf/PPI/MultiConnectorMixin.hh @@ -1,24 +1,29 @@ // $Id$ // -// Copyright (C) 2009 +// Copyright (C) 2009 // Fraunhofer Institute for Open Communication Systems (FOKUS) -// Competence Center NETwork research (NET), St. Augustin, GERMANY -// Stefan Bund // -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. +// The contents of this file are subject to the Fraunhofer FOKUS Public License +// Version 1.0 (the "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// http://senf.berlios.de/license.html // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// The Fraunhofer FOKUS Public License Version 1.0 is based on, +// but modifies the Mozilla Public License Version 1.1. +// See the full license text for the amendments. // -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the -// Free Software Foundation, Inc., -// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// Software distributed under the License is distributed on an "AS IS" basis, +// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +// for the specific language governing rights and limitations under the License. +// +// The Original Code is Fraunhofer FOKUS code. +// +// The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V. +// (registered association), Hansastraße 27 c, 80686 Munich, Germany. +// All Rights Reserved. +// +// Contributor(s): +// Stefan Bund /** \file \brief MultiConnectorMixin public header */ @@ -31,8 +36,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 +43,11 @@ #include "MultiConnectorMixin.mpp" #include "MultiConnectorMixin.ih" -///////////////////////////////hh.p//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// namespace senf { namespace ppi { - + #ifdef DOXYGEN // For exposition only. @@ -62,7 +65,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. @@ -92,14 +95,14 @@ namespace ppi { namespace module { - namespace detail { class MultiConnectorMixinAccess; } + namespace detail { struct MultiConnectorMixinAccess; } /** \brief Multi-Connector management This mixin provides a module with support for a runtime configurable number of input or output connectors. \code - class MyModule + class MyModule : public senf::ppi::module::Module, public senf::ppi::module::MultiConnectorMixin< MyModule, senf::ppi::connector::ActiveInput<> > @@ -116,7 +119,7 @@ namespace module { route(input, output); input.onThrottle(&MyModule::doThrottle); } - + // Optional void connectorDestroy(senf::ppi::connector::ActiveInput const & input) { @@ -124,7 +127,7 @@ namespace module { } void doThrottle() - { + { // ... } @@ -180,7 +183,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) @@ -214,7 +217,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 +252,12 @@ namespace module { successfully, otherwise your code will break. */ - template ::type> - class MultiConnectorMixin + class MultiConnectorMixin : private detail::MultiConnectorSelectBase::type { public: @@ -284,9 +287,9 @@ namespace module { void disconnected(ConnectorType_ const & c); - friend class detail::MultiConnectorMixinAccess; + friend struct detail::MultiConnectorMixinAccess; friend class detail::MultiConnectorWrapper; - + ContainerType_ connectors_; }; @@ -300,7 +303,7 @@ namespace module { { public: typedef ConnectorType_ ConnectorType; - + protected: typedef ContainerType_ ContainerType; @@ -320,14 +323,14 @@ namespace module { # include BOOST_PP_ITERATE() void disconnected(ConnectorType_ const & c); - - friend class detail::MultiConnectorMixinAccess; + + friend struct detail::MultiConnectorMixinAccess; friend class detail::MultiConnectorWrapper; ContainerType_ connectors_; }; - template class MultiConnectorMixin : private detail::MultiConnectorSelectBase::type @@ -347,15 +350,15 @@ namespace module { void disconnected(ConnectorType_ const & c); - friend class detail::MultiConnectorMixinAccess; + friend struct detail::MultiConnectorMixinAccess; friend class detail::MultiConnectorWrapper; }; #endif - + }}} -///////////////////////////////hh.e//////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// //#include "MultiConnectorMixin.cci" #include "MultiConnectorMixin.ct" #include "MultiConnectorMixin.cti"