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