0024830: Remove redundant keyword 'mutable' in CDL declarations
[occt.git] / src / Interface / Interface_IntList.cdl
CommitLineData
b311480e 1-- Created on: 1995-05-12
2-- Created by: Christian CAILLET
3-- Copyright (c) 1995-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
17class IntList from Interface
18
19 ---Purpose : This class detains the data which describe a Graph. A Graph
20 -- has two lists, one for shared refs, one for sharing refs
21 -- (the reverses). Each list comprises, for each Entity of the
22 -- Model of the Graph, a list of Entities (shared or sharing).
23 -- In fact, entities are identified by their numbers in the Model
24 -- or Graph : this gives better performances.
25 --
26 -- A simple way to implement this is to instantiate a HArray1
27 -- with a HSequenceOfInteger : each Entity Number designates a
28 -- value, which is a Sequence (if it is null, it is considered as
29 -- empty : this is a little optimisation).
30 --
31 -- This class gives a more efficient way to implement this.
32 -- It has two lists (two arrays of integers), one to describe
33 -- list (empty, one value given immediately, or negated index in
34 -- the second list), one to store refs (pointed from the first
35 -- list). This is much more efficient than a list of sequences,
36 -- in terms of speed (especially for read) and of memory
37 --
38 -- An IntList can also be set to access data for a given entity
39 -- number, it then acts as a single sequence
40 --
41 -- Remark that if an IntList is created from another one, it can
42 -- be read, but if it is created without copying, it may not be
43 -- edited
44
45uses HArray1OfInteger
46
47is
48 Create returns IntList;
49 ---Purpose :Creates empty IntList.
50
51
52
53 Create (nbe : Integer) returns IntList;
54 ---Purpose : Creates an IntList for <nbe> entities
55
56 Create (other : IntList; copied : Boolean) returns IntList;
57 ---Purpose : Creates an IntList from another one.
58 -- if <copied> is True, copies data
59 -- else, data are not copied, only the header object is
60 Initialize(me : in out;nbe : Integer);
61 ---Purpose :Initialize IntList by number of entities.
6e33d3ce 62 Internals (me; nbrefs : out Integer; ents, refs : out HArray1OfInteger);
7fd59977 63 ---Purpose : Returns internal values, used for copying
64
65 NbEntities (me) returns Integer;
66 ---Purpose : Returns count of entities to be aknowledged
67
68 SetNbEntities (me : in out; nbe : Integer);
69 ---Purpose : Changes the count of entities (ignored if decreased)
70
71 SetNumber (me : in out; number : Integer);
72 ---Purpose : Sets an entity number as current (for read and fill)
73
74 Number (me) returns Integer;
75 ---Purpose : Returns the current entity number
76
77 List (me; number : Integer; copied : Boolean = Standard_False) returns IntList;
78 ---Purpose : Returns an IntList, identical to <me> but set to a specified
79 -- entity Number
80 -- By default, not copied (in order to be read)
81 -- Specified <copied> to produce another list and edit it
82
83 SetRedefined (me : in out; mode : Boolean);
84 ---Purpose : Sets current entity list to be redefined or not
85 -- This is used in a Graph for redefinition list : it can be
86 -- disable (no redefinition, i.e. list is cleared), or enabled
87 -- (starts as empty). The original list has not to be "redefined"
88
89 Reservate (me : in out; count : Integer);
90 ---Purpose : Makes a reservation for <count> references to be later
91 -- attached to the current entity. If required, it increases
92 -- the size of array used to store refs. Remark that if count is
93 -- less than two, it does nothing (because immediate storing)
94
95 Add (me : in out; ref : Integer);
96 ---Purpose : Adds a reference (as an integer value, an entity number) to
97 -- the current entity number. Zero is ignored
98
99 Length (me) returns Integer;
100 ---Purpose : Returns the count of refs attached to current entity number
101
102 IsRedefined (me; num : Integer = 0) returns Boolean;
103 ---Purpose : Returns True if the list for a number (default is taken as
104 -- current) is "redefined" (usefull for empty list)
105
106 Value (me; num : Integer) returns Integer;
107 ---Purpose : Returns a reference number in the list for current number,
108 -- according to its rank
109
110 Remove (me : in out; num : Integer) returns Boolean;
111 ---Purpose : Removes an item in the list for current number, given its rank
112 -- Returns True if done, False else
113
114 Clear (me : in out);
115 ---Purpose : Clears all data, hence each entity number has an empty list
116
117 AdjustSize (me : in out; margin : Integer = 0);
118 ---Purpose : Resizes lists to exact sizes. For list of refs, a positive
119 -- margin can be added.
120
121fields
122
123 thenbe : Integer;
124 thenbr : Integer;
125 thenum : Integer; -- for current entity number :
126 thecount : Integer;
127 therank : Integer;
128 theents : HArray1OfInteger;
129 therefs : HArray1OfInteger;
130
131end IntList;