Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
25
Task/Queue-Definition/Ada/queue-definition-5.adb
Normal file
25
Task/Queue-Definition/Ada/queue-definition-5.adb
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