1 -- Created on: 2000-05-26
2 -- Created by: Peter KURNEV
3 -- Copyright (c) 2000-2014 OPEN CASCADE SAS
5 -- This file is part of Open CASCADE Technology software library.
7 -- This library is free software; you can redistribute it and / or modify it
8 -- under the terms of the GNU Lesser General Public version 2.1 as published
9 -- by the Free Software Foundation, with special exception defined in the file
10 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 -- distribution for complete text of the license and disclaimer of any warranty.
13 -- Alternatively, this file may be used under the terms of Open CASCADE
14 -- commercial license or contractual agreement.
18 generic class CArray1 from IntTools (Array1Item as any)
20 ---Purpose: The class CArray1 represents unidimensionnal arrays
21 -- of fixed size known at run time. Run-time boundary
24 -- The range of the index is user defined from 0 to Length
28 ConstructionError from Standard,
29 OutOfRange from Standard,
30 OutOfMemory from Standard
34 Create (Length: Integer from Standard = 0)
35 returns CArray1 from IntTools
37 --- Creates an array of given Length.
40 ConstructionError from Standard, -- when Length < 0
41 OutOfMemory from Standard; -- when not enough memory
43 Create (AnArray : CArray1 from IntTools)
44 returns CArray1 from IntTools
46 --- Prohibits the creator by copy
50 Create(Item: Array1Item;
51 Length: Integer from Standard)
53 --- Creates an array sharing datas with an other.
56 --- CArray1OfItem thetab (tab[0],100);
58 --- CArray1OfItem aArray1(100);
59 --- CArray1OfItem anSharedArray1(aArray1.ChangeValue(0),aArray1.Length());
62 --- The validity of length are under the responsability
64 --- The sahred array must have a valid address during the life of
67 returns CArray1 from IntTools
68 raises ConstructionError from Standard; -- when Length < 0
70 Init (me: in out; V: Array1Item);
72 --- Initializes the array with a given value.
77 theNewLength: Integer from Standard);
79 --- destroy current content and realloc the new size
80 --- does nothing if Length() == theLength
85 --- Frees the allocated area corresponding to the
90 Length (me) returns Integer from Standard;
92 --- Returns the number of elements of <me>.
96 Append (me:out; Value: Array1Item);
99 SetValue (me : out; Index: Integer from Standard; Value: Array1Item)
100 raises OutOfRange from Standard;
102 --- Sets the <Index>th element of the array to
107 Value (me; Index:Integer from Standard) returns any Array1Item
109 --- Returns the value of the <Index>th element of the
112 ---C++: alias operator ()
113 ---C++: return const &
114 raises OutOfRange from Standard;
116 ChangeValue (me: in out; Index:Integer from Standard) returns any Array1Item
118 --- Returns the value of the <Index>th element of the
121 ---C++: alias operator ()
123 raises OutOfRange from Standard;
125 IsEqual(me; Other: CArray1 from IntTools)
126 returns Boolean from Standard;
128 --- Applys the == operator on each array item
130 ---C++: alias operator ==
136 myIsAllocated: Boolean;