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

📄 pvpcommon.h

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


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

template<class _Ct>
class PVPPOOL
{
public:
	enum { _MAX_ZONE_POOL_SIZE=1000, };
	PVPPOOL(){ m_Pool.Initialize( _MAX_ZONE_POOL_SIZE );	}
	~PVPPOOL(){ 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_PVPPOOL(_ClassType)									\
	private:														\
	static PVPPOOL<_ClassType> s_Pool;								\
	public:															\
	static _ClassType *	Create() { return s_Pool.Alloc(); }			\
	static VOID Destroy( _ClassType * pClass ) { s_Pool.Free( pClass ); }

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

⌨️ 快捷键说明

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