X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FConnectors.hh;h=78b7023f1d6cacef07bc159c710af7c0de005019;hb=5443435c4c2b6e4386c5334b5b8358273f2bae93;hp=4f18a785d694f65acc6c2db482d956338f8e6dd4;hpb=1ad0e5e4b09729bd009be5ca0ca2ba8c671ce875;p=senf.git diff --git a/PPI/Connectors.hh b/PPI/Connectors.hh index 4f18a78..78b7023 100644 --- a/PPI/Connectors.hh +++ b/PPI/Connectors.hh @@ -97,6 +97,42 @@ namespace connector { }; \endcode + + \section ppi_jacks Jacks + + A Jack is a packet type aware and possibly packet type converting reference to an arbitrary + connector of the same type. Jacks are used in groups to indirectly declare the input's and + output's + + \code + class MyGroup + { + private: + senf::ppi::module::PassiveQueue queue; + senf::ppi::module::RateAnalyzer analyzer; + + public: + senf::ppi::connector::ActiveInputJack input; + senf::ppi::connector::ActiveOutputJack output; + + MyGroup() + : queue (), analyzer (), input (queue.input), output (analyzer.output) + { + senf::ppi::connect(queue, analyzer); + } + }; + \endcode + + The jacks are initialized by passing an arbitrary compatible connector to the jack + constructor. A connector is compatible, if + \li It has the same input/output active/passive specification + \li Either the Jack or the Connector are generic (senf::Packet) or Jack and Connector have + the same packet type + + Jacks can be used wherever connectors may be used. Jacks may be defined anywhere, not only + in modules. It is however important to ensure that the lifetime of the jack does not exceed + the lifetime of the referenced connector. + \see senf::ppi::module::Module \n senf::ppi::connect() \n