You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
848 B
C++

//////////////////////////////////////////////////////////////////////////////
//文件 Stack.h
//主要功能:
//
//程序编写: 2005-12-07
/////////////////////////////////////////////////////////////////////////////
#pragma once
#include <deque>
#include "One.h"
/**
* COne 栈
*/
class AFX_EXT_CLASS CStack
{
private:
std::deque<COne *> stack;
int num;
public:
CStack(int num);
CStack(void);
virtual ~CStack(void);
void Clear(void);
void Push(COne* pOne);
void Push(void* pValue, int type);
COne* Pop(void);
int GetCount(void);
void SetStack(int num);
void operator=(CStack& cs);
int GetSize(void);
COne* GetAt(int nIndex);
void EnableAutoExtend(bool bEnable) { m_bAutoExtendNum = bEnable; }
bool IsAutoExtend() { return m_bAutoExtendNum; }
public:
bool m_bAutoExtendNum; //堆栈数目不够时自动扩展而不删除前面的
};