head	1.1;
access;
symbols
	bobbase:1.1
	bob:1.1;
locks; strict;
comment	@// @;


1.1
date	94.10.05.18.33.48;	author thoth;	state Exp;
branches;
next	;


desc
@Generic Set iterator declaration.
@


1.1
log
@Initial revision
@
text
@// Emacs: -*- C++ -*-

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


// 
// $Log: PSIter.h,v $


#ifndef SetIter_h_
#define SetIter_h_

#ifdef IA_PRII
#pragma interface
#endif

#include "Set.h"
#include "BSetIter.h"
//template <class T> class IA_BaseSetIter;

template <class T>
class IA_SetIter {
  protected:
    IA_BaseSetIter<T>	*iter;
    
  public:
    IA_SetIter();
    IA_SetIter(const IA_Set<T> &set) { this->iter = set.bsp->iterator(); }
    IA_SetIter(const IA_SetIter<T> &x) { this->iter = x.iter->clone_self(); }
    ~IA_SetIter() { delete iter; }
    
    IA_SetIter<T>& operator=(const IA_Set<T> &);
    IA_SetIter<T>& operator=(const IA_SetIter<T> &);
    
    IA_Set<T> domain() const { return iter->domain_(); }
    
    int operator() (T& ip) { return iter->next(ip); }
    void reset() { iter->reset(); }
};

/* sample usage:

   Set	blah;

   ...

   IA_SetIter<int>	scan(blah);
   int	i;

   while (scan(i)) {
     frob(i);
   }

 */

#endif
@
