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

📄 klist.h

📁 一个简单而又高效的嵌入式操作系统.包括GUI及文件系统.仿Windows设计,类似于MFC风格
💻 H
字号:
// KList.h: interface for the KList class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_KLIST_H__43112B7C_8C16_4D69_90EB_D97D7EFA7956__INCLUDED_)
#define AFX_KLIST_H__43112B7C_8C16_4D69_90EB_D97D7EFA7956__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

template<class TYPE>class KList
{
private:
	int m_nCount;
	int m_nBlockSize;
	LPVOID m_pBase;
	POSITION m_pHead;
	POSITION m_pTail;
public:
	KList(int nBlockSize)
	{
		m_nBlockSize=nBlockSize>0?nBlockSize:16;
		m_nCount=0;
		m_pBase=HeapAlloc(sizeof(LPVOID)*2+sizeof(TYPE)*m_nBlockSize);
	};
	virtual ~KList()
	{
		RemoveAll();
	};
public://Head/Tail Access
	TYPE& GetHead()
	{
		return NULL;
	};
	TYPE& GetTail()
	{
		return NULL;
	};
public://Operations
	TYPE RemoveHead()
	{
		return NULL;
	}
	void RemoveTail()
	{
	}
	POSITION AddHead(TYPE newElement)
	{
		return NULL;
	}
	POSITION AddTail()
	{
		return NULL;
	}
	void RemoveAll()
	{
		LPVOID pBlock=m_pBase+(m_pTail>>8);
		while(pBlock)
		{
			HeapFree(pBlock);
			pBlock=m_pBase+((*m_pTail)>>8);
		}
	}
public://Iteration
	POSITION GetHeadPosition()
	{
		return NULL;
	}
	POSITION GetTailPosition()
	{
		return NULL;
	}
	TYPE& GetNext(POSITION& pos)
	{
		return NULL;
	}
	TYPE& GetPrev(POSITION& pos)
	{
		return NULL;
	}
public://Retrieval/Modification
	TYPE& GetAt(POSITION pos)
	{
		return NULL;
	}
	void SetAt(POSITION pos,TYPE newElement)
	{
	
	}
	POSITION InsertBefore(POSITION pos,TYPE newElement)
	{
		return NULL;
	}
	POSITION InsertAfter(POSITION pos,TYPE newElement)
	{
		return NULL;
	}
public://Find
	POSITION Find(TYPE searchValue, POSITION startAfter) const
	{
		return NULL;
	}
	POSITION FindIndex( int nIndex ) const
	{
		return NULL;
	}
public://Other
	int GetCount(){return 0;};
	BOOL IsEmpty(){return FALSE;};
};

#endif // !defined(AFX_KLIST_H__43112B7C_8C16_4D69_90EB_D97D7EFA7956__INCLUDED_)

⌨️ 快捷键说明

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