X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FDebugModules.hh;h=60ac7e5447869a0f64ef45563cbb541c15784341;hb=51044eb18f034c1a059ffe2fb109a422c1cbe251;hp=296dfc5dcc643182aa9a3bb43a0bbd55708f3b18;hpb=7231c220a7332754de3d16e4e8aacd5dbd31c501;p=senf.git diff --git a/PPI/DebugModules.hh b/PPI/DebugModules.hh index 296dfc5..60ac7e5 100644 --- a/PPI/DebugModules.hh +++ b/PPI/DebugModules.hh @@ -1,8 +1,8 @@ // $Id$ // // Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// 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 @@ -28,11 +28,11 @@ // Custom includes #include -#include "Utils/SafeBool.hh" -#include "Packets/Packets.hh" +#include "../Utils/safe_bool.hh" +#include "../Packets/Packets.hh" #include "Module.hh" #include "ActiveFeeder.hh" -#include "Utils/Logger.hh" +#include "../Utils/Logger/SenfLog.hh" //#include "DebugModules.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -75,12 +75,12 @@ namespace debug { */ class ActiveSource : public Module, - public SafeBool + public safe_bool { SENF_PPI_MODULE(ActiveSource); public: - connector::ActiveOutput output; + connector::ActiveOutput<> output; ActiveSource(); @@ -106,9 +106,12 @@ namespace debug { public: typedef Queue::size_type size_type; - connector::PassiveOutput output; + connector::PassiveOutput<> output; PassiveSource(); + + void throttle(); ///< Throttle output connector + void unthrottle(); ///< Unthrottle output connector void submit(Packet packet); ///< Enqueue packet @@ -133,12 +136,12 @@ namespace debug { */ class ActiveSink : public Module, - public SafeBool + public safe_bool { SENF_PPI_MODULE(ActiveSink); public: - connector::ActiveInput input; + connector::ActiveInput<> input; ActiveSink(); @@ -164,10 +167,13 @@ namespace debug { typedef Queue::size_type size_type; typedef Queue::const_iterator iterator; - connector::PassiveInput input; - + connector::PassiveInput<> input; + PassiveSink(); + void throttle(); ///< Throttle input connection + void unthrottle(); ///< Unthrottle input connection + bool empty(); ///< \c true, if queue is empty size_type size(); ///< number of packets in the queue iterator begin(); ///< begin iterator of packets in the queue @@ -207,7 +213,7 @@ namespace debug { public: typedef PassiveSource::size_type size_type; - connector::ActiveOutput & output; + connector::ActiveOutput<> & output; ActiveFeederSource(); @@ -240,7 +246,7 @@ namespace debug { typedef PassiveSink::size_type size_type; typedef PassiveSink::iterator iterator; - connector::ActiveInput & input; + connector::ActiveInput<> & input; ActiveFeederSink(); @@ -258,20 +264,20 @@ namespace debug { /** \brief Log received packets This module will log all packets sent to it's input using SENF_LOG to the given log - \a Stream, \a Area and \a level. + \a Stream, \a Area and \a Level. */ - template < class Stream = log::Debug, - class Area = log::DefaultArea, - senf::log::Level level = log::VERBOSE > - class LogWriter + template < class Stream = log::Debug, + class Area = log::DefaultArea, + class Level = log::VERBOSE > + class LogSink : public module::Module { - SENF_PPI_MODULE(LogWriter); + SENF_PPI_MODULE(LogSink); public: - connector::PassiveInput input; + connector::PassiveInput<> input; - LogWriter(); + LogSink(); private: void request();