updatemanager.h

来自「天之炼狱1服务器端源文件游戏服务端不完整」· C头文件 代码 · 共 102 行

H
102
字号
//--------------------------------------------------------------------------------// // Filename    : UpdateManager.h // Written By  : Reiot// //--------------------------------------------------------------------------------#ifndef __UPDATE_MANAGER_H__#define __UPDATE_MANAGER_H__// include files#include "Update.h"#include "Assert.h"#include <list>#include "Resource.h"#include "ResourceManager.h"//--------------------------------------------------------------------------------// 诀单捞飘 疙飞捞 1024搁 芭狼 磷澜捞寸..//--------------------------------------------------------------------------------const uint maxUpdates = 1024;//--------------------------------------------------------------------------------//// class UpdateManager//// 诀单捞飘 疙飞阑 包府窍绰 概聪历捞促.//// 菩哦俊 embedding 登哥, 颇老矫胶袍俊 save/load 登扁 锭巩俊,//// load/save// read(SocketInputStream&)/write(SocketOutputStream&)// read(Socket*)/write(Socket*)//// 葛滴 备泅窍档废 窍磊.////--------------------------------------------------------------------------------class UpdateManager{public :	// constructor	UpdateManager () throw ();	// destructor	~UpdateManager () throw ();	public :	// load from update file	void load (const string & filename) throw (Error);	// save to update file	void save (const string & filename) const throw (Error);	// read from socket input stream	void read (SocketInputStream & iStream) throw (ProtocolException, Error);	// read from socket	void read (Socket* pSocket) throw (IOException, Error);	// write to socket output stream	void write (SocketOutputStream & oStream) const throw (ProtocolException, Error);	// write to socket	void write (Socket* pSocket) const throw (IOException, Error);	// get size	uint getSize () const throw ();	// get max size	static uint getMaxSize () throw () { return Update::getMaxSize()* maxUpdates; }public :	// list methods	void push_back (Update* pUpdate) throw (Error) { Assert(pUpdate != NULL); m_Updates.push_back(pUpdate); }	void pop_front () throw (Error) { Assert(!m_Updates.empty()); m_Updates.pop_front(); }	Update* front () const throw (Error) { Assert(!m_Updates.empty()); return m_Updates.front(); }	bool empty () const throw () { return m_Updates.empty(); }	// get resource manager	ResourceManager* getResourceManager () throw (Error);	// get debug string	string toString () const throw ();private :	// list of Update	list< Update* > m_Updates;	ResourceManager* m_pResourceManager;};#endif

⌨️ 快捷键说明

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