worldguildcommon.h

来自「奇迹世界 部分源代码奇迹世界 部分源代码奇迹世界 部分源代码」· C头文件 代码 · 共 35 行

H
35
字号
#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 + =
减小字号Ctrl + -
显示快捷键?