⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scheduler.h

📁 天之炼狱1服务器端源文件游戏服务端不完整
💻 H
字号:
///////////////////////////////////////////////////////////////////// 胶纳临傅等 累诀阑 困茄 Scheduler 努贰胶.///////////////////////////////////////////////////////////////////#ifndef __SCHEDULER_H__#define __SCHEDULER_H__#include <vector>#include <queue>#include <hash_map>#include "Exception.h"#include "Work.h"#include "Schedule.h"class Latter {public :	bool operator () ( const Schedule* pt1, const Schedule* pt2 ) const	{		return pt1->getScheduledTime() > pt2->getScheduledTime();	}};class RecentSchedules : public priority_queue< Schedule*, vector< Schedule* >, Latter > {public :	typedef container_type::iterator 		iterator;	typedef container_type::const_iterator 	const_iterator;public :	const container_type& 	getSchedules() const	{ return c; }	void					arrange() 				{ make_heap(c.begin(), c.end(), comp); }};class Scheduler {public:	Scheduler() throw();	virtual ~Scheduler() throw();	void			clear() throw(Error);	int 			getSize() const						{ return m_RecentSchedules.size(); }	bool 			isEmpty() const						{ return m_RecentSchedules.empty(); }public:	void 			addSchedule( Schedule* pSchedule ) throw (Error);	virtual Work* 	heartbeat() throw(Error);protected :	Work* 			popRecentWork() throw (Error);protected:	RecentSchedules m_RecentSchedules;};#endif // __SCHEDULER_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -