////////////////////////////////////////////////////////
// filename: CListB.h
// author: Chafumi Touji
// version: 1.0.1
// date: 2012/04/09
////////////////////////////////////////////////////////

#ifndef __CLIST_H__
#define __CLIST_H__

class CListDataB{
public:

		CListDataB		*Next;
		CListDataB		*Prev;
		void				*Data;
		int				ID;

		CListDataB(){ 
			Next = Prev = NULL;
			Data = NULL;
			ID = 0;
		};
		~CListDataB(){
		};
};

class CListB{
public:
		
		CListDataB			*Head;
		CListDataB			*Tail;
		CListDataB			*CurrentPos;
		int			CurrentNum;
		int			ListSize;

		CListB();
		~CListB();
		CListDataB *GetHead();
		CListDataB *GetTail();
		CListDataB *GetData();
		CListDataB *SetNext();
		CListDataB *SetPrev();
		CListDataB *InsData();
		CListDataB *InsData( void *data );
		CListDataB *InsTail( void *data );
		CListDataB *InsHead( void *data );
		CListDataB *InsData(void *data, int id );
		CListDataB *InsTail(void *data, int id );
		CListDataB *InsHead(void *data, int id );
		CListDataB *Delete(int num);
		CListDataB *DeleteByID(int id);
		CListDataB *DeleteData();
		CListDataB *DeleteHead();
		CListDataB *GetAt( int num );
		CListDataB *GetByID(int id);
		bool SetAt( int num );
		int GetSize(){ return ListSize; };
		int GetCurrentNum(){ return CurrentNum; };
		bool DeleteAll();
		bool IsHead();
		bool IsTail();
		bool Find( void *data );

private:
};

#endif