From: g0dil Date: Wed, 22 Aug 2007 09:13:50 +0000 (+0000) Subject: PPI: Remove specializations from documentation X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=0327b3f303ea2a61d44a30bfaac022874dcf2a0d;p=senf.git PPI: Remove specializations from documentation PPI: More documentation PPI: Implement IdleEvent and ActiveFeeder PPI: add Module::running() member Scheduler: Remove MinTimeout (not needed with ClockService working) git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@405 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/PPI/ActiveFeeder.cc b/PPI/ActiveFeeder.cc new file mode 100644 index 0000000..c7029c2 --- /dev/null +++ b/PPI/ActiveFeeder.cc @@ -0,0 +1,59 @@ +// $Id$ +// +// Copyright (C) 2007 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ActiveFeeder non-inline non-template implementation */ + +#include "ActiveFeeder.hh" +//#include "ActiveFeeder.ih" + +// Custom includes + +//#include "ActiveFeeder.mpp" +#define prefix_ +///////////////////////////////cc.p//////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////// +// senf::ppi::module::ActiveFeeder + +//////////////////////////////////////// +// private members + +prefix_ void senf::ppi::module::ActiveFeeder::request() +{ + output(input()); +} + +///////////////////////////////cc.e//////////////////////////////////////// +#undef prefix_ +//#include "ActiveFeeder.mpp" + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/PPI/ActiveFeeder.cci b/PPI/ActiveFeeder.cci new file mode 100644 index 0000000..2125db5 --- /dev/null +++ b/PPI/ActiveFeeder.cci @@ -0,0 +1,53 @@ +// $Id$ +// +// Copyright (C) 2007 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ActiveFeeder inline non-template implementation */ + +// Custom includes + +#define prefix_ inline +///////////////////////////////cci.p/////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////// +// senf::ppi::module::ActiveFeeder + +prefix_ senf::ppi::module::ActiveFeeder::ActiveFeeder() +{ + route(input,idle_); + route(idle_,output); + registerEvent(& ActiveFeeder::request, idle_); +} + +///////////////////////////////cci.e/////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/PPI/ActiveFeeder.hh b/PPI/ActiveFeeder.hh new file mode 100644 index 0000000..a545050 --- /dev/null +++ b/PPI/ActiveFeeder.hh @@ -0,0 +1,74 @@ +// $Id$ +// +// Copyright (C) 2007 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ActiveFeeder public header */ + +#ifndef HH_ActiveFeeder_ +#define HH_ActiveFeeder_ 1 + +// Custom includes +#include "Module.hh" +#include "Connectors.hh" +#include "IdleEvent.hh" + +//#include "ActiveFeeder.mpp" +///////////////////////////////hh.p//////////////////////////////////////// + +namespace senf { +namespace ppi { +namespace module { + + class ActiveFeeder + : public Module + { + SENF_PPI_MODULE(ActiveFeeder); + public: + connector::ActiveInput input; + connector::ActiveOutput output; + + ActiveFeeder(); + + private: + void request(); + + IdleEvent idle_; + }; + +}}} + +///////////////////////////////hh.e//////////////////////////////////////// +#include "ActiveFeeder.cci" +//#include "ActiveFeeder.ct" +//#include "ActiveFeeder.cti" +#endif + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/PPI/ActiveFeeder.test.cc b/PPI/ActiveFeeder.test.cc new file mode 100644 index 0000000..e5c66d2 --- /dev/null +++ b/PPI/ActiveFeeder.test.cc @@ -0,0 +1,75 @@ +// $Id$ +// +// Copyright (C) 2007 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief ActiveFeeder.test unit tests */ + +//#include "ActiveFeeder.test.hh" +//#include "ActiveFeeder.test.ih" + +// Custom includes +#include "ActiveFeeder.hh" +#include "DebugModules.hh" +#include "Setup.hh" + +#include +#include + +#define prefix_ +///////////////////////////////cc.p//////////////////////////////////////// + +namespace debug = senf::ppi::module::debug; +namespace ppi = senf::ppi; +namespace module = senf::ppi::module; + +BOOST_AUTO_UNIT_TEST(activeFeeder) +{ + debug::PassivePacketSource source; + debug::PassivePacketSink sink; + module::ActiveFeeder feeder; + + ppi::connect(source,feeder); + ppi::connect(feeder,sink); + + source.submit(senf::DataPacket::create()); + source.submit(senf::DataPacket::create()); + source.submit(senf::DataPacket::create()); + + ppi::run(); + + BOOST_CHECK_EQUAL( source.size(), 0u ); + BOOST_CHECK_EQUAL( sink.size(), 3u ); +} + +///////////////////////////////cc.e//////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/PPI/Connectors.hh b/PPI/Connectors.hh index 6d47b63..3824628 100644 --- a/PPI/Connectors.hh +++ b/PPI/Connectors.hh @@ -185,7 +185,7 @@ namespace connector { \param[in] handler Handler to call on throttle notifications. */ - void onThrottle(); + void onThrottle(); ///< Clear throttle notification handler template void onUnthrottle(Handler handler); ///< Register unthrottle notification handler @@ -198,9 +198,9 @@ namespace connector { \param[in] handle Handler to call on unthrottle notifications. */ - void onUnthrottle(); + void onUnthrottle(); ///< Clear unthrottle notification handler - bool throttled() const; + bool throttled() const; ///< \c true, if peer() is throttled PassiveConnector & peer() const; @@ -326,7 +326,7 @@ namespace connector { ActiveOutput & peer() const; - bool boolean_test() const; + bool boolean_test() const; ///< \c true, if ! empty() template void qdisc(QDisc const & disc); ///< Change the queueing discipline @@ -352,9 +352,9 @@ namespace connector { public: ActiveInput & peer() const; - bool boolean_test() const; + bool boolean_test() const; ///< Always \c true - void connect(ActiveInput & target); + void connect(ActiveInput & target); ///< Internal: Use senf::ppi::connect() instead friend class ActiveInput; }; @@ -368,7 +368,7 @@ namespace connector { public: PassiveOutput & peer() const; - bool boolean_test() const; + bool boolean_test() const; ///< \c true, if ! empty() or ! throttled() void request(); ///< request more packets without dequeuing any packet @@ -385,9 +385,9 @@ namespace connector { public: PassiveInput & peer() const; - bool boolean_test() const; + bool boolean_test() const; ///< \c true if peer() is ! throttled() - void connect(PassiveInput & target); + void connect(PassiveInput & target); ///< Internal: Use senf::ppi::connect() instead }; ///@} diff --git a/PPI/DebugModules.hh b/PPI/DebugModules.hh index 14fbb02..2c70982 100644 --- a/PPI/DebugModules.hh +++ b/PPI/DebugModules.hh @@ -35,11 +35,22 @@ //#include "DebugModules.mpp" ///////////////////////////////hh.p//////////////////////////////////////// +/** \namespace senf::ppi::module::debug + \brief Debug modules + + This namespace collects several modules helpful for PPI debugging. The modules allow to manually + pass packets into a network and read back the output packets. + + + */ + namespace senf { namespace ppi { namespace module { namespace debug { + /** \brief + */ class ActivePacketSource : public Module, public SafeBool diff --git a/PPI/DebugModules.test.cc b/PPI/DebugModules.test.cc index fdde4c0..4df0c2a 100644 --- a/PPI/DebugModules.test.cc +++ b/PPI/DebugModules.test.cc @@ -38,11 +38,11 @@ #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// +namespace debug = senf::ppi::module::debug; +namespace ppi = senf::ppi; + BOOST_AUTO_UNIT_TEST(debugModules) { - namespace debug = senf::ppi::module::debug; - namespace ppi = senf::ppi; - { debug::ActivePacketSource source; debug::PassivePacketSink sink; diff --git a/PPI/Events.hh b/PPI/Events.hh index 9d518ff..1b99c4b 100644 --- a/PPI/Events.hh +++ b/PPI/Events.hh @@ -91,6 +91,8 @@ namespace ppi { detail::EventBinding & binding(); }; +#ifndef DOXYGEN + template class EventImplementationHelper { @@ -102,6 +104,8 @@ namespace ppi { detail::EventBinding & binding(); }; +#endif + template class EventImplementation : public EventDescriptor, diff --git a/PPI/Events.ih b/PPI/Events.ih index 02c0586..1e342a0 100644 --- a/PPI/Events.ih +++ b/PPI/Events.ih @@ -40,12 +40,16 @@ namespace detail { typedef EventType const & type; }; +#ifndef DOXYGEN + template <> struct EventArgType { typedef void type; }; +#endif + }}} ///////////////////////////////ih.e//////////////////////////////////////// diff --git a/PPI/IdleEvent.cc b/PPI/IdleEvent.cc new file mode 100644 index 0000000..fcbe357 --- /dev/null +++ b/PPI/IdleEvent.cc @@ -0,0 +1,73 @@ +// $Id$ +// +// Copyright (C) 2007 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief IdleEvent non-inline non-template implementation */ + +#include "IdleEvent.hh" +//#include "IdleEvent.ih" + +// Custom includes +#include "Scheduler/Scheduler.hh" + +//#include "IdleEvent.mpp" +#define prefix_ +///////////////////////////////cc.p//////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////// +// senf::ppi::IdleEvent + +//////////////////////////////////////// +// private members + +prefix_ void senf::ppi::IdleEvent::v_enable() +{ + id_ = Scheduler::instance().timeout(manager().now(), boost::bind(&IdleEvent::cb,this)); +} + +prefix_ void senf::ppi::IdleEvent::v_disable() +{ + Scheduler::instance().cancelTimeout(id_); + id_ = 0; +} + +prefix_ void senf::ppi::IdleEvent::cb() +{ + callback(); + if (enabled()) + v_enable(); +} + +///////////////////////////////cc.e//////////////////////////////////////// +#undef prefix_ +//#include "IdleEvent.mpp" + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/PPI/IdleEvent.cci b/PPI/IdleEvent.cci new file mode 100644 index 0000000..4d997a8 --- /dev/null +++ b/PPI/IdleEvent.cci @@ -0,0 +1,50 @@ +// $Id$ +// +// Copyright (C) 2007 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief IdleEvent inline non-template implementation */ + +// Custom includes + +#define prefix_ inline +///////////////////////////////cci.p/////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////// +// senf::ppi::IdleEvent + +prefix_ senf::ppi::IdleEvent::IdleEvent() + : id_(0) +{} + +///////////////////////////////cci.e/////////////////////////////////////// +#undef prefix_ + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/PPI/IdleEvent.hh b/PPI/IdleEvent.hh new file mode 100644 index 0000000..3064380 --- /dev/null +++ b/PPI/IdleEvent.hh @@ -0,0 +1,73 @@ +// $Id$ +// +// Copyright (C) 2007 +// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) +// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Stefan Bund +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +/** \file + \brief IdleEvent public header */ + +#ifndef HH_IdleEvent_ +#define HH_IdleEvent_ 1 + +// Custom includes +#include "Events.hh" + +//#include "IdleEvent.mpp" +///////////////////////////////hh.p//////////////////////////////////////// + +namespace senf { +namespace ppi { + + class IdleEvent + : public EventImplementation<> + { + public: + IdleEvent(); + + protected: + + private: + virtual void v_enable(); + virtual void v_disable(); + + void cb(); + + unsigned id_; + }; + +}} + + +///////////////////////////////hh.e//////////////////////////////////////// +#include "IdleEvent.cci" +//#include "IdleEvent.ct" +//#include "IdleEvent.cti" +#endif + + +// Local Variables: +// mode: c++ +// fill-column: 100 +// comment-column: 40 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// End: diff --git a/PPI/IntervalTimer.cc b/PPI/IntervalTimer.cc index 766fc16..287d88a 100644 --- a/PPI/IntervalTimer.cc +++ b/PPI/IntervalTimer.cc @@ -50,6 +50,7 @@ prefix_ void senf::ppi::IntervalTimer::v_enable() prefix_ void senf::ppi::IntervalTimer::v_disable() { Scheduler::instance().cancelTimeout(id_); + id_ = 0; } prefix_ void senf::ppi::IntervalTimer::schedule() @@ -61,6 +62,8 @@ prefix_ void senf::ppi::IntervalTimer::schedule() prefix_ void senf::ppi::IntervalTimer::cb() { callback(info_, info_.expected); + if (! enabled()) + return; ++ info_.number; if (info_.number >= eventsPerInterval_) { info_.number = 0; diff --git a/PPI/IntervalTimer.hh b/PPI/IntervalTimer.hh index f057473..cfb0631 100644 --- a/PPI/IntervalTimer.hh +++ b/PPI/IntervalTimer.hh @@ -50,9 +50,6 @@ namespace ppi { { public: /////////////////////////////////////////////////////////////////////////// - // Types - - /////////////////////////////////////////////////////////////////////////// ///\name Structors and default members ///@{ diff --git a/PPI/Joins.cti b/PPI/Joins.cti index e100b08..f664d70 100644 --- a/PPI/Joins.cti +++ b/PPI/Joins.cti @@ -58,6 +58,8 @@ senf::ppi::module::PriorityJoin::connect(Source & source) /////////////////////////////////////////////////////////////////////////// // namespace members +#ifndef DOXYGEN + template prefix_ senf::ppi::connector::PassiveInput & senf::ppi::connect(Source & source, module::PassiveJoin & target) @@ -72,6 +74,8 @@ prefix_ senf::ppi::connector::ActiveInput & senf::ppi::connect(Source & source, return target.connect(source); } +#endif + ///////////////////////////////cti.e/////////////////////////////////////// #undef prefix_ diff --git a/PPI/Joins.hh b/PPI/Joins.hh index 7276384..88b72d5 100644 --- a/PPI/Joins.hh +++ b/PPI/Joins.hh @@ -38,12 +38,16 @@ namespace senf { namespace ppi { +#ifndef DOXYGEN + template connector::PassiveInput & connect(Source & source, module::PassiveJoin & target); template connector::ActiveInput & connect(Source & source, module::PriorityJoin & target); +#endif + namespace module { class PassiveJoin diff --git a/PPI/Module.hh b/PPI/Module.hh index 24fdf0c..4b4323c 100644 --- a/PPI/Module.hh +++ b/PPI/Module.hh @@ -126,8 +126,6 @@ namespace module { ClockService::clock_type now() const; - void destroy(); - #ifndef DOXYGEN virtual void macro_SENF_PPI_MODULE_missing() = 0; #endif @@ -135,6 +133,12 @@ namespace module { private: virtual void init(); +#ifndef DOXYGEN + public: +#endif + void destroy(); + + private: EventManager & eventManager() const; ModuleManager & moduleManager() const; diff --git a/PPI/ModuleManager.cc b/PPI/ModuleManager.cc index 55c65d2..bda5e66 100644 --- a/PPI/ModuleManager.cc +++ b/PPI/ModuleManager.cc @@ -45,12 +45,27 @@ prefix_ void senf::ppi::ModuleManager::init() (*i)->init(); } +struct senf::ppi::ModuleManager::RunGuard +{ + RunGuard(ModuleManager & m) : manager(m) { manager.running_ = true; } + ~RunGuard() { manager.running_ = false; } + ModuleManager & manager; +}; + prefix_ void senf::ppi::ModuleManager::run() { init(); + RunGuard guard (*this); Scheduler::instance().process(); } +//////////////////////////////////////// +// private members + +prefix_ senf::ppi::ModuleManager::ModuleManager() + : running_(false), terminate_(false) +{} + ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_ //#include "ModuleManager.mpp" diff --git a/PPI/ModuleManager.cci b/PPI/ModuleManager.cci index f8b2a08..56f9a10 100644 --- a/PPI/ModuleManager.cci +++ b/PPI/ModuleManager.cci @@ -50,6 +50,12 @@ prefix_ void senf::ppi::ModuleManager::unregisterModule(module::Module & module) moduleRegistry_.end()); } +prefix_ bool senf::ppi::ModuleManager::running() + const +{ + return running_; +} + ///////////////////////////////cci.e/////////////////////////////////////// #undef prefix_ diff --git a/PPI/ModuleManager.hh b/PPI/ModuleManager.hh index abf7cbc..843562b 100644 --- a/PPI/ModuleManager.hh +++ b/PPI/ModuleManager.hh @@ -63,12 +63,19 @@ namespace ppi { void init(); void run(); - protected: + bool running() const; private: + ModuleManager(); + typedef std::vector ModuleRegistry; + struct RunGuard; + friend class RunGuard; + ModuleRegistry moduleRegistry_; + bool running_; + bool terminate_; }; diff --git a/PPI/Route.ih b/PPI/Route.ih index b99d93d..7637d3e 100644 --- a/PPI/Route.ih +++ b/PPI/Route.ih @@ -59,6 +59,8 @@ namespace detail { typedef Connector type; }; +#ifndef DOXYGEN + // RoutingTraits specialization for Event types. Events may be both dataSource or dataTarget but // cannot be notifySource. template @@ -72,6 +74,8 @@ namespace detail { typedef EventDescriptor type; }; + +#endif // The RoutingTraits give routing related information about the argument type: // - Wether the type is a notifySource or notifyTarget diff --git a/PPI/Setup.cci b/PPI/Setup.cci index f8f556b..bba3381 100644 --- a/PPI/Setup.cci +++ b/PPI/Setup.cci @@ -32,6 +32,8 @@ #define prefix_ inline ///////////////////////////////cci.p/////////////////////////////////////// +#ifndef DOXYGEN + prefix_ void senf::ppi::connect(connector::ActiveOutput & source, connector::PassiveInput & target) { @@ -54,6 +56,8 @@ prefix_ void senf::ppi::init() ModuleManager::instance().init(); } +#endif + ///////////////////////////////cci.e/////////////////////////////////////// #undef prefix_ diff --git a/PPI/Setup.cti b/PPI/Setup.cti index fa119e6..caf151f 100644 --- a/PPI/Setup.cti +++ b/PPI/Setup.cti @@ -30,6 +30,8 @@ #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// +#ifndef DOXYGEN + template prefix_ void senf::ppi::connect(M & source, C & target, @@ -57,6 +59,8 @@ senf::ppi::connect(M1 & source, M2 & target, connect(source.output, target.input); } +#endif + ///////////////////////////////cti.e/////////////////////////////////////// #undef prefix_ diff --git a/PPI/detail/Callback.hh b/PPI/detail/Callback.hh index 768cb98..5d23953 100644 --- a/PPI/detail/Callback.hh +++ b/PPI/detail/Callback.hh @@ -65,6 +65,8 @@ namespace detail { static type make(boost::function callable, Owner &); }; +#ifndef DOXYGEN + template <> struct Callback { @@ -76,6 +78,8 @@ namespace detail { static type make(type callable, Owner &); }; +#endif + }}} ///////////////////////////////hh.e//////////////////////////////////////// diff --git a/PPI/detail/EventBinding.hh b/PPI/detail/EventBinding.hh index 0840b03..e60ab58 100644 --- a/PPI/detail/EventBinding.hh +++ b/PPI/detail/EventBinding.hh @@ -73,6 +73,8 @@ namespace detail { Self & self(); }; +#ifndef DOXYGEN + template class EventBindingHelper { @@ -84,6 +86,8 @@ namespace detail { Self & self(); }; +#endif + template class EventBinding : public EventBindingBase, diff --git a/Scheduler/ClockService.hh b/Scheduler/ClockService.hh index 3d5f40f..0480011 100644 --- a/Scheduler/ClockService.hh +++ b/Scheduler/ClockService.hh @@ -64,14 +64,14 @@ namespace senf { // amount the time has been changed. To do this we need an as accurate as possible approximation // of the expected current time value. We need to differentiate two cases: // - // a) Clock skew detected in within now() + // a) Clock skew detected within now() // - // In this case, we use getitimer() to find the time remaining in the timer. Using this value and - // an the saved gettimeofday() value we can adjust base_ accordingly. + // In this case, we use getitimer() to find the time remaining in the timer. Using this value + // and the saved gettimeofday() value we can adjust base_ accordingly. // // b) Clock skew detected in the signal handler // - // In this case we use the save gettimeofday() value + CheckInterval to adjust base_. + // In this case we use the saved gettimeofday() value + CheckInterval to adjust base_. /** \brief Reliable high precision monotonous clock source @@ -90,7 +90,7 @@ namespace senf { Unsigned integer type representing scheduler time. Scheduler time is measured in nanoseconds relative to some implementation defined reference time. */ - typedef boost::uint_fast64_t clock_type; + typedef boost::int_fast64_t clock_type; /** \brief Absolute time data type diff --git a/Scheduler/Scheduler.cc b/Scheduler/Scheduler.cc index 5285fa7..b6485b1 100644 --- a/Scheduler/Scheduler.cc +++ b/Scheduler/Scheduler.cc @@ -155,7 +155,7 @@ prefix_ void senf::Scheduler::process() { terminate_ = false; eventTime_ = ClockService::now(); - while (! terminate_) { + while (! terminate_ && ( ! timerQueue_.empty() || ! fdTable_.empty())) { while ( ! timerQueue_.empty() && timerQueue_.top()->second.timeout <= eventTime_ ) { TimerMap::iterator i (timerQueue_.top()); if (! i->second.canceled) @@ -167,26 +167,27 @@ prefix_ void senf::Scheduler::process() if (terminate_) return; - int timeout (MinTimeout); + int timeout (-1); if (! timerQueue_.empty()) { ClockService::clock_type delta ( (timerQueue_.top()->second.timeout - eventTime_)/1000000UL); - if (delta SimpleCallback; - static unsigned const MinTimeout = 1000; - Scheduler(); void do_add(int fd, SimpleCallback const & cb, int eventMask = EV_ALL);