tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
25
Task/Queue-Definition/Ada/queue-definition-5.ada
Normal file
25
Task/Queue-Definition/Ada/queue-definition-5.ada
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package body Generic_Fifo is
|
||||
|
||||
----------
|
||||
-- Push --
|
||||
----------
|
||||
|
||||
procedure Push (The_Fifo : in out Fifo_Type; Item : in Element_Type) is
|
||||
begin
|
||||
The_Fifo.Prepend(Item);
|
||||
end Push;
|
||||
|
||||
---------
|
||||
-- Pop --
|
||||
---------
|
||||
|
||||
procedure Pop (The_Fifo : in out Fifo_Type; Item : out Element_Type) is
|
||||
begin
|
||||
if Is_Empty(The_Fifo) then
|
||||
raise Empty_Error;
|
||||
end if;
|
||||
Item := The_Fifo.Last_Element;
|
||||
The_Fifo.Delete_Last;
|
||||
end Pop;
|
||||
|
||||
end Generic_Fifo;
|
||||
Loading…
Add table
Add a link
Reference in a new issue