From 58aaa3d7ba3ea36e77aea008c3d72be02aea2c05 Mon Sep 17 00:00:00 2001 From: g0dil <g0dil@wiback.org> Date: Thu, 23 Apr 2009 15:12:16 +0000 Subject: [PATCH] Utils/Logger: Add missing FileTarget::filname() member PPI: Documentation --- PPI/Connectors.hh | 36 ++++++++++++++++++++++++++++++++++++ PPI/Jack.hh | 26 ++++++++++++++++++++++---- Utils/Logger/FileTarget.cc | 6 ++++++ senf.dict | 1 + 4 files changed, 65 insertions(+), 4 deletions(-) diff --git a/PPI/Connectors.hh b/PPI/Connectors.hh index 4f18a785d..78b7023f1 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<senf::EthernetPacket> input; + senf::ppi::connector::ActiveOutputJack<senf::EthernetPacket> 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 diff --git a/PPI/Jack.hh b/PPI/Jack.hh index 83657ba7a..03c32782c 100644 --- a/PPI/Jack.hh +++ b/PPI/Jack.hh @@ -38,58 +38,70 @@ namespace senf { namespace ppi { namespace connector { + /** \brief Connector Jack base class + \see \ref ppi_jacks */ class Jack : private boost::noncopyable {}; + /** \brief Jack referencing an ActiveInput + \see \ref ppi_jacks */ class GenericActiveInputJack : public Jack { public: explicit GenericActiveInputJack(GenericActiveInput & input); - GenericActiveInput & connector(); + GenericActiveInput & connector(); ///< Get referenced connector private: GenericActiveInput & input_; }; + /** \brief Jack referencing an ActiveOutput + \see \ref ppi_jacks */ class GenericActiveOutputJack : public Jack { public: explicit GenericActiveOutputJack(GenericActiveOutput & output); - GenericActiveOutput & connector(); + GenericActiveOutput & connector(); ///< Get referenced connector private: GenericActiveOutput & output_; }; + /** \brief Jack referencing a PassiveInput + \see \ref ppi_jacks */ class GenericPassiveInputJack : public Jack { public: explicit GenericPassiveInputJack(GenericPassiveInput & input); - GenericPassiveInput & connector(); + GenericPassiveInput & connector(); ///< Get referenced connector private: GenericPassiveInput & input_; }; + /** \brief Jack referencing a PassiveOutput + \see \ref ppi_jacks */ class GenericPassiveOutputJack : public Jack { public: explicit GenericPassiveOutputJack(GenericPassiveOutput & output); - GenericPassiveOutput & connector(); + GenericPassiveOutput & connector(); ///< Get referenced connector private: GenericPassiveOutput & output_; }; + /** \brief Jack with packet type referencing an ActiveInput + \see \ref ppi_jacks */ template <class PacketType=Packet> class ActiveInputJack : public GenericActiveInputJack @@ -115,6 +127,8 @@ namespace connector { #endif + /** \brief Jack with packet type referencing an ActiveOutput + \see \ref ppi_jacks */ template <class PacketType=Packet> class ActiveOutputJack : public GenericActiveOutputJack @@ -140,6 +154,8 @@ namespace connector { #endif + /** \brief Jack with packet type referencing a PassiveInput + \see \ref ppi_jacks */ template <class PacketType=Packet> class PassiveInputJack : public GenericPassiveInputJack @@ -165,6 +181,8 @@ namespace connector { #endif + /** \brief Jack with packet type referencing a PassiveOutput + \see \ref ppi_jacks */ template <class PacketType=Packet> class PassiveOutputJack : public GenericPassiveOutputJack diff --git a/Utils/Logger/FileTarget.cc b/Utils/Logger/FileTarget.cc index 4cc69ad4f..c5aaa0343 100644 --- a/Utils/Logger/FileTarget.cc +++ b/Utils/Logger/FileTarget.cc @@ -83,6 +83,12 @@ prefix_ void senf::log::FileTarget::reopen(std::string const & file) parent->add(file, consoleDir().node().unlink()); } +prefix_ std::string const & senf::log::FileTarget::filename() + const +{ + return file_; +} + prefix_ senf::log::FileTarget::RegisterConsole::RegisterConsole() { namespace kw = senf::console::kw; diff --git a/senf.dict b/senf.dict index 1a0c98937..dfac3bf0f 100644 --- a/senf.dict +++ b/senf.dict @@ -646,6 +646,7 @@ TunTapSocketHandle txpower TypeA TypeB +TypedInterfaceDecorator typeField UDLR udp -- GitLab