// $Id$
//
-// Copyright (C) 2006
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
-// Stefan Bund <stefan.bund@fokus.fraunhofer.de>
+// Copyright (C) 2006
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
+// Stefan Bund <g0dil@berlios.de>
//
// 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
// Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// Definition of inline non-template functions
+/** \file
+ \brief Scheduler inline non-template implementation
+ */
//#include "Scheduler.ih"
// Custom includes
+#include <boost/format.hpp>
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
-prefix_ void satcom::lib::Scheduler::terminate()
+// public members
+
+prefix_ senf::ClockService::clock_type senf::scheduler::eventTime()
+{
+ return scheduler::detail::FdManager::instance().eventTime();
+}
+
+prefix_ void senf::scheduler::watchdogTimeout(unsigned ms)
+{
+ scheduler::detail::FIFORunner::instance().taskTimeout(ms);
+}
+
+prefix_ unsigned senf::scheduler::watchdogTimeout()
+{
+ return scheduler::detail::FIFORunner::instance().taskTimeout();
+}
+
+prefix_ unsigned senf::scheduler::watchdogEvents()
+{
+ return scheduler::detail::FIFORunner::instance().hangCount();
+}
+
+prefix_ void senf::scheduler::watchdogAbort(bool flag)
+{
+ scheduler::detail::FIFORunner::instance().abortOnTimeout(flag);
+}
+
+prefix_ bool senf::scheduler::watchdogAbort()
+{
+ return scheduler::detail::FIFORunner::instance().abortOnTimeout();
+}
+
+prefix_ void senf::scheduler::loresTimers()
+{
+ detail::TimerDispatcher::instance().timerSource(
+ std::auto_ptr<detail::TimerSource>(new detail::PollTimerSource()));
+}
+
+prefix_ bool senf::scheduler::haveScalableHiresTimers()
+{
+#ifndef HAVE_TIMERFD
+ return false;
+#else
+ return detail::TimerFDTimerSource::haveTimerFD();
+#endif
+}
+
+prefix_ bool senf::scheduler::usingHiresTimers()
+{
+ return dynamic_cast<detail::PollTimerSource*>(
+ detail::TimerDispatcher::instance().timerSource()) == 0;
+}
+
+///////////////////////////////////////////////////////////////////////////
+// senf::scheduler::BlockSignals
+
+prefix_ senf::scheduler::BlockSignals::~BlockSignals()
+{
+ unblock();
+}
+
+prefix_ bool senf::scheduler::BlockSignals::blocked()
+ const
{
- terminate_ = true;
+ return blocked_;
}
///////////////////////////////cci.e///////////////////////////////////////
\f
// Local Variables:
// mode: c++
-// c-file-style: "satcom"
+// fill-column: 100
+// c-file-style: "senf"
+// indent-tabs-mode: nil
+// ispell-local-dictionary: "american"
+// compile-command: "scons -u test"
+// comment-column: 40
// End: