#include <boost/call_traits.hpp>
#include <boost/integer.hpp>
#include "ClockService.hh"
+#include "../Utils/Logger/Target.hh"
//#include "scheduler.mpp"
///////////////////////////////hh.p////////////////////////////////////////
///< Add timeout event
/**< \param[in] timeout timeout in nanoseconds
\param[in] cb callback to call after \a timeout
- milliseconds
- \todo Return some kind of handle/pointer and add
- support to update or revoke a timeout */
+ milliseconds */
void cancelTimeout(unsigned id);
private:
typedef boost::function<void (EventId)> SimpleCallback;
- static unsigned const MinTimeout = 1000;
-
Scheduler();
void do_add(int fd, SimpleCallback const & cb, int eventMask = EV_ALL);
};
typedef std::map<int,EventSpec> FdTable;
- typedef std::map<unsigned,TimerSpec> TimerMap;
+ typedef std::map<unsigned,TimerSpec> TimerMap; // sorted by id
struct TimerSpecCompare
{
};
typedef std::priority_queue<TimerMap::iterator, std::vector<TimerMap::iterator>,
- TimerSpecCompare> TimerQueue;
+ TimerSpecCompare> TimerQueue; // sorted by time
FdTable fdTable_;
unsigned timerIdCounter_;
*/
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
+ Utils/Logger framework. This time source will use Scheduler::eventTime() to provide timing
+ information.
+ */
+ struct SchedulerLogTimeSource : public senf::log::TimeSource
+ {
+ boost::posix_time::ptime operator()() const;
+ };
+
}
///////////////////////////////hh.e////////////////////////////////////////