------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- This source file was automatically generated by Platypus
-- see http://dossen.univ-brest.fr/apl
--
-- Any modification of this file will be lost.
-- Please see the "platypus" directory instead : it contains the Cheddar's
-- model and its meta-model.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- 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-2016 Frank Singhoff, Alain Plantec, Jerome Legrand
--
-- The Cheddar project was started in 2002 by
-- Frank Singhoff, Lab-STICC UMR 6285 laboratory, 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
-- To post to this mailing list, you must be subscribed
-- (see http//beru.univ-brest.fr/~singhoff/cheddar for details)
--
------------------------------------------------------------------------------
------------------------------------------------------------------------------
with Text_io;
use Text_io;
with unbounded_strings;
use unbounded_strings;
with primitive_xml_strings;
use primitive_xml_strings;
with framework;
use framework;
with id_generators;
use id_generators;
with Tasks.Extended;
use Tasks.Extended;
Package Body Scheduling_Analysis is
-- --------= Buffer_Size_Item =--------
procedure Initialize(obj : out Buffer_Size_Item) is
begin
obj.time := 0;
obj.size := 0;
end Initialize;
procedure Put(obj : in Buffer_Size_Item) is
begin
put("time: "); standards_io.natural_io.put(obj.time); put ( "; " );
put("size: "); standards_io.natural_io.put(obj.size); put ( "; " );
end Put;
procedure Put(obj : in Buffer_Size_Item_Ptr) is
begin
Put(Obj.All);
end Put;
procedure Build_Attributes_XML_String(obj : in Buffer_Size_Item; result : in out Unbounded_String) is
begin
if (XML_String(obj.time) /= Empty_String) then
result := result & to_unbounded_string("");
end if;
if (XML_String(obj.size) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.size) & to_unbounded_string("");
end if;
end Build_Attributes_XML_String;
function XML_String(obj : in Buffer_Size_Item) return Unbounded_String is
result : Unbounded_String;
begin
result := to_unbounded_string("");
Build_Attributes_XML_String(obj, result);
result := result & to_unbounded_string("");
return (result);
end XML_String;
function XML_String(obj : in Buffer_Size_Item_Ptr) return Unbounded_String is
begin
if obj /= null then
return XML_String(obj.all);
else
return Empty_String;
end if;
end XML_String;
function XML_Ref_String(obj : in Buffer_Size_Item) return Unbounded_String is
result : Unbounded_String;
begin
raise xml_ref_string_error;
return to_unbounded_string("");
end XML_Ref_String;
function Copy ( obj : in Buffer_Size_Item ) return Buffer_Size_Item_Ptr is
New_Buffer_Size_Item : Buffer_Size_Item_Ptr;
begin
New_Buffer_Size_Item := new Buffer_Size_Item'(obj);
return (New_Buffer_Size_Item);
end Copy;
function Copy ( obj : in Buffer_Size_Item_Ptr ) return Buffer_Size_Item_Ptr is
begin
return copy(obj.all);
end Copy;
-- --------= Density_Item =--------
procedure Initialize(obj : out Density_Item) is
begin
obj.response_time := 0;
obj.probability := 0.0;
end Initialize;
procedure Put(obj : in Density_Item) is
begin
put("response_time: "); standards_io.natural_io.put(obj.response_time); put ( "; " );
put("probability: "); standards_io.double_io.put(obj.probability); put ( "; " );
end Put;
procedure Put(obj : in Density_Item_Ptr) is
begin
Put(Obj.All);
end Put;
procedure Build_Attributes_XML_String(obj : in Density_Item; result : in out Unbounded_String) is
begin
if (XML_String(obj.response_time) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.response_time) & to_unbounded_string("");
end if;
if (XML_String(obj.probability) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.probability) & to_unbounded_string("");
end if;
end Build_Attributes_XML_String;
function XML_String(obj : in Density_Item) return Unbounded_String is
result : Unbounded_String;
begin
result := to_unbounded_string("");
Build_Attributes_XML_String(obj, result);
result := result & to_unbounded_string("");
return (result);
end XML_String;
function XML_String(obj : in Density_Item_Ptr) return Unbounded_String is
begin
if obj /= null then
return XML_String(obj.all);
else
return Empty_String;
end if;
end XML_String;
function XML_Ref_String(obj : in Density_Item) return Unbounded_String is
result : Unbounded_String;
begin
raise xml_ref_string_error;
return to_unbounded_string("");
end XML_Ref_String;
function Copy ( obj : in Density_Item ) return Density_Item_Ptr is
New_Density_Item : Density_Item_Ptr;
begin
New_Density_Item := new Density_Item'(obj);
return (New_Density_Item);
end Copy;
function Copy ( obj : in Density_Item_Ptr ) return Density_Item_Ptr is
begin
return copy(obj.all);
end Copy;
-- --------= Deadlock_Item =--------
procedure Initialize(obj : out Deadlock_Item) is
begin
obj.time := 0;
obj.task_name := empty_string;
obj.resource_name := empty_string;
end Initialize;
procedure Put(obj : in Deadlock_Item) is
begin
put("time: "); standards_io.natural_io.put(obj.time); put ( "; " );
put("task_name: "); put(obj.task_name); put ( "; " );
put("resource_name: "); put(obj.resource_name); put ( "; " );
end Put;
procedure Put(obj : in Deadlock_Item_Ptr) is
begin
Put(Obj.All);
end Put;
procedure Build_Attributes_XML_String(obj : in Deadlock_Item; result : in out Unbounded_String) is
begin
if (XML_String(obj.time) /= Empty_String) then
result := result & to_unbounded_string("");
end if;
if (XML_String(obj.task_name) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.task_name) & to_unbounded_string("");
end if;
if (XML_String(obj.resource_name) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.resource_name) & to_unbounded_string("");
end if;
end Build_Attributes_XML_String;
function XML_String(obj : in Deadlock_Item) return Unbounded_String is
result : Unbounded_String;
begin
result := to_unbounded_string("");
Build_Attributes_XML_String(obj, result);
result := result & to_unbounded_string("");
return (result);
end XML_String;
function XML_String(obj : in Deadlock_Item_Ptr) return Unbounded_String is
begin
if obj /= null then
return XML_String(obj.all);
else
return Empty_String;
end if;
end XML_String;
function XML_Ref_String(obj : in Deadlock_Item) return Unbounded_String is
result : Unbounded_String;
begin
raise xml_ref_string_error;
return to_unbounded_string("");
end XML_Ref_String;
function Copy ( obj : in Deadlock_Item ) return Deadlock_Item_Ptr is
New_Deadlock_Item : Deadlock_Item_Ptr;
begin
New_Deadlock_Item := new Deadlock_Item'(obj);
return (New_Deadlock_Item);
end Copy;
function Copy ( obj : in Deadlock_Item_Ptr ) return Deadlock_Item_Ptr is
begin
return copy(obj.all);
end Copy;
-- --------= Priority_Inversion_Item =--------
procedure Initialize(obj : out Priority_Inversion_Item) is
begin
obj.start_time := 0;
obj.end_time := 0;
obj.task_name := empty_string;
obj.resource_name := empty_string;
end Initialize;
procedure Put(obj : in Priority_Inversion_Item) is
begin
put("start_time: "); standards_io.natural_io.put(obj.start_time); put ( "; " );
put("end_time: "); standards_io.natural_io.put(obj.end_time); put ( "; " );
put("task_name: "); put(obj.task_name); put ( "; " );
put("resource_name: "); put(obj.resource_name); put ( "; " );
end Put;
procedure Put(obj : in Priority_Inversion_Item_Ptr) is
begin
Put(Obj.All);
end Put;
procedure Build_Attributes_XML_String(obj : in Priority_Inversion_Item; result : in out Unbounded_String) is
begin
if (XML_String(obj.start_time) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.start_time) & to_unbounded_string("");
end if;
if (XML_String(obj.end_time) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.end_time) & to_unbounded_string("");
end if;
if (XML_String(obj.task_name) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.task_name) & to_unbounded_string("");
end if;
if (XML_String(obj.resource_name) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.resource_name) & to_unbounded_string("");
end if;
end Build_Attributes_XML_String;
function XML_String(obj : in Priority_Inversion_Item) return Unbounded_String is
result : Unbounded_String;
begin
result := to_unbounded_string("");
Build_Attributes_XML_String(obj, result);
result := result & to_unbounded_string("");
return (result);
end XML_String;
function XML_String(obj : in Priority_Inversion_Item_Ptr) return Unbounded_String is
begin
if obj /= null then
return XML_String(obj.all);
else
return Empty_String;
end if;
end XML_String;
function XML_Ref_String(obj : in Priority_Inversion_Item) return Unbounded_String is
result : Unbounded_String;
begin
raise xml_ref_string_error;
return to_unbounded_string("");
end XML_Ref_String;
function Copy ( obj : in Priority_Inversion_Item ) return Priority_Inversion_Item_Ptr is
New_Priority_Inversion_Item : Priority_Inversion_Item_Ptr;
begin
New_Priority_Inversion_Item := new Priority_Inversion_Item'(obj);
return (New_Priority_Inversion_Item);
end Copy;
function Copy ( obj : in Priority_Inversion_Item_Ptr ) return Priority_Inversion_Item_Ptr is
begin
return copy(obj.all);
end Copy;
-- --------= Task_Release_Record =--------
procedure Initialize(obj : in out Task_Release_Record) is
begin
generate_id( framework_id, obj.cheddar_private_id );
obj.task_name := empty_string;
obj.task_index := 0;
obj.capacity := 0;
obj.release_time := 0;
obj.finish_time := 0;
obj.deadline := 0;
obj.completed := false;
end Initialize;
function Copy ( obj : in Task_Release_Record ) return Task_Release_Record_Ptr is
New_Task_Release_Record : Task_Release_Record_Ptr;
begin
New_Task_Release_Record := new Task_Release_Record'(obj);
return (New_Task_Release_Record);
end Copy;
function Copy ( obj : in Task_Release_Record_Ptr ) return Task_Release_Record_Ptr is
begin
return copy(obj.all);
end Copy;
procedure Put(obj : in Task_Release_Record) is
begin
put("cheddar_private_id: "); put(obj.cheddar_private_id); put ( "; " );
put("task_name: "); put(obj.task_name); put ( "; " );
put("task_index: "); standards_io.natural_io.put(obj.task_index); put ( "; " );
put("capacity: "); standards_io.natural_io.put(obj.capacity); put ( "; " );
put("release_time: "); standards_io.natural_io.put(obj.release_time); put ( "; " );
put("finish_time: "); standards_io.natural_io.put(obj.finish_time); put ( "; " );
put("deadline: "); standards_io.natural_io.put(obj.deadline); put ( "; " );
put("completed: "); standards_io.boolean_io.put(obj.completed); put ( "; " );
end Put;
procedure Put(obj : in Task_Release_Record_Ptr) is
begin
Put(Obj.All);
end Put;
procedure Put_Name ( obj : in Task_Release_Record_Ptr) is
begin
Put ( To_String ( Obj.cheddar_private_id ) );
end Put_Name;
function type_of ( obj : in Task_Release_Record ) return unbounded_string_list is
list : unbounded_string_list;
s : unbounded_string_ptr;
begin
Initialize(list);
s := new unbounded_string;
s.all := to_unbounded_string("SCHEDULING_ANALYSIS.TASK_RELEASE_RECORD");
Add (list, s);
return list;
end type_of;
function type_of ( obj : in Task_Release_Record_Ptr ) return unbounded_string_list is
begin
return type_of(obj.all);
end type_of;
procedure Build_Attributes_XML_String(obj : in Task_Release_Record; result : in out Unbounded_String) is
begin
if (XML_String(obj.task_name) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.task_name) & to_unbounded_string("");
end if;
if (XML_String(obj.task_index) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.task_index) & to_unbounded_string("");
end if;
if (XML_String(obj.capacity) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.capacity) & to_unbounded_string("");
end if;
if (XML_String(obj.release_time) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.release_time) & to_unbounded_string("");
end if;
if (XML_String(obj.finish_time) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.finish_time) & to_unbounded_string("");
end if;
if (XML_String(obj.deadline) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.deadline) & to_unbounded_string("");
end if;
if (XML_String(obj.completed) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.completed) & to_unbounded_string("");
end if;
end Build_Attributes_XML_String;
function XML_String(obj : in Task_Release_Record) return Unbounded_String is
result : Unbounded_String;
begin
result := to_unbounded_string("");
Build_Attributes_XML_String(obj, result);
result := result & to_unbounded_string("");
return (result);
end XML_String;
function XML_String(obj : in Task_Release_Record_Ptr) return Unbounded_String is
begin
if obj /= null then
return XML_String(obj.all);
else
return Empty_String;
end if;
end XML_String;
function XML_Ref_String(obj : in Task_Release_Record) return Unbounded_String is
result : Unbounded_String;
begin
result := to_unbounded_string("");
return (result);
end XML_Ref_String;
function XML_Ref_String(obj : in Task_Release_Record_Ptr) return Unbounded_String is
begin
return XML_Ref_String(obj.all);
end XML_Ref_String;
-- --------= Relative_Priority_Record =--------
procedure Initialize(obj : out Relative_Priority_Record) is
begin
obj.higher_priority_task := empty_string;
obj.hpt_index := 0;
obj.lower_priority_task := empty_string;
obj.lpt_index := 0;
end Initialize;
procedure Put(obj : in Relative_Priority_Record) is
begin
put("higher_priority_task: "); put(obj.higher_priority_task); put ( "; " );
put("hpt_index: "); standards_io.natural_io.put(obj.hpt_index); put ( "; " );
put("lower_priority_task: "); put(obj.lower_priority_task); put ( "; " );
put("lpt_index: "); standards_io.natural_io.put(obj.lpt_index); put ( "; " );
end Put;
procedure Put(obj : in Relative_Priority_Record_Ptr) is
begin
Put(Obj.All);
end Put;
procedure Build_Attributes_XML_String(obj : in Relative_Priority_Record; result : in out Unbounded_String) is
begin
if (XML_String(obj.higher_priority_task) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.higher_priority_task) & to_unbounded_string("");
end if;
if (XML_String(obj.hpt_index) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.hpt_index) & to_unbounded_string("");
end if;
if (XML_String(obj.lower_priority_task) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.lower_priority_task) & to_unbounded_string("");
end if;
if (XML_String(obj.lpt_index) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.lpt_index) & to_unbounded_string("");
end if;
end Build_Attributes_XML_String;
function XML_String(obj : in Relative_Priority_Record) return Unbounded_String is
result : Unbounded_String;
begin
result := to_unbounded_string("");
Build_Attributes_XML_String(obj, result);
result := result & to_unbounded_string("");
return (result);
end XML_String;
function XML_String(obj : in Relative_Priority_Record_Ptr) return Unbounded_String is
begin
if obj /= null then
return XML_String(obj.all);
else
return Empty_String;
end if;
end XML_String;
function XML_Ref_String(obj : in Relative_Priority_Record) return Unbounded_String is
result : Unbounded_String;
begin
raise xml_ref_string_error;
return to_unbounded_string("");
end XML_Ref_String;
function Copy ( obj : in Relative_Priority_Record ) return Relative_Priority_Record_Ptr is
New_Relative_Priority_Record : Relative_Priority_Record_Ptr;
begin
New_Relative_Priority_Record := new Relative_Priority_Record'(obj);
return (New_Relative_Priority_Record);
end Copy;
function Copy ( obj : in Relative_Priority_Record_Ptr ) return Relative_Priority_Record_Ptr is
begin
return copy(obj.all);
end Copy;
-- --------= Ceiling_Priority_Record =--------
procedure Initialize(obj : out Ceiling_Priority_Record) is
begin
obj.resource_name := empty_string;
obj.ceiling_priority := 0;
end Initialize;
procedure Put(obj : in Ceiling_Priority_Record) is
begin
put("resource_name: "); put(obj.resource_name); put ( "; " );
put("ceiling_priority: "); put(obj.ceiling_priority); put ( "; " );
end Put;
procedure Put(obj : in Ceiling_Priority_Record_Ptr) is
begin
Put(Obj.All);
end Put;
procedure Build_Attributes_XML_String(obj : in Ceiling_Priority_Record; result : in out Unbounded_String) is
begin
if (XML_String(obj.resource_name) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.resource_name) & to_unbounded_string("");
end if;
if (XML_String(obj.ceiling_priority) /= Empty_String) then
result := result & to_unbounded_string("") & XML_String(obj.ceiling_priority) & to_unbounded_string("");
end if;
end Build_Attributes_XML_String;
function XML_String(obj : in Ceiling_Priority_Record) return Unbounded_String is
result : Unbounded_String;
begin
result := to_unbounded_string("");
Build_Attributes_XML_String(obj, result);
result := result & to_unbounded_string("");
return (result);
end XML_String;
function XML_String(obj : in Ceiling_Priority_Record_Ptr) return Unbounded_String is
begin
if obj /= null then
return XML_String(obj.all);
else
return Empty_String;
end if;
end XML_String;
function XML_Ref_String(obj : in Ceiling_Priority_Record) return Unbounded_String is
result : Unbounded_String;
begin
raise xml_ref_string_error;
return to_unbounded_string("");
end XML_Ref_String;
function Copy ( obj : in Ceiling_Priority_Record ) return Ceiling_Priority_Record_Ptr is
New_Ceiling_Priority_Record : Ceiling_Priority_Record_Ptr;
begin
New_Ceiling_Priority_Record := new Ceiling_Priority_Record'(obj);
return (New_Ceiling_Priority_Record);
end Copy;
function Copy ( obj : in Ceiling_Priority_Record_Ptr ) return Ceiling_Priority_Record_Ptr is
begin
return copy(obj.all);
end Copy;
End Scheduling_Analysis;