GenericList.h

From Giona

#ifndef GENERICLIST_H_
#define GENERICLIST_H_

#include "Debug.h"
#include "GenericListNode.h"

class GenericList
{
public:
	static const int ERROR_NO 			= 0;
	static const int ERROR_NULL_NODE 		= 1;
	static const int ERROR_EMPTY_LIST 		= 2;
	static const int ERROR_NODE_NOT_FOUND		= 3;
	static const int ERROR_OUT_OF_RANGE_INDEX	= 4;
	
	
	GenericList();
	virtual ~GenericList();
	bool addNode(GenericListNode *node);
	bool inHeadNode(GenericListNode *node);
	bool deleteNode(GenericListNode *node);
	GenericListNode *getHead(); 
	GenericListNode *extractHead();
	GenericListNode *viewNode(int idx);
	GenericListNode *extractNode(int idx);
	int getLastError();
	int getLength();
private:
	GenericListNode * head;
	int length;
	int lastError;
	void deleteList();
	
};

#endif /*GENERICLIST_H_*/

BACK

Personal tools