////////////////////////////////////////////////////////
// filename: CListA.h
// author: ChafumiTouji
// version: 1.0.1
// date: 2012/04/09
//		 2020/02/04
////////////////////////////////////////////////////////

#ifndef __CLIST_H__
#define __CLIST_H__

class CListData{
public:

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

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

class CListA{
public:
		
		CListData			*Head;
		CListData			*Tail;
		CListData			*CurrentPos;
		int			CurrentNum;
		int			ListSize;

		CListA();
		~CListA();
		CListData *GetHead();
		CListData *GetTail();
		CListData *GetData();
		CListData *SetNext();
		CListData *SetPrev();
		CListData *InsData();
		CListData *InsData( void *data );
		CListData *InsTail( void *data );
		CListData *InsHead( void *data );
		CListData *InsData(void *data, int id );
		CListData *InsTail(void *data, int id );
		CListData *InsHead(void *data, int id );
		CListData *Delete(int num);
		CListData *DeleteByID(int id);
		CListData *DeleteData();
		CListData *DeleteHead();
		CListData *GetAt( int num );
		CListData *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