1 -- Created on: 1992-09-11
2 -- Created by: Mireille MERCIEN
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
23 class BaseSequence from TCollection
25 ---Purpose: Definition of a base class for all instanciations
28 -- The methods : Clear, Remove accepts a pointer to a
29 -- function to use to delete the nodes. This allow
30 -- proper call of the destructor on the Items.
31 -- Without adding a virtual function pointer to each
32 -- node or each sequence.
36 NoSuchObject from Standard,
37 OutOfRange from Standard
41 Create returns BaseSequence is protected;
42 ---Purpose: Creation of an empty sequence.
44 Create(Other : BaseSequence) returns BaseSequence from TCollection
45 ---Purpose: Creation by copy of existing Sequence.
46 -- Warning: This constructor prints a warning message.
47 -- We recommand to use the operator =.
50 IsEmpty(me) returns Boolean;
52 ---Purpose: returns True if the sequence <me> contains no elements.
55 Length(me) returns Integer from Standard;
57 ---Purpose: Returns the number of element(s) in the
58 -- sequence. Returns zero if the sequence is empty.
61 Clear(me : in out; DelNode : Address) is protected;
64 PAppend(me : in out; Node : Address)
67 PAppend(me : in out; S : in out BaseSequence)
69 ---Purpose: Concatenates <S> at the end of <me>.
80 PPrepend(me : in out; Node : Address)
83 PPrepend(me : in out; S : in out BaseSequence)
85 ---Purpose: Concatenates <S> at the beginning of <me>.
89 -- me = (A B C) S = (D E F)
90 -- after me = (D E F A B C)
96 ---Purpose: Reverses the order of items on <me>.
103 PInsertAfter(me : in out; Index : Integer from Standard; Node : Address )
104 raises OutOfRange from Standard
107 PInsertAfter(me : in out; Index : Integer from Standard; S : in out BaseSequence)
108 raises OutOfRange from Standard
110 ---Purpose: Inserts the sequence <S> in <me> after the
111 -- position <Index>. <S> is cleared.
112 -- Raises an exception if the index is out of bound.
115 -- me = (A B C), Index = 3, S = (D E F)
117 -- me = (A B C D E F)
123 Exchange(me : in out; I, J : Integer from Standard)
124 raises OutOfRange from Standard;
126 ---Purpose: Swaps elements which are located at
127 -- positions <I> and <J> in <me>.
128 -- Raises an exception if I or J is out of bound.
131 -- me = (A B C), I = 1, J = 3
136 PSplit(me : in out; Index : Integer from Standard; Sub : in out BaseSequence)
137 raises OutOfRange from Standard
139 ---Purpose: Keeps in <me> the items 1 to <Index>-1 and
140 -- puts in <Sub> the items <Index> to the end.
143 -- me = (A B C D) ,Index = 3
149 Remove(me : in out; Index : Integer from Standard; DelNode : Address)
150 raises OutOfRange from Standard
153 Remove(me : in out; FromIndex, ToIndex : Integer from Standard; DelNode : Address)
154 raises OutOfRange from Standard
157 Find(me; Index : Integer from Standard) returns Address from Standard
159 ---Purpose: Returns the node at position <index>.
162 Nullify(me : in out ) is private;
164 ---Purpose: Clear all fields.
168 FirstItem : Address from Standard is protected;
169 LastItem : Address from Standard is protected;
170 CurrentItem : Address from Standard is protected;
171 CurrentIndex : Integer from Standard is protected;
172 Size : Integer from Standard is protected;