1 -- Created on: 1993-02-26
2 -- Created by: Remi LEQUETTE
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 private class SListOfItemLocation from TopLoc
19 ---Purpose: An SListOfItemLocation is a LISP like list of Items.
20 -- An SListOfItemLocation is :
22 -- . Or it has a Value and a Tail which is an other SListOfItemLocation.
24 -- The Tail of an empty list is an empty list.
25 -- SListOfItemLocation are shared. It means that they can be
26 -- modified through other lists.
27 -- SListOfItemLocation may be used as Iterators. They have Next,
28 -- More, and value methods. To iterate on the content
29 -- of the list S just do.
31 -- SListOfItemLocation Iterator;
32 -- for (Iterator = S; Iterator.More(); Iterator.Next())
33 -- X = Iterator.Value();
35 -- Memory usage is automatically managed for SListOfItemLocations
36 -- (using reference counts).
38 -- If S1 and S2 are SListOfItemLocations :
39 -- if S1.Value() is X.
41 -- And the following is done :
45 -- S1.Value() becomes also Y. So SListOfItemLocation must be used
46 -- with care. Mainly the SetValue() method is
50 SListNodeOfItemLocation from TopLoc,
51 ItemLocation from TopLoc
54 NoSuchObject from Standard
57 Create returns SListOfItemLocation from TopLoc;
58 ---Purpose: Creates an empty List.
60 Create(anItem : ItemLocation from TopLoc; aTail : SListOfItemLocation from TopLoc)
61 returns SListOfItemLocation from TopLoc;
62 ---Purpose: Creates a List with <anItem> as value and <aTail> as tail.
64 Create(Other : SListOfItemLocation from TopLoc)
65 returns SListOfItemLocation from TopLoc;
66 ---Purpose: Creates a list from an other one. The lists are shared.
68 Assign(me : in out; Other : SListOfItemLocation from TopLoc)
69 returns SListOfItemLocation from TopLoc
71 ---Purpose: Sets a list from an other one. The lists are
72 -- shared. The list itself is returned.
73 ---C++: alias operator =
77 IsEmpty(me) returns Boolean
84 ---Purpose: Sets the list to be empty.
88 Value(me) returns any ItemLocation from TopLoc
90 ---Purpose: Returns the current value of the list. An error is
91 -- raised if the list is empty.
92 ---C++: return const &
94 NoSuchObject from Standard
97 ChangeValue(me : in out) returns any ItemLocation from TopLoc
99 ---Purpose: Returns the current value of the list. An error is
100 -- raised if the list is empty. This value may be
101 -- modified. A method modifying the value can be
102 -- called. The value will be modified in the list.
103 ---Example: AList.ChangeValue().Modify()
106 NoSuchObject from Standard
109 SetValue(me : in out; anItem : ItemLocation from TopLoc)
111 ---Purpose: Changes the current value in the list. An error is
112 -- raised if the list is empty.
114 NoSuchObject from Standard
117 Tail(me) returns SListOfItemLocation from TopLoc
119 ---Purpose: Returns the current tail of the list. On an empty
120 -- list the tail is the list itself.
121 ---C++: return const &
124 ChangeTail(me : in out) returns SListOfItemLocation from TopLoc
126 ---Purpose: Returns the current tail of the list. This tail
127 -- may be modified. A method modifying the tail can
128 -- be called. The tail will be modified in the list.
129 ---Example: AList.ChangeTail().Modify()
133 SetTail(me : in out; aList : SListOfItemLocation from TopLoc)
135 ---Purpose: Changes the current tail in the list. On an empty
136 -- list SetTail is Assign.
139 Construct(me : in out; anItem : ItemLocation from TopLoc)
141 ---Purpose: Replaces the list by a list with <anItem> as Value
142 -- and the list <me> as tail.
146 Constructed(me; anItem : ItemLocation from TopLoc) returns SListOfItemLocation from TopLoc
148 ---Purpose: Returns a new list with <anItem> as Value an the
149 -- list <me> as tail.
155 ---Purpose: Replaces the list <me> by its tail.
159 Initialize(me : in out; aList : SListOfItemLocation from TopLoc)
161 ---Purpose: Sets the iterator to iterate on the content of
162 -- <aList>. This is Assign().
166 More(me) returns Boolean
168 ---Purpose: Returns True if the iterator has a current value.
169 -- This is !IsEmpty()
175 ---Purpose: Moves the iterator to the next object in the list.
176 -- If the iterator is empty it will stay empty. This is ToTail()
181 myNode : SListNodeOfItemLocation from TopLoc;
183 end SListOfItemLocation;