////////////////////////////////////////////////////////
// filename: CListA.h
// author: Chafumi Touji
// version: 1.0.1
// date: 2021/07/26
////////////////////////////////////////////////////////

#ifndef __CLISTA_H__
#define __CLISTA_H__

class CListDataA{
public:

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

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

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

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