------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- 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 free real time scheduling tool. -- This program provides services to automatically check temporal constraints -- of real time tasks. -- -- Copyright (C) 2002-2014 Frank Singhoff -- Cheddar is developed by the LAB-STICC Team, University of Brest -- -- 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 Offsets; use Offsets; use offsets.Offsets_Table_Package; with Parameters; use Parameters; use parameters.User_Defined_Parameters_Table_Package; Package Body Tasks is function XML_String(obj : in Tasks_Type) return Unbounded_String is begin return to_unbounded_string(Tasks_Type'image (obj) ); end XML_String; function XML_Ref_String (obj : in Tasks_Type) return Unbounded_String is begin raise xml_ref_string_error; return to_unbounded_string(""); end XML_Ref_String; function XML_String(obj : in Policies) return Unbounded_String is begin return to_unbounded_string(Policies'image (obj) ); end XML_String; function XML_Ref_String (obj : in Policies) return Unbounded_String is begin raise xml_ref_string_error; return to_unbounded_string(""); end XML_Ref_String; -- --------= Generic_Task =-------- procedure Initialize(obj : in out Generic_Task) is begin initialize(Named_Object(obj)); obj.task_type := Periodic_Type; obj.cpu_name := empty_string; obj.address_space_name := empty_string; obj.capacity := 0; obj.deadline := 0; obj.start_time := 0; obj.priority := 0; obj.blocking_time := 0; obj.policy := Sched_Fifo; obj.text_memory_size := 0; obj.stack_memory_size := 0; obj.criticality := 0; obj.context_switch_overhead := 0; obj.cfg_name := empty_string; obj.cache_access_profile_name := empty_string; obj.object_type := Task_Object_Type; end Initialize; function Copy ( obj : in Generic_Task ) return Generic_Task_Ptr is New_Generic_Task : Generic_Task_Ptr; begin New_Generic_Task := new Generic_Task'(obj); return (New_Generic_Task); end Copy; function Copy ( obj : in Generic_Task_Ptr ) return Generic_Task_Ptr is begin return copy(obj.all); end Copy; procedure Put(obj : in Generic_Task) is begin put(Named_Object(obj)); put("task_type: "); put(obj.task_type); put ( "; " ); put("cpu_name: "); put(obj.cpu_name); put ( "; " ); put("address_space_name: "); put(obj.address_space_name); put ( "; " ); put("capacity: "); standards_io.natural_io.put(obj.capacity); put ( "; " ); put("deadline: "); standards_io.natural_io.put(obj.deadline); put ( "; " ); put("start_time: "); standards_io.natural_io.put(obj.start_time); put ( "; " ); put("priority: "); put(obj.priority); put ( "; " ); put("blocking_time: "); standards_io.natural_io.put(obj.blocking_time); put ( "; " ); put("policy: "); put(obj.policy); put ( "; " ); put("offsets: "); put(obj.offsets); put ( "; " ); put("text_memory_size: "); standards_io.natural_io.put(obj.text_memory_size); put ( "; " ); put("stack_memory_size: "); standards_io.natural_io.put(obj.stack_memory_size); put ( "; " ); put("parameters: "); put(obj.parameters); put ( "; " ); put("criticality: "); standards_io.natural_io.put(obj.criticality); put ( "; " ); put("context_switch_overhead: "); standards_io.natural_io.put(obj.context_switch_overhead); put ( "; " ); put("cfg_name: "); put(obj.cfg_name); put ( "; " ); put("cache_access_profile_name: "); put(obj.cache_access_profile_name); put ( "; " ); end Put; procedure Put(obj : in Generic_Task_Ptr) is begin Put(Obj.All); end Put; procedure Put_Name ( obj : in Generic_Task_Ptr) is begin Put ( To_String ( Obj.Name ) ); end Put_Name; function Get_Name (obj : in Generic_Task) return Unbounded_String is begin return obj.name; end Get_Name; function Get_Name (obj : in Generic_Task_ptr) return Unbounded_String is begin return obj.name; end Get_Name; function type_of ( obj : in Generic_Task ) 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("OBJECTS.GENERIC_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.NAMED_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.GENERIC_TASK"); Add (list, s); return list; end type_of; function type_of ( obj : in Generic_Task_Ptr ) return unbounded_string_list is begin return type_of(obj.all); end type_of; procedure Build_Attributes_XML_String(obj : in Generic_Task; result : in out Unbounded_String) is begin Build_Attributes_XML_String(Named_Object(obj), result); if (XML_String(obj.task_type) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.task_type) & to_unbounded_string(""); end if; if (XML_String(obj.cpu_name) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.cpu_name) & to_unbounded_string(""); end if; if (XML_String(obj.address_space_name) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.address_space_name) & 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.deadline) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.deadline) & to_unbounded_string(""); end if; 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.priority) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.priority) & to_unbounded_string(""); end if; if (XML_String(obj.blocking_time) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.blocking_time) & to_unbounded_string(""); end if; if (XML_String(obj.policy) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.policy) & to_unbounded_string(""); end if; if (XML_String(obj.offsets) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.offsets) & to_unbounded_string(""); end if; if (XML_String(obj.text_memory_size) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.text_memory_size) & to_unbounded_string(""); end if; if (XML_String(obj.stack_memory_size) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.stack_memory_size) & to_unbounded_string(""); end if; if (XML_String(obj.parameters) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.parameters) & to_unbounded_string(""); end if; if (XML_String(obj.criticality) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.criticality) & to_unbounded_string(""); end if; if (XML_String(obj.context_switch_overhead) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.context_switch_overhead) & to_unbounded_string(""); end if; if (XML_String(obj.cfg_name) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.cfg_name) & to_unbounded_string(""); end if; if (XML_String(obj.cache_access_profile_name) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.cache_access_profile_name) & to_unbounded_string(""); end if; end Build_Attributes_XML_String; function XML_String(obj : in Generic_Task) 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 Generic_Task_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 Generic_Task) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); return (result); end XML_Ref_String; function XML_Ref_String(obj : in Generic_Task_Ptr) return Unbounded_String is begin return XML_Ref_String(obj.all); end XML_Ref_String; -- --------= Periodic_Task =-------- procedure Initialize(obj : in out Periodic_Task) is begin initialize(Generic_Task(obj)); obj.period := 0; obj.jitter := 0; obj.every := 0; obj.task_type := Periodic_Type; end Initialize; function Copy ( obj : in Periodic_Task ) return Generic_Task_Ptr is New_Periodic_Task : Periodic_Task_Ptr; begin New_Periodic_Task := new Periodic_Task'(obj); return Generic_Task_Ptr(New_Periodic_Task); end Copy; function Copy ( obj : in Periodic_Task_Ptr ) return Generic_Task_Ptr is begin return copy(obj.all); end Copy; procedure Put(obj : in Periodic_Task) is begin put(Generic_Task(obj)); put("period: "); standards_io.natural_io.put(obj.period); put ( "; " ); put("jitter: "); standards_io.natural_io.put(obj.jitter); put ( "; " ); put("every: "); standards_io.natural_io.put(obj.every); put ( "; " ); end Put; procedure Put(obj : in Periodic_Task_Ptr) is begin Put(Obj.All); end Put; procedure Put_Name ( obj : in Periodic_Task_Ptr) is begin Put ( To_String ( Obj.Name ) ); end Put_Name; function Get_Name (obj : in Periodic_Task) return Unbounded_String is begin return obj.name; end Get_Name; function Get_Name (obj : in Periodic_Task_ptr) return Unbounded_String is begin return obj.name; end Get_Name; function type_of ( obj : in Periodic_Task ) 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("OBJECTS.GENERIC_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.NAMED_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.GENERIC_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.PERIODIC_TASK"); Add (list, s); return list; end type_of; function type_of ( obj : in Periodic_Task_Ptr ) return unbounded_string_list is begin return type_of(obj.all); end type_of; procedure Build_Attributes_XML_String(obj : in Periodic_Task; result : in out Unbounded_String) is begin Build_Attributes_XML_String(Generic_Task(obj), result); if (XML_String(obj.period) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.period) & to_unbounded_string(""); end if; if (XML_String(obj.jitter) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.jitter) & to_unbounded_string(""); end if; if (XML_String(obj.every) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.every) & to_unbounded_string(""); end if; end Build_Attributes_XML_String; function XML_String(obj : in Periodic_Task) 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 Periodic_Task_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 Periodic_Task) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); return (result); end XML_Ref_String; function XML_Ref_String(obj : in Periodic_Task_Ptr) return Unbounded_String is begin return XML_Ref_String(obj.all); end XML_Ref_String; -- --------= Aperiodic_Task =-------- procedure Initialize(obj : in out Aperiodic_Task) is begin initialize(Generic_Task(obj)); obj.task_type := Aperiodic_Type; end Initialize; function Copy ( obj : in Aperiodic_Task ) return Generic_Task_Ptr is New_Aperiodic_Task : Aperiodic_Task_Ptr; begin New_Aperiodic_Task := new Aperiodic_Task'(obj); return Generic_Task_Ptr(New_Aperiodic_Task); end Copy; function Copy ( obj : in Aperiodic_Task_Ptr ) return Generic_Task_Ptr is begin return copy(obj.all); end Copy; procedure Put(obj : in Aperiodic_Task) is begin put(Generic_Task(obj)); end Put; procedure Put(obj : in Aperiodic_Task_Ptr) is begin Put(Obj.All); end Put; procedure Put_Name ( obj : in Aperiodic_Task_Ptr) is begin Put ( To_String ( Obj.Name ) ); end Put_Name; function Get_Name (obj : in Aperiodic_Task) return Unbounded_String is begin return obj.name; end Get_Name; function Get_Name (obj : in Aperiodic_Task_ptr) return Unbounded_String is begin return obj.name; end Get_Name; function type_of ( obj : in Aperiodic_Task ) 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("OBJECTS.GENERIC_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.NAMED_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.GENERIC_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.APERIODIC_TASK"); Add (list, s); return list; end type_of; function type_of ( obj : in Aperiodic_Task_Ptr ) return unbounded_string_list is begin return type_of(obj.all); end type_of; procedure Build_Attributes_XML_String(obj : in Aperiodic_Task; result : in out Unbounded_String) is begin Build_Attributes_XML_String(Generic_Task(obj), result); end Build_Attributes_XML_String; function XML_String(obj : in Aperiodic_Task) 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 Aperiodic_Task_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 Aperiodic_Task) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); return (result); end XML_Ref_String; function XML_Ref_String(obj : in Aperiodic_Task_Ptr) return Unbounded_String is begin return XML_Ref_String(obj.all); end XML_Ref_String; -- --------= Poisson_Task =-------- procedure Initialize(obj : in out Poisson_Task) is begin initialize(Periodic_Task(obj)); obj.seed := 0; obj.predictable := false; obj.task_type := Poisson_Type; end Initialize; function Copy ( obj : in Poisson_Task ) return Generic_Task_Ptr is New_Poisson_Task : Poisson_Task_Ptr; begin New_Poisson_Task := new Poisson_Task'(obj); return Generic_Task_Ptr(New_Poisson_Task); end Copy; function Copy ( obj : in Poisson_Task_Ptr ) return Generic_Task_Ptr is begin return copy(obj.all); end Copy; procedure Put(obj : in Poisson_Task) is begin put(Periodic_Task(obj)); put("seed: "); standards_io.natural_io.put(obj.seed); put ( "; " ); put("predictable: "); standards_io.boolean_io.put(obj.predictable); put ( "; " ); end Put; procedure Put(obj : in Poisson_Task_Ptr) is begin Put(Obj.All); end Put; procedure Put_Name ( obj : in Poisson_Task_Ptr) is begin Put ( To_String ( Obj.Name ) ); end Put_Name; function Get_Name (obj : in Poisson_Task) return Unbounded_String is begin return obj.name; end Get_Name; function Get_Name (obj : in Poisson_Task_ptr) return Unbounded_String is begin return obj.name; end Get_Name; function type_of ( obj : in Poisson_Task ) 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("OBJECTS.GENERIC_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.NAMED_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.GENERIC_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.PERIODIC_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.POISSON_TASK"); Add (list, s); return list; end type_of; function type_of ( obj : in Poisson_Task_Ptr ) return unbounded_string_list is begin return type_of(obj.all); end type_of; procedure Build_Attributes_XML_String(obj : in Poisson_Task; result : in out Unbounded_String) is begin Build_Attributes_XML_String(Periodic_Task(obj), result); if (XML_String(obj.seed) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.seed) & to_unbounded_string(""); end if; if (XML_String(obj.predictable) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.predictable) & to_unbounded_string(""); end if; end Build_Attributes_XML_String; function XML_String(obj : in Poisson_Task) 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 Poisson_Task_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 Poisson_Task) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); return (result); end XML_Ref_String; function XML_Ref_String(obj : in Poisson_Task_Ptr) return Unbounded_String is begin return XML_Ref_String(obj.all); end XML_Ref_String; -- --------= Sporadic_Task =-------- procedure Initialize(obj : in out Sporadic_Task) is begin initialize(Poisson_Task(obj)); obj.task_type := Sporadic_Type; end Initialize; function Copy ( obj : in Sporadic_Task ) return Generic_Task_Ptr is New_Sporadic_Task : Sporadic_Task_Ptr; begin New_Sporadic_Task := new Sporadic_Task'(obj); return Generic_Task_Ptr(New_Sporadic_Task); end Copy; function Copy ( obj : in Sporadic_Task_Ptr ) return Generic_Task_Ptr is begin return copy(obj.all); end Copy; procedure Put(obj : in Sporadic_Task) is begin put(Poisson_Task(obj)); end Put; procedure Put(obj : in Sporadic_Task_Ptr) is begin Put(Obj.All); end Put; procedure Put_Name ( obj : in Sporadic_Task_Ptr) is begin Put ( To_String ( Obj.Name ) ); end Put_Name; function Get_Name (obj : in Sporadic_Task) return Unbounded_String is begin return obj.name; end Get_Name; function Get_Name (obj : in Sporadic_Task_ptr) return Unbounded_String is begin return obj.name; end Get_Name; function type_of ( obj : in Sporadic_Task ) 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("OBJECTS.GENERIC_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.NAMED_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.GENERIC_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.PERIODIC_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.POISSON_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.SPORADIC_TASK"); Add (list, s); return list; end type_of; function type_of ( obj : in Sporadic_Task_Ptr ) return unbounded_string_list is begin return type_of(obj.all); end type_of; procedure Build_Attributes_XML_String(obj : in Sporadic_Task; result : in out Unbounded_String) is begin Build_Attributes_XML_String(Poisson_Task(obj), result); end Build_Attributes_XML_String; function XML_String(obj : in Sporadic_Task) 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 Sporadic_Task_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 Sporadic_Task) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); return (result); end XML_Ref_String; function XML_Ref_String(obj : in Sporadic_Task_Ptr) return Unbounded_String is begin return XML_Ref_String(obj.all); end XML_Ref_String; -- --------= Parametric_Task =-------- procedure Initialize(obj : in out Parametric_Task) is begin initialize(Poisson_Task(obj)); obj.activation_rule := empty_string; obj.task_type := Parametric_Type; end Initialize; function Copy ( obj : in Parametric_Task ) return Generic_Task_Ptr is New_Parametric_Task : Parametric_Task_Ptr; begin New_Parametric_Task := new Parametric_Task'(obj); return Generic_Task_Ptr(New_Parametric_Task); end Copy; function Copy ( obj : in Parametric_Task_Ptr ) return Generic_Task_Ptr is begin return copy(obj.all); end Copy; procedure Put(obj : in Parametric_Task) is begin put(Poisson_Task(obj)); put("activation_rule: "); put(obj.activation_rule); put ( "; " ); end Put; procedure Put(obj : in Parametric_Task_Ptr) is begin Put(Obj.All); end Put; procedure Put_Name ( obj : in Parametric_Task_Ptr) is begin Put ( To_String ( Obj.Name ) ); end Put_Name; function Get_Name (obj : in Parametric_Task) return Unbounded_String is begin return obj.name; end Get_Name; function Get_Name (obj : in Parametric_Task_ptr) return Unbounded_String is begin return obj.name; end Get_Name; function type_of ( obj : in Parametric_Task ) 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("OBJECTS.GENERIC_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.NAMED_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.GENERIC_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.PERIODIC_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.POISSON_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.PARAMETRIC_TASK"); Add (list, s); return list; end type_of; function type_of ( obj : in Parametric_Task_Ptr ) return unbounded_string_list is begin return type_of(obj.all); end type_of; procedure Build_Attributes_XML_String(obj : in Parametric_Task; result : in out Unbounded_String) is begin Build_Attributes_XML_String(Poisson_Task(obj), result); if (XML_String(obj.activation_rule) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.activation_rule) & to_unbounded_string(""); end if; end Build_Attributes_XML_String; function XML_String(obj : in Parametric_Task) 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 Parametric_Task_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 Parametric_Task) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); return (result); end XML_Ref_String; function XML_Ref_String(obj : in Parametric_Task_Ptr) return Unbounded_String is begin return XML_Ref_String(obj.all); end XML_Ref_String; -- --------= Scheduling_Task =-------- procedure Initialize(obj : in out Scheduling_Task) is begin initialize(Poisson_Task(obj)); obj.task_type := Scheduling_Task_type; end Initialize; function Copy ( obj : in Scheduling_Task ) return Generic_Task_Ptr is New_Scheduling_Task : Scheduling_Task_Ptr; begin New_Scheduling_Task := new Scheduling_Task'(obj); return Generic_Task_Ptr(New_Scheduling_Task); end Copy; function Copy ( obj : in Scheduling_Task_Ptr ) return Generic_Task_Ptr is begin return copy(obj.all); end Copy; procedure Put(obj : in Scheduling_Task) is begin put(Poisson_Task(obj)); end Put; procedure Put(obj : in Scheduling_Task_Ptr) is begin Put(Obj.All); end Put; procedure Put_Name ( obj : in Scheduling_Task_Ptr) is begin Put ( To_String ( Obj.Name ) ); end Put_Name; function Get_Name (obj : in Scheduling_Task) return Unbounded_String is begin return obj.name; end Get_Name; function Get_Name (obj : in Scheduling_Task_ptr) return Unbounded_String is begin return obj.name; end Get_Name; function type_of ( obj : in Scheduling_Task ) 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("OBJECTS.GENERIC_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.NAMED_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.GENERIC_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.PERIODIC_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.POISSON_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.SCHEDULING_TASK"); Add (list, s); return list; end type_of; function type_of ( obj : in Scheduling_Task_Ptr ) return unbounded_string_list is begin return type_of(obj.all); end type_of; procedure Build_Attributes_XML_String(obj : in Scheduling_Task; result : in out Unbounded_String) is begin Build_Attributes_XML_String(Poisson_Task(obj), result); end Build_Attributes_XML_String; function XML_String(obj : in Scheduling_Task) 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 Scheduling_Task_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 Scheduling_Task) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); return (result); end XML_Ref_String; function XML_Ref_String(obj : in Scheduling_Task_Ptr) return Unbounded_String is begin return XML_Ref_String(obj.all); end XML_Ref_String; -- --------= Frame_Task =-------- procedure Initialize(obj : in out Frame_Task) is begin initialize(Periodic_Task(obj)); obj.interarrival := 0; obj.task_type := Frame_Task_type; end Initialize; function Copy ( obj : in Frame_Task ) return Generic_Task_Ptr is New_Frame_Task : Frame_Task_Ptr; begin New_Frame_Task := new Frame_Task'(obj); return Generic_Task_Ptr(New_Frame_Task); end Copy; function Copy ( obj : in Frame_Task_Ptr ) return Generic_Task_Ptr is begin return copy(obj.all); end Copy; procedure Put(obj : in Frame_Task) is begin put(Periodic_Task(obj)); put("interarrival: "); standards_io.natural_io.put(obj.interarrival); put ( "; " ); end Put; procedure Put(obj : in Frame_Task_Ptr) is begin Put(Obj.All); end Put; procedure Put_Name ( obj : in Frame_Task_Ptr) is begin Put ( To_String ( Obj.Name ) ); end Put_Name; function Get_Name (obj : in Frame_Task) return Unbounded_String is begin return obj.name; end Get_Name; function Get_Name (obj : in Frame_Task_ptr) return Unbounded_String is begin return obj.name; end Get_Name; function type_of ( obj : in Frame_Task ) 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("OBJECTS.GENERIC_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("OBJECTS.NAMED_OBJECT"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.GENERIC_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.PERIODIC_TASK"); Add (list, s); s := new unbounded_string; s.all := to_unbounded_string("TASKS.FRAME_TASK"); Add (list, s); return list; end type_of; function type_of ( obj : in Frame_Task_Ptr ) return unbounded_string_list is begin return type_of(obj.all); end type_of; procedure Build_Attributes_XML_String(obj : in Frame_Task; result : in out Unbounded_String) is begin Build_Attributes_XML_String(Periodic_Task(obj), result); if (XML_String(obj.interarrival) /= Empty_String) then result := result & to_unbounded_string("") & XML_String(obj.interarrival) & to_unbounded_string(""); end if; end Build_Attributes_XML_String; function XML_String(obj : in Frame_Task) 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 Frame_Task_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 Frame_Task) return Unbounded_String is result : Unbounded_String; begin result := to_unbounded_string(""); return (result); end XML_Ref_String; function XML_Ref_String(obj : in Frame_Task_Ptr) return Unbounded_String is begin return XML_Ref_String(obj.all); end XML_Ref_String; End Tasks;