0024742: Remove rarely used collection classes: SList
[occt.git] / src / TopLoc / TopLoc_SListOfItemLocation.cdl
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
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
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.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 private class SListOfItemLocation from TopLoc
18
19         ---Purpose: An SListOfItemLocation is a LISP like list of Items.
20         -- An SListOfItemLocation is :
21         --   . Empty.
22         --   . Or it has a Value and a  Tail  which is an other SListOfItemLocation. 
23         -- 
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.
30         -- 
31         -- SListOfItemLocation Iterator;
32         -- for (Iterator = S; Iterator.More(); Iterator.Next())
33         --   X = Iterator.Value();
34         -- 
35         --  Memory usage  is  automatically managed for  SListOfItemLocations
36         --  (using reference counts).
37         ---Example:
38         -- If S1 and S2 are SListOfItemLocations :
39         -- if S1.Value() is X.
40         -- 
41         -- And the following is done :
42         -- S2 = S1;
43         -- S2.SetValue(Y);
44         -- 
45         -- S1.Value() becomes also Y.   So SListOfItemLocation must be used
46         -- with   care.  Mainly  the SetValue()    method  is
47         -- dangerous. 
48
49 uses
50     SListNodeOfItemLocation from TopLoc,
51     ItemLocation            from TopLoc
52     
53 raises
54     NoSuchObject from Standard
55
56 is
57     Create returns SListOfItemLocation from TopLoc;
58         ---Purpose: Creates an empty List.
59         
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.
63         
64     Create(Other : SListOfItemLocation from TopLoc)
65     returns SListOfItemLocation from TopLoc;
66         ---Purpose: Creates a list from an other one. The lists  are shared. 
67         
68     Assign(me : in out; Other : SListOfItemLocation from TopLoc)
69     returns SListOfItemLocation from TopLoc
70         ---Level: Public
71         ---Purpose: Sets  a list  from  an  other  one. The  lists are
72         -- shared. The list itself is returned.
73         ---C++: alias operator =
74         ---C++: return &
75     is static;
76     
77     IsEmpty(me) returns Boolean
78         ---Level: Public
79         ---C++: inline
80     is static;
81     
82     Clear(me : in out)
83         ---Level: Public
84         ---Purpose: Sets the list to be empty.
85         ---C++: alias ~
86     is static;
87         
88     Value(me) returns any ItemLocation from TopLoc
89         ---Level: Public
90         ---Purpose: Returns the current value of the list. An error is
91         -- raised  if the list is empty.
92         ---C++: return const &
93     raises
94         NoSuchObject from Standard
95     is static;
96     
97     ChangeValue(me : in out) returns any ItemLocation from TopLoc
98         ---Level: Public
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()
104         ---C++: return &
105     raises
106         NoSuchObject from Standard
107     is static;
108     
109     SetValue(me : in out; anItem : ItemLocation from TopLoc)
110         ---Level: Public
111         ---Purpose: Changes the current value in the list. An error is
112         -- raised if the list is empty.
113     raises
114         NoSuchObject from Standard
115     is static;
116     
117     Tail(me) returns SListOfItemLocation from TopLoc
118         ---Level: Public
119         ---Purpose: Returns the current tail of  the list. On an empty
120         -- list the tail is the list itself.
121         ---C++: return const &
122     is static;
123     
124     ChangeTail(me : in out) returns SListOfItemLocation from TopLoc
125         ---Level: Public
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()
130         ---C++: return &
131     is static;
132     
133     SetTail(me : in out; aList : SListOfItemLocation from TopLoc)
134         ---Level: Public
135         ---Purpose: Changes the current tail  in the list. On an empty
136         -- list SetTail is Assign.
137     is static;
138     
139     Construct(me : in out; anItem : ItemLocation from TopLoc)  
140         ---Level: Public
141         ---Purpose: Replaces the list by a list with <anItem> as Value
142         -- and the  list <me> as  tail.
143         ---C++: inline
144     is static;
145     
146     Constructed(me; anItem : ItemLocation from TopLoc) returns SListOfItemLocation from TopLoc
147         ---Level: Public
148         ---Purpose: Returns a new list  with  <anItem> as Value an the
149         -- list <me> as tail.
150         ---C++: inline
151     is static;
152     
153     ToTail(me :  in out)
154         ---Level: Public
155         ---Purpose: Replaces the list <me> by its tail.
156         ---C++: inline
157     is static;
158         
159     Initialize(me : in out; aList : SListOfItemLocation from TopLoc)
160         ---Level: Public
161         ---Purpose: Sets  the iterator  to iterate   on the content of
162         -- <aList>. This is Assign().
163         ---C++: inline
164     is static;
165     
166     More(me) returns Boolean
167         ---Level: Public
168         ---Purpose: Returns True if the iterator  has a current value.
169         -- This is !IsEmpty()
170         ---C++: inline
171     is static;
172     
173     Next(me : in out)
174         ---Level: Public
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()
177         ---C++: inline
178     is static;
179     
180 fields
181     myNode : SListNodeOfItemLocation from TopLoc;
182
183 end SListOfItemLocation;