/*********************************************************************
Copyright 2001 Alexander Berthold, alexander-berthold@web.de.
-- This file is part of ctkCommon --
"ctkCommon" is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or any later version.
"ctkCommon" is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with "ctkCommon"; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
---------------------------------------------------------------
If you find any bugs or if you make other corrections/
enhancements, i'd appreciate if you'd let me know about
that. My email is
alexander-berthold@web.de
If you share this code, do not remove this text.
---------------------------------------------------------------
Class: ctkEnumerator
Author: Alexander Berthold
Copyright: Alexander Berthold
Date: 2001/12/01
Version: 0.1.01
Purpose: Provides a base class for enumeration of elements
Version history:
- 2001/12/01
Created
*********************************************************************/
// ctkEnumerator.h: interface for the ctkEnumerator class.
//
//////////////////////////////////////////////////////////////////////
template<class T>
class ctkEnumerator
{
public:
virtual void enumBegin() {};
virtual void enumElement(int intdata, T element) = 0;
virtual void enumEnd() {};
};
template<class T>
class ctkSortedEnumerator
{
public:
virtual void enumBegin() {};
virtual void enumElement(int intdata, T element) = 0;
virtual void enumEnd() {};
};
template<class T>
class ctkSupportsBasicEnumeration
{
public:
virtual void enumerate(ctkSortedEnumerator<T>& enumerator, int level=0, int nNestLevel=0, int *pnCounter=NULL) const = 0;
};
template<class T>
class ctkSupportsSortedEnumeration : public ctkSupportsBasicEnumeration<T>
{
public:
virtual void enumerateSorted(ctkSortedEnumerator<T>& enumerator, int level=0, int nNestLevel=0, int *pnCounter=NULL) const = 0;
};