------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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: 534 $ -- $Date: 2012-10-05 19:46:28 +0200 (Fri, 05 Oct 2012) $ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Framework_Config; use Framework_Config; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Buffers; use Buffers; with Queueing_Systems; use Queueing_Systems; use Buffers.Buffer_Roles_package; with sets; package Buffer_Set is ---------------------------------------------------------- -- Definition of a set ---------------------------------------------------------- package Generic_Buffer_Set is new Sets ( Max_Element => Framework_Config.Max_Buffers, Element => Buffer_Ptr, Free => Free, Copy => Copy, Put => Put, xml_string => XML_String, xml_ref_string => XML_ref_String); use Generic_Buffer_Set; type Buffers_Set is new Generic_Buffer_Set.set with private; subtype Buffers_Range is Generic_Buffer_Set.element_range; subtype Buffers_Iterator is Generic_Buffer_Set.iterator; ---------------------------------------------------------- -- Exceptions defined in the set package ---------------------------------------------------------- -- Raised when a given buffer is not in a network set -- Buffer_Not_Found : exception; -- Raised when parameters provided to Add_buffer are wrong -- Invalid_Parameter : exception; ---------------------------------------------------------- -- I/O operations ---------------------------------------------------------- function Export_Aadl_Implementations (My_Buffers : in Buffers_Set) return Unbounded_String; ---------------------------------------------------------- -- Procedure to proceed modification on a set ---------------------------------------------------------- procedure Check_Buffer (My_Buffers : in Buffers_Set; Name : in Unbounded_String; Size : in Integer; Cpu_Name : in Unbounded_String; Address_Space_Name : in Unbounded_String); procedure Add_Buffer (My_Buffers : in out Buffers_Set; A_Buffer : in out Buffer_Ptr; Name : in Unbounded_String; Size : in Integer; Cpu_Name : in Unbounded_String; Address_Space_Name : in Unbounded_String; A_Qs : in Queueing_Systems_Type; Roles : in Buffer_Roles_Table); procedure Add_Buffer (My_Buffers : in out Buffers_Set; Name : in Unbounded_String; Size : in Integer; Cpu_Name : in Unbounded_String; Address_Space_Name : in Unbounded_String; A_Qs : in Queueing_Systems_Type; Roles : in Buffer_Roles_Table); procedure Update_Buffer (My_Buffers : in out Buffers_Set; Name : in Unbounded_String; New_Name : in Unbounded_String; Size : in Integer; Cpu_Name : in Unbounded_String; Address_Space_Name : in Unbounded_String; Roles : in Buffer_Roles_Table); procedure Delete_Address_Space (My_Buffers : in out Buffers_Set; A_Addr : in Unbounded_String); procedure Delete_Task (My_Buffers : in out Buffers_Set; A_Task : in Unbounded_String); procedure Delete_Processor (My_Buffers : in out Buffers_Set; A_Processor : in Unbounded_String); ------------------------------------------------------ -- Read information from a set ------------------------------------------------------ function Search_Buffer (My_Buffers : in Buffers_Set; Name : in Unbounded_String) return Buffer_Ptr; function Search_Buffer_by_id (My_Buffers : in Buffers_Set; id : in Unbounded_String) return Buffer_Ptr; function Get_Number_Of_Buffer_From_Processor (My_Buffers : in Buffers_Set; Processor_Name : in Unbounded_String) return Buffers_Range; ---------------------------------------------------------- -- List of parameters the user can set of get directly -- throught the set ---------------------------------------------------------- type Buffer_Parameters is (Size, Cpu_Name, Address_Space_Name, Roles); function Get (My_Buffers : in Buffers_Set; Buffer_Name : in Unbounded_String; Param_Name : in Buffer_Parameters) return Unbounded_String; procedure Set (My_Buffers : in out Buffers_Set; Buffer_Name : in Unbounded_String; Param_Name : in Buffer_Parameters; Param_Value : in Unbounded_String); function Get (My_Buffers : in Buffers_Set; Buffer_Name : in Unbounded_String; Param_Name : in Buffer_Parameters) return Natural; procedure Set (My_Buffers : in out Buffers_Set; Buffer_Name : in Unbounded_String; Param_Name : in Buffer_Parameters; Param_Value : in Natural); private type Buffers_Set is new Generic_Buffer_Set.set with null record; end Buffer_Set;