------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a GNU GPL real-time scheduling analysis tool. -- This program provides services to automatically check schedulability and -- other performance criteria of real-time architecture models. -- -- Copyright (C) 2002-2020, Frank Singhoff, Alain Plantec, Jerome Legrand, -- Hai Nam Tran, Stephane Rubini -- -- The Cheddar project was started in 2002 by -- Frank Singhoff, Lab-STICC UMR 6285, Université de Bretagne Occidentale -- -- Cheddar has been published in the "Agence de Protection des Programmes/France" in 2008. -- Since 2008, Ellidiss technologies also contributes to the development of -- Cheddar and provides industrial support. -- -- The full list of contributors and sponsors can be found in AUTHORS.txt and SPONSORS.txt -- -- 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$ -- $Date$ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Numerics.Discrete_Random; generic type element is private; with procedure put (e : in element); with procedure free (e : in out element); with function xml_string (e : in element) return Unbounded_String; package 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; package rand is new Ada.Numerics.Discrete_Random (Integer); use rand; g : generator; element_not_found : exception; invalid_argument : exception; procedure initialize (l : in out list); procedure add (l : in out list; e : in element); procedure add_head (l : in out list; e : in element); procedure add_tail (l : in out list; e : in element); procedure put (l : in list); -- Remove from "L" the element "E" -- procedure delete (l : in out list; e : in element); -- 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); 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; function get_tail (l : in list) return element; procedure get_element_number (my_list : in list; return_element : out element; position : in Integer); -- 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; 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; l : in list) return Boolean; function get_random_element (my_list : in list) return element; type order_function is access function (op1 : in element; op2 : in element) return Boolean; procedure sort (my_list : in out list; order : order_function); -- 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; end record; type list is record head : cell_ptr; tail : cell_ptr; end record; type iterator is record current : cell_ptr; end record; end lists;