Yurttas/PL/IL/Ada-95/F/03/02/01/buffer queue 00.adb

 1--
 2-- Copyright(C) 1998
 3-- All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4--
 5-- Permission to use, copy, modify, and distribute this
 6-- software and its documentation for EDUCATIONAL purposes
 7-- and without fee is hereby granted provided that this
 8-- copyright notice appears in all copies.
 9--
10 
11-- date   : January 1, 1998.
12-- author : Salih Yurttas.
13
14-- purpose : buffered solution of queues.
15
16-- buffer_queue_00.adb
17
18
19with Ada.Text_IO;
20use Ada.Text_IO;
21
22with Buffer_Queue_P;
23
24procedure Buffer_Queue_00 is
25
26  package Int_IO is new Integer_IO(Integer);
27  use Int_IO;
28
29  package B_Queue is new Buffer_Queue_P(Items=> Integer);
30  use B_Queue;
31
32  Item : Integer;
33
34begin
35
36  Put("--> Item : ");
37  Get(Item);
38  Skip_Line;
39
40  Buffer_Queue.Insert(Item);
41
42  New_Line;
43  Put("--> Item : ");
44  Get(Item);
45  Skip_Line;
46
47  Buffer_Queue.Insert(Item);
48
49  Buffer_Queue.Remove(Item);
50
51  Put(Item);
52  New_Line(2);
53
54  New_Line;
55  Put("--> Item : ");
56  Get(Item);
57  Skip_Line;
58
59  Buffer_Queue.Insert(Item);
60
61  Buffer_Queue.Remove(Item);
62
63  Put(Item);
64  New_Line(2);
65
66end Buffer_Queue_00;