------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a GNU GPL real time scheduling analysis tool. -- This program provides services to automatically check performances -- of real time architectures. -- -- Copyright (C) 2002-2010, by Frank Singhoff, Alain Plantec, Jerome Legrand -- -- The Cheddar project was started in 2002 by -- the LISyC Team, University of Western Britanny. -- -- Since 2008, Ellidiss technologies also contributes to the development of -- Cheddar and provides industrial support. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program 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 General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- -- Contact : cheddar@listes.univ-brest.fr -- ----------------------------------------------------------------------------- -- Last update : -- $Rev: 308 $ -- $Date: 2010-11-30 20:56:47 +0100 (Tue, 30 Nov 2010) $ -- $Author: gaudel $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with ada.strings.unbounded; use ada.strings.unbounded; with unbounded_strings; use unbounded_strings; generic type element (<>) is private; type element_ptr is access element; with procedure put (e : in element_ptr); with procedure free (e : in out element_ptr); with function copy (e : in element_ptr) return element_ptr; with function xml_string (e : in element_ptr; level : in Natural := 0) return Unbounded_String; package access_lists is type cell is private; type list is private; type list_ptr is access list; type iterator is private; type iterator_ptr is access iterator; element_not_found : exception; procedure initialize (l : in out list); procedure add (l : in out list; e : in element_ptr); procedure put (l : in list); procedure put (l : in list_ptr); -- Remove from "L" the element "E" -- procedure delete (l : in out list; e : in element_ptr); -- Delete from "L" all elements stored into "E" -- procedure delete (l : in out list; e : in list); -- Delete all elements of the list -- procedure delete (l : in out list); procedure duplicate (src : in list; dest : in out list); procedure duplicate (src : in list; dest : in out list; complete : Boolean := False); function is_empty (l : in list) return Boolean; function get_number_of_elements (l : in list) return Natural; function get_head (l : in list) return element_ptr; function get_tail (l : in list) return element_ptr; -- Move the current iterator to the next or previous element -- procedure next_element (l : in list; my_iterator : in out iterator); procedure previous_element (l : in list; my_iterator : in out iterator); -- Get the current element pointed by the iterator -- procedure current_element (l : in list; return_element : out element_ptr; my_iterator : in iterator); -- Initiliaze an iterator the the head or the tail of a list -- procedure reset_tail_iterator (l : in list; my_iterator : in out iterator); procedure reset_head_iterator (l : in list; my_iterator : in out iterator); -- the element is the tail of the head of a list ? -- function is_tail_element (l : in list; my_iterator : in iterator) return Boolean; function is_head_element (l : in list; my_iterator : in iterator) return Boolean; -- the element is in the list ? -- function element_in_list (e : in element_ptr; l : in list) return Boolean; function element_in_list (e : in element; l : in list) return Boolean; -- Produce XML for all elements of a list -- function xml_string (obj : in list; level : in Natural := 0) return Unbounded_String; private type cell_ptr is access cell; type cell is record next : cell_ptr; previous : cell_ptr; info : element_ptr; end record; type list is record head : cell_ptr; tail : cell_ptr; end record; type iterator is record current : cell_ptr; end record; end access_lists;