1-- Copyright 2004-2014 Simon Wright <simon@pushface.org> 2 3-- This package is free software; you can redistribute it and/or 4-- modify it under terms of the GNU General Public License as 5-- published by the Free Software Foundation; either version 2, or 6-- (at your option) any later version. This package is distributed in 7-- the hope that it will be useful, but WITHOUT ANY WARRANTY; without 8-- even the implied warranty of MERCHANTABILITY or FITNESS FOR A 9-- PARTICULAR PURPOSE. See the GNU General Public License for more 10-- details. You should have received a copy of the GNU General Public 11-- License distributed with this package; see file COPYING. If not, 12-- write to the Free Software Foundation, 59 Temple Place - Suite 13-- 330, Boston, MA 02111-1307, USA. 14 15-- As a special exception, if other files instantiate generics from 16-- this unit, or you link this unit with other files to produce an 17-- executable, this unit does not by itself cause the resulting 18-- executable to be covered by the GNU General Public License. This 19-- exception does not however invalidate any other reasons why the 20-- executable file might be covered by the GNU Public License. 21 22generic 23package BC.Trees.AVL_Trees.Iterators is 24 25 type Iterator (<>) is private; 26 27 function New_Iterator (For_The_Container : AVL_Tree) return Iterator; 28 29 procedure Reset (It : in out Iterator); 30 31 function Is_Done (It : Iterator) return Boolean; 32 33 function Current_Item (It : Iterator) return Item; 34 35 procedure Next (It : in out Iterator); 36 37private 38 39 type Container_Ptr is access all AVL_Tree; 40 for Container_Ptr'Storage_Size use 0; 41 42 type Iterator is record 43 For_The_Container : Container_Ptr; 44 Previous, Current : AVL_Node_Ref; 45 end record; 46 47end BC.Trees.AVL_Trees.Iterators; 48