1 -- Created on: 2000-05-26
2 -- Created by: Peter KURNEV
3 -- Copyright (c) 2000-2012 OPEN CASCADE SAS
5 -- The content of this file is subject to the Open CASCADE Technology Public
6 -- License Version 6.5 (the "License"). You may not use the content of this file
7 -- except in compliance with the License. Please obtain a copy of the License
8 -- at http://www.opencascade.org and read it completely before using this file.
10 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 -- The Original Code and all software distributed under the License is
14 -- distributed on an "AS IS" basis, without warranty of any kind, and the
15 -- Initial Developer hereby disclaims all such warranties, including without
16 -- limitation, any warranties of merchantability, fitness for a particular
17 -- purpose or non-infringement. Please see the License for the specific terms
18 -- and conditions governing the rights and limitations under the License.
24 generic class CArray1 from IntTools (Array1Item as any)
26 ---Purpose: The class CArray1 represents unidimensionnal arrays
27 -- of fixed size known at run time. Run-time boundary
30 -- The range of the index is user defined from 0 to Length
34 ConstructionError from Standard,
35 OutOfRange from Standard,
36 OutOfMemory from Standard
40 Create (Length: Integer from Standard = 0)
41 returns CArray1 from IntTools
43 --- Creates an array of given Length.
46 ConstructionError from Standard, -- when Length < 0
47 OutOfMemory from Standard; -- when not enough memory
49 Create (AnArray : CArray1 from IntTools)
50 returns CArray1 from IntTools
52 --- Prohibits the creator by copy
56 Create(Item: Array1Item;
57 Length: Integer from Standard)
59 --- Creates an array sharing datas with an other.
62 --- CArray1OfItem thetab (tab[0],100);
64 --- CArray1OfItem aArray1(100);
65 --- CArray1OfItem anSharedArray1(aArray1.ChangeValue(0),aArray1.Length());
68 --- The validity of length are under the responsability
70 --- The sahred array must have a valid address during the life of
73 returns CArray1 from IntTools
74 raises ConstructionError from Standard; -- when Length < 0
76 Init (me: in out; V: Array1Item);
78 --- Initializes the array with a given value.
83 theNewLength: Integer from Standard);
85 --- destroy current content and realloc the new size
86 --- does nothing if Length() == theLength
91 --- Frees the allocated area corresponding to the
96 Length (me) returns Integer from Standard;
98 --- Returns the number of elements of <me>.
102 Append (me:out; Value: Array1Item);
105 SetValue (me : out; Index: Integer from Standard; Value: Array1Item)
106 raises OutOfRange from Standard;
108 --- Sets the <Index>th element of the array to
113 Value (me; Index:Integer from Standard) returns any Array1Item
115 --- Returns the value of the <Index>th element of the
118 ---C++: alias operator ()
119 ---C++: return const &
120 raises OutOfRange from Standard;
122 ChangeValue (me: in out; Index:Integer from Standard) returns any Array1Item
124 --- Returns the value of the <Index>th element of the
127 ---C++: alias operator ()
129 raises OutOfRange from Standard;
131 IsEqual(me; Other: CArray1 from IntTools)
132 returns Boolean from Standard;
134 --- Applys the == operator on each array item
136 ---C++: alias operator ==
142 myIsAllocated: Boolean;