// LinkedList.h: interface for the CLinkedList class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LINKEDLIST_H__2BA88EC0_5921_11D9_A69C_444553540000__INCLUDED_)
#define AFX_LINKEDLIST_H__2BA88EC0_5921_11D9_A69C_444553540000__INCLUDED_

struct sListNode
{
	sListNode *prev;
	sListNode *next;
	void *itemPointer;
};

class CLinkedList
{
private:
	sListNode *head;
	sListNode *tail;
	sListNode *lastSelectedItem;
	int numItems;
	int lastSelectedItemIndex; //optimization

public:
	void InsertBefore(void *newItem, void *oldItem);
	void InsertAfter(void *newItem, void *oldItem);
	int GetNumItems();
	int AppendItem(void *item);
	int DeleteItem(int index);
	void *GetItem(int index);
	int InsertItem(void * item);
	CLinkedList();
	virtual ~CLinkedList();
};

#endif // !defined(AFX_LINKEDLIST_H__2BA88EC0_5921_11D9_A69C_444553540000__INCLUDED_)
