1 // Created on: 2000-05-18
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 under
8 // the terms of the GNU Lesser General Public License 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.
16 #ifndef _IntTools_CArray1OfReal_HeaderFile
17 #define _IntTools_CArray1OfReal_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
23 #include <Standard_Address.hxx>
24 #include <Standard_Integer.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Real.hxx>
27 class Standard_ConstructionError;
28 class Standard_OutOfRange;
29 class Standard_OutOfMemory;
33 class IntTools_CArray1OfReal
41 //! Creates an array of given Length.
42 Standard_EXPORT IntTools_CArray1OfReal(const Standard_Integer Length = 0);
45 //! Creates an array sharing datas with an other.
48 //! CArray1OfItem thetab (tab[0],100);
50 //! CArray1OfItem aArray1(100);
51 //! CArray1OfItem anSharedArray1(aArray1.ChangeValue(0),aArray1.Length());
54 //! The validity of length are under the responsability
56 //! The sahred array must have a valid address during the life of
58 Standard_EXPORT IntTools_CArray1OfReal(const Standard_Real& Item, const Standard_Integer Length);
61 //! Initializes the array with a given value.
62 Standard_EXPORT void Init (const Standard_Real& V);
65 //! destroy current content and realloc the new size
66 //! does nothing if Length() == theLength
67 Standard_EXPORT void Resize (const Standard_Integer theNewLength);
70 //! Frees the allocated area corresponding to the
72 Standard_EXPORT void Destroy();
73 ~IntTools_CArray1OfReal()
79 //! Returns the number of elements of <me>.
80 Standard_Integer Length() const;
82 Standard_EXPORT void Append (const Standard_Real& Value);
85 //! Sets the <Index>th element of the array to
87 Standard_EXPORT void SetValue (const Standard_Integer Index, const Standard_Real& Value);
90 //! Returns the value of the <Index>th element of the
92 Standard_EXPORT const Standard_Real& Value (const Standard_Integer Index) const;
93 const Standard_Real& operator () (const Standard_Integer Index) const
99 //! Returns the value of the <Index>th element of the
101 Standard_EXPORT Standard_Real& ChangeValue (const Standard_Integer Index);
102 Standard_Real& operator () (const Standard_Integer Index)
104 return ChangeValue(Index);
108 //! Applys the == operator on each array item
109 Standard_EXPORT Standard_Boolean IsEqual (const IntTools_CArray1OfReal& Other) const;
110 Standard_Boolean operator == (const IntTools_CArray1OfReal& Other) const
112 return IsEqual(Other);
128 //! Prohibits the creator by copy
129 Standard_EXPORT IntTools_CArray1OfReal(const IntTools_CArray1OfReal& AnArray);
132 Standard_Address myStart;
133 Standard_Integer myLength;
134 Standard_Boolean myIsAllocated;
139 #define Array1Item Standard_Real
140 #define Array1Item_hxx <Standard_Real.hxx>
141 #define IntTools_CArray1 IntTools_CArray1OfReal
142 #define IntTools_CArray1_hxx <IntTools_CArray1OfReal.hxx>
144 #include <IntTools_CArray1.lxx>
147 #undef Array1Item_hxx
148 #undef IntTools_CArray1
149 #undef IntTools_CArray1_hxx
154 #endif // _IntTools_CArray1OfReal_HeaderFile