X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FSetup.hh;h=7ca50683275964384c53777cf74712ce8d871e1a;hb=b8ca4a544cce3e6023bb56b712a03d6362f2bb79;hp=ae9c743722ec32f8a5f3907cb1f16b82649c9e6b;hpb=a479735a65e334af538b895f182f8efd36a541c5;p=senf.git diff --git a/PPI/Setup.hh b/PPI/Setup.hh index ae9c743..7ca5068 100644 --- a/PPI/Setup.hh +++ b/PPI/Setup.hh @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Copyright (C) 2007 +// 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 @@ -23,8 +23,8 @@ /** \file \brief Setup public header */ -#ifndef HH_Setup_ -#define HH_Setup_ 1 +#ifndef HH_SENF_PPI_Setup_ +#define HH_SENF_PPI_Setup_ 1 // Custom includes #include @@ -37,27 +37,7 @@ namespace senf { namespace ppi { -#ifndef DOXYGEN - - void connect(connector::ActiveOutput & source, connector::PassiveInput & target); - void connect(connector::PassiveOutput & source, connector::ActiveInput & target); - - template - void connect(T & source, C & target, - typename boost::disable_if< boost::is_base_of >::type * = 0, - typename boost::enable_if< boost::is_base_of >::type * = 0); - - template - void connect(C & source, T & target, - typename boost::enable_if< boost::is_base_of >::type * = 0, - typename boost::disable_if< boost::is_base_of >::type * = 0); - - template - void connect(T1 & source, T2 & target, - typename boost::disable_if< boost::is_base_of >::type * = 0, - typename boost::disable_if< boost::is_base_of >::type * = 0); - -#else +#ifdef DOXYGEN /** \brief Connect modules @@ -69,14 +49,48 @@ namespace ppi { as \a source argument. In the same way, if a module has an input connector called \c input, the module may be given directly as \a target argument. This simplifies the most common case of a module with one input and one output connector. + + The connect call will check at runtime, whether the two connectors are type-compatible: + \li Either or both of the connectors are untyped (they accept/send arbitrary senf::Packet's) + \li Both connectors send/accept the exactly same packet type. + + Depending on the type of input or output, the connect call may require additional + arguments. See the respective module documentation for more information + + \throws connector::IncompatibleConnectorsException if the two connectors are not type + compatible. \see \ref ppi_connections */ - void connect(connector::ActiveInput & source, connector::PassiveOutput & target); + void connect(connector::OutputConnector & source, connector::InputConnector & target, ...); - /** \brief Connect modules - \see connect() */ - void connect(connector::PassiveInput & source, connector::ActiveOutput & target); +#else + + void connect(connector::GenericActiveOutput & source, connector::GenericPassiveInput & target); + void connect(connector::GenericPassiveOutput & source, connector::GenericActiveInput & target); + +#endif + +#ifndef DOXYGEN + + template + void connect(T & source, C & target, + typename boost::disable_if< boost::is_base_of >::type * = 0, + typename boost::enable_if< boost::is_base_of >::type * = 0, + typename boost::disable_if< boost::is_base_of >:: type * = 0); + + template + void connect(C & source, T & target, + typename boost::enable_if< boost::is_base_of >::type * = 0, + typename boost::disable_if< boost::is_base_of >::type * = 0, + typename boost::disable_if< boost::is_base_of >:: type * = 0); + + template + void connect(T1 & source, T2 & target, + typename boost::disable_if< boost::is_base_of >::type * = 0, + typename boost::disable_if< boost::is_base_of >::type * = 0, + typename boost::disable_if< boost::is_base_of >:: type * = 0, + typename boost::disable_if< boost::is_base_of >:: type * = 0); #endif