Index

Package: Queue_Pack_Simple

Description

package Queue_Pack_Simple is
Uwe R. Zimmer, Australia, 2013

Types

Element

type Element is new Positive range 1_000 .. 40_000;

Marker

type Marker is mod Queue_Size;

List

type List is array (Marker) of Element;

References:

queue_pack_simple.ads:10:9 (declaration)
queue_pack_simple.ads:14:19 (reference)

Queue_Type

type Queue_Type is record
      Top, Free : Marker  := Marker'First;
      Is_Empty  : Boolean := True;
      Elements  : List; -- will be initialized to invalids
   end record;

Constants & Global variables

Queue_Size (Positive)

Queue_Size : constant Positive := 10;

References:

queue_pack_simple.ads:7:4 (declaration)
queue_pack_simple.ads:9:23 (reference)

Subprograms & Entries

Is_Empty

function Is_Empty 
(Queue: Queue_Type) return Boolean is (Queue.Is_Empty);

References:

queue_pack_simple.ads:20:13 (declaration)
queue_test_simple.adb:21:58 (call)

Is_Full

function Is_Full 
(Queue: Queue_Type) return Boolean is (not Queue.Is_Empty and then Queue.Top = Queue.Free);

References:

queue_pack_simple.ads:23:13 (declaration)