1 -- Copyright (c) 1998-1999 Matra Datavision
2 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
4 -- The content of this file is subject to the Open CASCADE Technology Public
5 -- License Version 6.5 (the "License"). You may not use the content of this file
6 -- except in compliance with the License. Please obtain a copy of the License
7 -- at http://www.opencascade.org and read it completely before using this file.
9 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 -- The Original Code and all software distributed under the License is
13 -- distributed on an "AS IS" basis, without warranty of any kind, and the
14 -- Initial Developer hereby disclaims all such warranties, including without
15 -- limitation, any warranties of merchantability, fitness for a particular
16 -- purpose or non-infringement. Please see the License for the specific terms
17 -- and conditions governing the rights and limitations under the License.
19 generic class HArray1 from TCollection
21 TheArray1 as Array1 from TCollection(ItemHArray1))
25 raises RangeError from Standard,
26 DimensionMismatch from Standard,
27 OutOfRange from Standard,
28 OutOfMemory from Standard
30 ---Purpose: The class HArray1 represents unidimensionnal arrays
31 -- of fixed size dynamically dimensioned at construction time.
32 -- As with a C array, the access time to an HArray1 indexed
33 -- item is constant and is independent of the array size.
34 -- Arrays are commonly used as elementary data structures
35 -- for more complex objects.
36 -- HArray1 objects are handles to arrays.
37 -- - HArray1 arrays may be shared by several objects.
38 -- - You may use a TCollection_Array1 structure to have the actual array.
39 -- HArray1 is a generic class which depends on two parameters:
40 -- - Item, the type of element in the array,
41 -- - Array, the actual type of array handled by HArray1.
42 -- This is an instantiation with Item of the
43 -- TCollection_Array1 generic class.
45 -- HArray1 indexes start and end at a user-defined position.
46 -- Thus, when accessing an item, you must base the index on
47 -- the lower and upper bounds of the array.
53 Create (Low, Up: Integer from Standard)
54 returns mutable HArray1 from TCollection
55 ---Purpose: Creates an array of lower bound <Low> and upper
56 -- bound <Up>. Range error is raised when <Up> is less than <Low>.
58 RangeError from Standard,
59 OutOfMemory from Standard;
61 Create (Low, Up: Integer from Standard; V : ItemHArray1)
62 returns mutable HArray1 from TCollection
63 ---Purpose: Creates an array of lower bound <Low> and upper
64 -- bound <Up>. Range error is raised when <Up> is less than <Low>.
66 RangeError from Standard,
67 OutOfMemory from Standard;
69 Init(me : mutable; V : ItemHArray1);
70 ---Purpose: Initialize the array with the value <V>
72 Length (me) returns Integer from Standard
74 ---Purpose: Returns the number of elements of <me>.
78 Lower (me) returns Integer from Standard
80 ---Purpose: Returns the lower bound.
84 Upper (me) returns Integer from Standard
86 ---Purpose: Returns the upper bound.
91 SetValue (me : mutable; Index: Integer from Standard; Value: ItemHArray1)
93 ---Purpose: Assigns the value <Value> to the <Index>th item of this array.
95 OutOfRange from Standard
100 Value (me; Index:Integer from Standard) returns any ItemHArray1
102 ---Purpose: Returns the value of the <Index>th element of the array.
104 ---C++: return const &
106 OutOfRange from Standard
109 ChangeValue (me : mutable; Index:Integer from Standard) returns any
112 ---Purpose: Returns the value of the <Index>th element of the array.
116 OutOfRange from Standard
119 Array1(me) returns TheArray1
120 ---Purpose: Returns the Array array used as a field by this array;
121 -- the returned array is not modifiable;
122 ---C++: return const &
126 ChangeArray1(me : mutable) returns TheArray1
127 ---Purpose: Returns a modifiable reference on the Array array
128 -- used as a field by this array, in order to modify it.