// L-12 MCS 360 Mon 20 Sep 2010 : mcs360_double_list.h

/* In this file we give a definition of a double linked list,
   defining the namespace "mcs360_double_list".

This file extends our first implementation in "mcs360_double_list_first.h"
with an iterator.  Because of exception handling, we include <stdexcept>. */

#ifndef MCS360_DOUBLE_LIST_H
#define MCS360_DOUBLE_LIST_H

#define NULL 0
#include <stdexcept>

namespace mcs360_double_list
{
   template <typename T>
   class List
   {
      private:

         #include "mcs360_double_node.h"
         Node *first;
         Node *last;

      public:

         List();
         List(T item);
         void append(T item);
         void write_forward();
         void write_backward();

         #include "mcs360_list_iterator.h"
         friend class Iterator;
   };
}
#include "mcs360_double_list.tc"
#endif

