1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
\r
3 // This library is free software; you can redistribute it and/or
\r
4 // modify it under the terms of the GNU Lesser General Public
\r
5 // License as published by the Free Software Foundation; either
\r
6 // version 2.1 of the License.
\r
8 // This library is distributed in the hope that it will be useful,
\r
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
\r
11 // Lesser General Public License for more details.
\r
13 // You should have received a copy of the GNU Lesser General Public
\r
14 // License along with this library; if not, write to the Free Software
\r
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
\r
20 // File: NMTDS_BndSphere.hxx
\r
22 // Author: Peter KURNEV
\r
25 #ifndef _NMTDS_CArray1OfIndexRange_HeaderFile
\r
26 #define _NMTDS_CArray1OfIndexRange_HeaderFile
\r
28 #include <Standard.hxx>
\r
29 #include <Standard_Macro.hxx>
\r
30 #include <Standard_Address.hxx>
\r
31 #include <Standard_Integer.hxx>
\r
32 #include <Standard_Boolean.hxx>
\r
33 #include <NMTDS_IndexRange.hxx>
\r
35 class Standard_OutOfRange;
\r
36 class Standard_OutOfMemory;
\r
40 //=======================================================================
\r
41 //function : NMTDS_CArray1OfIndexRange
\r
43 //=======================================================================
\r
44 class NMTDS_CArray1OfIndexRange {
\r
48 NMTDS_CArray1OfIndexRange(const Standard_Integer Length = 0,
\r
49 const Standard_Integer BlockLength = 5);
\r
52 void Resize(const Standard_Integer theNewLength) ;
\r
57 ~NMTDS_CArray1OfIndexRange() {
\r
62 Standard_Integer Length() const;
\r
65 Standard_Integer Extent() const;
\r
68 Standard_Integer FactLength() const;
\r
71 Standard_Integer Append(const NMTDS_IndexRange& Value) ;
\r
74 void Remove(const Standard_Integer Index) ;
\r
77 const NMTDS_IndexRange& Value(const Standard_Integer Index) const;
\r
79 const NMTDS_IndexRange& operator ()(const Standard_Integer Index) const {
\r
80 return Value(Index);
\r
84 NMTDS_IndexRange& ChangeValue(const Standard_Integer Index) ;
\r
86 NMTDS_IndexRange& operator ()(const Standard_Integer Index) {
\r
87 return ChangeValue(Index);
\r
91 void SetBlockLength(const Standard_Integer aBL) ;
\r
94 Standard_Integer BlockLength() const;
\r
101 NMTDS_CArray1OfIndexRange(const NMTDS_CArray1OfIndexRange& AnArray);
\r
104 NMTDS_CArray1OfIndexRange& Assign(const NMTDS_CArray1OfIndexRange& Other) ;
\r
106 NMTDS_CArray1OfIndexRange& operator =(const NMTDS_CArray1OfIndexRange& Other) {
\r
107 return Assign(Other);
\r
111 Standard_Boolean IsInvalidIndex(const Standard_Integer Index) const;
\r
114 Standard_Address myStart;
\r
115 Standard_Integer myLength;
\r
116 Standard_Integer myFactLength;
\r
117 Standard_Integer myBlockLength;
\r
118 Standard_Boolean myIsAllocated;
\r