#ifndef __LIST_H__
#define __LIST_H__

#include "property.h"

typedef Property ItemType;

class List
{
public:
  List();
  List(const List& toCopy);
  ~List();

  bool isFull() const;
  int getLength() const;
  void retrieveItem(ItemType& i, bool& found) const;
  
  void makeEmpty();
  void addItem(const ItemType&);
  void deleteItem(const ItemType&);
  
  void resetCurrent();
  void getNextItem(ItemType&);

private:
  struct Node
  {
    ItemType info;
    Node *next;
  };

  Node *listData;    // pointer to the first node
  Node *currentPos;  // pointer to the current node (for iteration)
  Node *extraNode;   // pointer to a spare node (for isFull)
  int numItems;      // number of nodes (for getLength)
};

#endif

