1 -- Created on: 1993-02-10
2 -- Created by: Mireille MERCIEN
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 generic class HQueue from PCollection (Item as Storable)
20 ---Purpose: A queue is a sequence of items in which items
21 -- are added at one end (called the back of the
22 -- queue) and removed at the other end (called
24 -- The Queue is empty if there are no elements.
26 raises NoSuchObject from Standard
29 class QueueNode instantiates HSingleList from PCollection(Item);
31 class QueueIterator from PCollection
33 ---Purpose: Iterator of the class Queue.
35 raises NoMoreObject from Standard,
36 NoSuchObject from Standard
39 Create(Q : HQueue from PCollection)
40 returns QueueIterator from PCollection;
41 ---Purpose: Creates an iterator on the queue Q.
42 -- Sets the iterator at the beginning of the Queue Q.
44 More(me) returns Boolean from Standard;
46 ---Purpose: Returns True if there are other items.
48 Next(me: in out) raises NoMoreObject from Standard;
50 ---Purpose: Sets the iterator to the next item.
52 Value(me) returns any Item raises NoSuchObject from Standard;
54 ---Purpose: Returns the item value corresponding to
55 -- the current position of the iterator.
58 TheIterator : QueueNode;
63 Create returns mutable HQueue from PCollection;
64 ---Purpose: Creates an empty queue.
66 Length(me) returns Integer from Standard;
68 ---Purpose: Returns the number of items in the queue.
73 IsEmpty(me) returns Boolean from Standard;
75 ---Purpose: Returns True if the queue contains no element.
77 Front(me) returns any Item raises NoSuchObject from Standard;
79 ---Purpose: Returns the item at the front of the queue.
80 -- Raises an exception if the queue is empty.
88 FFront(me) returns QueueNode;
90 ---Purpose: Returns the field TheFront(the front of the queue).
92 FBack(me) returns QueueNode;
94 ---Purpose: Returns the field Theback(the back of the queue).
98 ---Purpose: Removes all the elements from the queue
104 Push(me : mutable; T : Item);
106 ---Purpose: Inserts an item at the back of the queue.
108 -- me = (A B) , T = C
112 Pop(me : mutable) raises NoSuchObject from Standard;
114 ---Purpose: Removes an item from the front of the queue.
115 -- Raises an exception if the queue is empty
123 ChangeFront(me:mutable ; T : Item) raises NoSuchObject from Standard;
125 ---Purpose: Replaces the front element of the queue with T.
126 -- Raises an exception if the queue is empty.
128 -- me = (A B C) , T = D
133 returns mutable like me
136 ---C++: function call
139 ShallowDump (me; s: in out OStream)
142 ---C++: function call
145 Destroy(me : mutable);
149 TheFront : QueueNode;
151 TheLength : Integer from Standard;