RosettaCodeData/Task/Queue-Definition/Component-Pascal/queue-definition-2.component

18 lines
416 B
Text
Raw Permalink Normal View History

2013-10-27 22:24:23 +00:00
DEFINITION Queue;
2019-09-12 10:33:56 -07:00
IMPORT Boxes;
2013-10-27 22:24:23 +00:00
2019-09-12 10:33:56 -07:00
TYPE
Instance = POINTER TO LIMITED RECORD
(self: Instance) Capacity (): LONGINT, NEW;
(self: Instance) IsEmpty (): BOOLEAN, NEW;
(self: Instance) IsFull (): BOOLEAN, NEW;
(self: Instance) Pop (): Boxes.Box, NEW;
(self: Instance) Push (b: Boxes.Box), NEW;
(self: Instance) Size (): LONGINT, NEW
END;
2013-10-27 22:24:23 +00:00
2019-09-12 10:33:56 -07:00
PROCEDURE New (capacity: LONGINT): Instance;
2013-10-27 22:24:23 +00:00
END Queue.