// Emacs: -*- C++ -*-

//
//	Copyright 1993, Center for Computer Vision and Visualization,
//	University of Florida.  All rights reserved.
//


// 
// $Log: ListFPS.c,v $
// Revision 1.2  1994/01/31  16:38:40  thoth
// ValueSet now supports resetting of the iterator. We can do it
// in FloatPointSets now.
//
// Revision 1.1  1993/09/15  12:38:37  thoth
// Initial revision
//

#include "BaseIPSIter.h"

template <class P>
class IA_ListPSIter: public IA_BasePSIter<P> {
  private:
    IA_ListPSIter<P> &operator=(const IA_BasePSIter<P> &arg);
  protected:
    IA_ValueSetIter<P>	iter;

  public:
    IA_ListPSIter(IA_ListPS<P> *ps)
    :IA_BasePSIter<P>(ps), iter(ps->points) {
    }
    IA_ListPSIter(const IA_ListPSIter<P> &arg)
    :IA_BasePSIter<P>(arg.domain), iter(arg.iter) {
    }

    IA_BasePSIter<P> *clone_self() {
	return new IA_ListPSIter<P>(*this);
    }

    int next(P&p) {
	return iter(p);
    }

    void reset() {
	iter.reset();
    }
};

template <class P>
char IA_ListPS<P>::dummy;

template <class P>
IA_BasePSIter<IA_FloatPoint>* IA_ListPS<P>::iterator() const
{
    /* cast away const */
    return new IA_ListPSIter<P>((IA_ListPS<P>*)this);
}
