mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-08 03:02:30 +00:00
ef3a8fcd83
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@308 e378c898-3ddf-0310-93e7-cc216c733640
38 lines
658 B
C++
38 lines
658 B
C++
#ifndef RTORRENT_UTILS_TASK_SCHEDULE_H
|
|
#define RTORRENT_UTILS_TASK_SCHEDULE_H
|
|
|
|
#include <list>
|
|
|
|
#include "timer.h"
|
|
|
|
namespace utils {
|
|
|
|
class Task;
|
|
|
|
class TaskSchedule {
|
|
public:
|
|
friend class Task;
|
|
|
|
typedef std::list<Task*> Container;
|
|
typedef Container::iterator iterator;
|
|
|
|
static void perform(Timer t);
|
|
|
|
static Timer get_timeout();
|
|
|
|
protected:
|
|
static iterator end() { return m_container.end(); }
|
|
|
|
static iterator insert(Task* t);
|
|
static void erase(iterator itr) { m_container.erase(itr); }
|
|
|
|
private:
|
|
static inline void execute_task(Task* t);
|
|
|
|
static Container m_container;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|