X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Scheduler%2FScheduler.hh;h=7f6682195e698f35a2545f0217d085c59cb579d0;hb=6159637c51fd562b2bf68a026a3946b2c84f4e0d;hp=7c4dbcb5da7d3e5732462d6baf69f4adadc53527;hpb=925317c7f45c32b01ab9292023db3f372b74bf0f;p=senf.git diff --git a/Scheduler/Scheduler.hh b/Scheduler/Scheduler.hh index 7c4dbcb..7f66821 100644 --- a/Scheduler/Scheduler.hh +++ b/Scheduler/Scheduler.hh @@ -29,10 +29,9 @@ // Custom includes #include "../Utils/Logger/SenfLog.hh" -#include "FdDispatcher.hh" -#include "TimerDispatcher.hh" +#include "FdEvent.hh" +#include "TimerEvent.hh" #include "SignalEvent.hh" -#include "FileDispatcher.hh" #include "../Utils/Logger/SenfLog.hh" //#include "scheduler.mpp" @@ -189,9 +188,6 @@ namespace senf { /** \brief Callback type for signal events */ typedef boost::function SignalCallback; - /** \brief Timer id type */ - typedef scheduler::TimerDispatcher::timer_id timer_id; - /////////////////////////////////////////////////////////////////////////// ///\name Structors and default members ///@{ @@ -213,75 +209,6 @@ namespace senf { ///@} /////////////////////////////////////////////////////////////////////////// - ///\name File Descriptors - ///\{ - - template - void add(std::string const & name, Handle const & handle, FdCallback const & cb, - int eventMask = EV_ALL); ///< Add file handle event callback - /**< add() will add a callback to the %scheduler. The - callback will be called for the given type of event on - the given arbitrary file-descriptor or - handle-like object. If there already is a Callback - registered for one of the events requested, the new - handler will replace the old one. - \param[in] name descriptive name to identify the - callback. - \param[in] handle file descriptor or handle providing - the Handle interface defined above. - \param[in] cb callback - \param[in] eventMask arbitrary combination via '|' - operator of \ref senf::Scheduler::EventId "EventId" - designators. */ - - template - void add(Handle const & handle, FdCallback const & cb, - int eventMask = EV_ALL); ///< Add file handle event callback - /**< \see add() */ - - - template - void remove(Handle const & handle, int eventMask = EV_ALL); ///< Remove event callback - /**< remove() will remove any callback registered for any of - the given events on the given file descriptor or handle - like object. - \param[in] handle file descriptor or handle providing - the Handle interface defined above. - \param[in] eventMask arbitrary combination via '|' - operator of \ref senf::Scheduler::EventId "EventId" - designators. */ - - ///\} - - ///\name Timeouts - ///\{ - - timer_id timeout(std::string const & name, ClockService::clock_type timeout, - SimpleCallback const & cb); - ///< Add timeout event - /**< \returns timer id - \param[in] name descriptive name to identify the - callback. - \param[in] timeout timeout in nanoseconds - \param[in] cb callback to call after \a timeout - milliseconds */ - - timer_id timeout(ClockService::clock_type timeout, SimpleCallback const & cb); - ///< Add timeout event - /**< \see timeout() */ - - void cancelTimeout(timer_id id); ///< Cancel timeout \a id - -#ifndef DOXYGEN - ClockService::clock_type timeoutEarly() const; - void timeoutEarly(ClockService::clock_type v); - - ClockService::clock_type timeoutAdjust() const; - void timeoutAdjust(ClockService::clock_type v); -#endif - - ///\} - void process(); ///< Event handler main loop /**< This member must be called at some time to enter the event handler main loop. Only while this function is @@ -311,27 +238,9 @@ namespace senf { private: Scheduler(); - void do_add(int fd, FdCallback const & cb, int eventMask = EV_ALL); - void do_add(std::string const & name, int fd, FdCallback const & cb, - int eventMask = EV_ALL); - void do_remove(int fd, int eventMask); - bool terminate_; - - scheduler::FdDispatcher fdDispatcher_; - scheduler::TimerDispatcher timerDispatcher_; - scheduler::FileDispatcher fileDispatcher_; }; - /** \brief Default file descriptor accessor - - retrieve_filehandle() provides the %scheduler with support for explicit file descriptors as - file handle argument. - - \relates Scheduler - */ - int retrieve_filehandle(int fd); - /** \brief %scheduler specific time source for Utils/Logger framework This time source may be used to provide timing information for log messages within the @@ -348,7 +257,7 @@ namespace senf { ///////////////////////////////hh.e//////////////////////////////////////// #include "Scheduler.cci" //#include "Scheduler.ct" -#include "Scheduler.cti" +//#include "Scheduler.cti" #endif