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

📄 worldguildcommon.h

📁 奇迹世界 部分源代码奇迹世界 部分源代码奇迹世界 部分源代码
💻 H
字号:
#pragma once



//--------------------------------------------------------------------------------
//s GUILDPOOL狼 皋葛府 钱 包访 内靛
//--------------------------------------------------------------------------------
#include <MemoryPoolFactory.h>

template<class _Ct>
class GUILDPOOL
{
public:
	enum { _MAX_ZONE_POOL_SIZE=500, };
	GUILDPOOL(){ m_Pool.Initialize( _MAX_ZONE_POOL_SIZE );	}
	~GUILDPOOL(){ m_Pool.Release();	}
	_Ct * Alloc() { return m_Pool.Alloc(); }
	VOID Free( _Ct * p ) { return m_Pool.Free(p); }
private:
	util::CMemoryPoolFactory<_Ct> m_Pool;
};


#define __DECL_GUILDPOOL(_ClassType)									\
	private:															\
	static GUILDPOOL<_ClassType> s_Pool;								\
	public:																\
	static _ClassType *	ALLOC() { return s_Pool.Alloc(); }				\
	static VOID FREE( _ClassType * pClass ) { s_Pool.Free( pClass ); }

#define __IMPL_GUILDPOOL(_ClassType)									\
	GUILDPOOL<_ClassType> _ClassType::s_Pool;
//--------------------------------------------------------------------------------
//e GUILDPOOL狼 皋葛府 钱 包访 内靛
//--------------------------------------------------------------------------------

⌨️ 快捷键说明

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