X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Scheduler%2FScheduler.hh;h=5a96154795977e73f92b6b8d2dac1a560a8b28f2;hb=58e527462abb46e321c94fda65f758b67ac3aef2;hp=1ad68963f6af467323abafd70a3aeeb48b73b86f;hpb=17e24d84603667395e9ffa786a9cdbb722bf9c1f;p=senf.git diff --git a/Scheduler/Scheduler.hh b/Scheduler/Scheduler.hh index 1ad6896..5a96154 100644 --- a/Scheduler/Scheduler.hh +++ b/Scheduler/Scheduler.hh @@ -1,9 +1,9 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// 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 // it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ #include #include #include "ClockService.hh" -#include "../Utils/Logger.hh" +#include "../Utils/Logger/SenfLog.hh" //#include "scheduler.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -153,6 +153,9 @@ namespace senf { wait for signals \e only. \todo Fix EventId parameter (probably to int) to allow |-ing without casting ... + + \todo Fix the file support to use threads (?) fork (?) and a pipe so it works reliably even + over e.g. NFS. */ class Scheduler : boost::noncopyable @@ -176,13 +179,14 @@ namespace senf { sole member is a typedef symbol defining the callback type given the handle type. The Callback is any callable object taking a \c Handle and an \c EventId as argument. - template - struct GenericCallback { - typedef boost::function::param_type, - EventId) > Callback; - }; + \code + template + struct GenericCallback { + typedef boost::function::param_type, + EventId) > Callback; + }; + \endcode */ - typedef boost::function FdCallback; /** \brief Callback type for timer events */ @@ -278,6 +282,7 @@ namespace senf { void unregisterSignal(unsigned signal); ///< Remove signal handler for \a signal + /// The signal number passed to registerSignal or unregisterSignal is invalid struct InvalidSignalNumberException : public std::exception { virtual char const * what() const throw() { return "senf::Scheduler::InvalidSignalNumberException"; } }; @@ -320,7 +325,11 @@ namespace senf { FdCallback cb_prio; FdCallback cb_write; + EventSpec() : file(false) {} + int epollMask() const; + + bool file; }; /** \brief Timer event specification @@ -344,6 +353,7 @@ namespace senf { typedef std::map FdTable; typedef std::map TimerMap; // sorted by id + typedef std::vector FdEraseList; # ifndef DOXYGEN @@ -364,6 +374,8 @@ namespace senf { typedef std::vector SigHandlers; FdTable fdTable_; + FdEraseList fdErase_; + unsigned files_; unsigned timerIdCounter_; TimerQueue timerQueue_;