50 lines
1.0 KiB
C++
50 lines
1.0 KiB
C++
//-----------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TWAutoDelBuf.h
|
|
// = Version : ver2.0
|
|
// = Author : xlc
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: 类的声明
|
|
// = Maintainers:
|
|
//
|
|
//-----------------------------------------------------------------------------+
|
|
#ifndef _TWAUTODELBUF_H_
|
|
#define _TWAUTODELBUF_H_
|
|
|
|
#ifndef _TWAUTODEL_H_
|
|
#include "TWAutoDel.h"
|
|
#endif
|
|
|
|
#ifndef _TPDLIST_H_
|
|
#include "TPDList.h"
|
|
#endif
|
|
|
|
#ifndef _TDLISTSTACK_H_
|
|
#include "TDListStack.h"
|
|
#endif
|
|
|
|
//动态内存搜集器
|
|
class GEOAPI TWAutoDelBuf : public TPDList<TWAutoDel>
|
|
{
|
|
friend TWAutoDel::TWAutoDel();
|
|
|
|
public:
|
|
|
|
//只能在堆栈上构造(g_firstBuf除外),新buffer自动成为全局当前buffer
|
|
TWAutoDelBuf();
|
|
|
|
//自动恢复旧全局当前buffer
|
|
virtual ~TWAutoDelBuf();
|
|
|
|
void AutoDel();
|
|
|
|
TWAutoDelBuf& GlobalBuf();
|
|
|
|
protected:
|
|
|
|
static TWAutoDelBuf* g_pCurBuf;
|
|
static TWAutoDelBuf g_firstBuf;
|
|
static TDListStack<TWAutoDelBuf*> g_bufStack;
|
|
};
|
|
|
|
#endif |