X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FSetup.hh;h=a4b0b037511f2ff5e7535b28346a69f8d4b88328;hb=81447258e6ecc9b5d9434fa5a7d382684179c7ab;hp=12e7d905fc98c534df3cec4762003e718869067e;hpb=9e64a6d6a4840325f74502ba959ebd56fbb8441c;p=senf.git diff --git a/PPI/Setup.hh b/PPI/Setup.hh index 12e7d90..a4b0b03 100644 --- a/PPI/Setup.hh +++ b/PPI/Setup.hh @@ -27,6 +27,8 @@ #define HH_Setup_ 1 // Custom includes +#include +#include #include "predecl.hh" //#include "Setup.mpp" @@ -34,26 +36,66 @@ 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(M & source, C & target, - typename boost::enable_if< boost::is_base_of >::type * = 0, + 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, M & target, + template + void connect(C & source, T & target, typename boost::enable_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(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 + + /** \brief Connect modules - template - void connect(M1 & source, M2 & target, - typename boost::enable_if< boost::is_base_of >::type * = 0, - typename boost::enable_if< boost::is_base_of >::type * = 0); + senf::ppi::connect() establishes a connection between two modules or, to be more precise, + between two connectors. For enhanced usability, \a source and \a target may be a Connector, + a Module or a collection/subnetwork. Passing a Module or collection/subnetwork as \a source + will originate the connection on the \c output member of that Module or collection while + passing a module or collection/subnetwork as \a target will terminate the connection on that + Module or collections \c input member. For most simple modules, the specification of the + connector is therefore obsolete. + + Furthermore, the connect() call may be extended by special modules (e.g. PassiveJoin which + allows an arbitrary of input connections). + */ + template + void connect(Source & source, Target & target); + +#endif + /** \brief Start the network + + Calling senf::ppi::run() will start processing the network. The main event loop is managed + by the Scheduler. Before starting the Scheduler main loop, all Module init() members are + called. + + senf::ppi::run() will return when no more work is to be done, that is when no events are + enabled (Since the events are enabled and disabled by the throttle notifications which + depend among other things on the packet queues, this is the same as checking for packets in + any queue). It is Ok to call senf::ppi::run() multiple times during the program lifetime. + */ void run(); + + /** \brief Manually initialize the network + + For debugging purposes, it is sometimes simpler to not use senf::ppi::run() but instead + drive the network via explicit calls using the debug modules. However, it is still necessary + to initialize the network. This operation is performed by senf::ppi::init(). + */ void init(); }}