b311480e |
1 | -- Created on: 1993-03-02 |
2 | -- Created by: Remi LEQUETTE |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | generic class HSet from TCollection |
18 | (Item as any; |
19 | TheSet as any) -- as Set from TCollection(Item)) |
20 | inherits TShared from MMgt |
21 | |
22 | ---Purpose: An HSet is a collection of non-ordered items without any |
23 | -- duplicates. At each transaction, the system checks there are no duplicates. |
24 | -- HSet objects are handles to sets. |
25 | -- HSet is a generic class which depends on two parameters: |
26 | -- - Item, the type of element in the set, |
27 | -- - Set, the actual type of set handled by HSet. This is an |
28 | -- instantiation with TCollection_Set generic class. |
29 | |
30 | is |
31 | |
32 | Create returns mutable HSet from TCollection; |
33 | ---Purpose: Construction of an empty set. |
34 | |
35 | Extent(me) returns Integer from Standard |
36 | ---Level: Public |
37 | ---Purpose: Returns the number of items in the set me. |
38 | ---C++: inline |
39 | is static; |
40 | |
41 | IsEmpty(me) returns Boolean from Standard |
42 | ---Level: Public |
43 | ---Purpose: Returns True if the set <me> is empty, Extent == 0. |
44 | ---C++: inline |
45 | is static; |
46 | |
47 | Clear(me : mutable) |
48 | ---Level: Public |
49 | ---Purpose: Removes all the items from the set. |
50 | ---C++: inline |
51 | is static; |
52 | |
53 | |
54 | Add(me : mutable; T : Item) returns Boolean from Standard |
55 | ---Level: Public |
56 | ---Purpose: Adds <T> to the set if this item does not |
57 | -- already exist. Returns False if <T> was |
58 | -- already in the set. |
59 | ---Example: |
60 | -- before |
61 | -- me = {a,b,c,d}, T = y |
62 | -- after |
63 | -- me = {a,b,c,d,y} returns True |
64 | ---C++: inline |
65 | is static; |
66 | |
67 | Remove(me : mutable; T : Item) returns Boolean from Standard |
68 | ---Level: Public |
69 | ---Purpose: Removes <T> from the set and returns True. |
70 | -- Returns False if <T> was not in the set. |
71 | ---Example: |
72 | -- before |
73 | -- me = {a,b,c,d}, T = a |
74 | -- after |
75 | -- me = {b,c,d} returns True |
76 | ---C++: inline |
77 | is static; |
78 | |
79 | Union(me; B : HSet from TCollection) |
80 | returns mutable HSet from TCollection |
81 | ---Purpose: creation of a set containing all the items |
82 | -- of the set <me> and all the items of the set B |
83 | -- which are not in <me>. |
84 | ---Example: |
85 | -- before |
86 | -- me = {a,b,c}, B = {d,a,f} |
87 | -- after |
88 | -- me = {a,b,c}, B = {d,a,f} |
89 | -- returns |
90 | -- {a,b,c,d,f} |
91 | is static; |
92 | |
93 | Intersection(me; B : HSet from TCollection) |
94 | returns mutable HSet from TCollection |
95 | ---Level: Public |
96 | ---Purpose: Creation of a set containing all the |
97 | -- items which are both in the set <me> and in the set B |
98 | ---Example: |
99 | -- before |
100 | -- me = {a,b,c}, B = {d,a,f} |
101 | -- after |
102 | -- me = {a,b,c}, B = {d,a,f} |
103 | -- returns |
104 | -- {a} |
105 | is static; |
106 | |
107 | Difference(me; B: HSet from TCollection) |
108 | returns mutable HSet from TCollection |
109 | ---Purpose: Compares set B with this set and deletes duplicates. |
110 | --Example: |
111 | -- before |
112 | -- me = {a,b,c}, B = {d,a,f} |
113 | -- after |
114 | -- me = {a,b,c}, B = {d,a,f} |
115 | -- returns |
116 | -- {b,c} |
117 | is static; |
118 | |
119 | |
120 | Contains(me; T : Item) returns Boolean from Standard |
121 | ---Purpose: Returns True if an item is in the set me. |
122 | ---C++: inline |
123 | is static; |
124 | |
125 | IsASubset(me; S : HSet from TCollection) returns Boolean from Standard |
126 | ---Purpose: Returns True if a set is contained in the set me. |
127 | -- The two sets can be identical. |
128 | ---C++: inline |
129 | is static; |
130 | |
131 | IsAProperSubset(me; S : HSet from TCollection) |
132 | returns Boolean from Standard |
133 | ---Purpose: Returns True S is a subset and if all its elements are strictly included in this set. |
134 | -- The two sets cannot be identical. |
135 | ---C++: inline |
136 | is static; |
7fd59977 |
137 | |
138 | Set(me) returns TheSet |
139 | ---Level: Advanced |
140 | ---Purpose: Returns the internal set. For implementation. |
141 | ---C++: inline |
142 | ---C++: return const & |
143 | is static; |
144 | |
145 | ChangeSet(me : mutable) returns TheSet |
146 | ---Level: Advanced |
147 | ---Purpose: Returns the internal set. For implementation. |
148 | ---C++: inline |
149 | ---C++: return & |
150 | is static; |
151 | |
152 | fields |
153 | mySet : TheSet; |
154 | |
155 | end HSet from TCollection; |