Back to index

salome-geom  6.5.0
NMTDS_CArray1OfIndexRange.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 // File:      NMTDS_BndSphere.hxx
00021 // Created:   
00022 // Author:    Peter KURNEV
00023 //            <pkv@irinox>
00024 
00025 #ifndef _NMTDS_CArray1OfIndexRange_HeaderFile
00026 #define _NMTDS_CArray1OfIndexRange_HeaderFile
00027 
00028 #include <Standard.hxx>
00029 #include <Standard_Macro.hxx>
00030 #include <Standard_Address.hxx>
00031 #include <Standard_Integer.hxx>
00032 #include <Standard_Boolean.hxx>
00033 #include <NMTDS_IndexRange.hxx>
00034 
00035 class Standard_OutOfRange;
00036 class Standard_OutOfMemory;
00037 
00038 
00039 
00040 //=======================================================================
00041 //function : NMTDS_CArray1OfIndexRange
00042 //purpose  : 
00043 //=======================================================================
00044 class NMTDS_CArray1OfIndexRange  {
00045  public:
00046 
00047   Standard_EXPORT
00048     NMTDS_CArray1OfIndexRange(const Standard_Integer Length = 0,
00049                            const Standard_Integer BlockLength = 5);
00050   
00051   Standard_EXPORT   
00052     void Resize(const Standard_Integer theNewLength) ;
00053   
00054   Standard_EXPORT     
00055     void Destroy() ;
00056 
00057   ~NMTDS_CArray1OfIndexRange() {
00058     Destroy();
00059   }
00060   
00061   Standard_EXPORT
00062     Standard_Integer Length() const;
00063   
00064   Standard_EXPORT
00065     Standard_Integer Extent() const;
00066   
00067   Standard_EXPORT
00068     Standard_Integer FactLength() const;
00069   
00070   Standard_EXPORT
00071     Standard_Integer Append(const NMTDS_IndexRange& Value) ;
00072   
00073   Standard_EXPORT
00074     void Remove(const Standard_Integer Index) ;
00075   
00076   Standard_EXPORT
00077     const NMTDS_IndexRange& Value(const Standard_Integer Index) const;
00078    
00079   const NMTDS_IndexRange& operator ()(const Standard_Integer Index) const {
00080     return Value(Index);
00081   }
00082   
00083   Standard_EXPORT
00084     NMTDS_IndexRange& ChangeValue(const Standard_Integer Index) ;
00085 
00086     NMTDS_IndexRange& operator ()(const Standard_Integer Index) {
00087       return ChangeValue(Index);
00088     }
00089   
00090   Standard_EXPORT
00091     void SetBlockLength(const Standard_Integer aBL) ;
00092   
00093   Standard_EXPORT
00094     Standard_Integer BlockLength() const;
00095   
00096   Standard_EXPORT
00097     void Purge() ;
00098 
00099  private:
00100   Standard_EXPORT
00101     NMTDS_CArray1OfIndexRange(const NMTDS_CArray1OfIndexRange& AnArray);
00102   
00103   Standard_EXPORT
00104     NMTDS_CArray1OfIndexRange& Assign(const NMTDS_CArray1OfIndexRange& Other) ;
00105   
00106   NMTDS_CArray1OfIndexRange& operator =(const NMTDS_CArray1OfIndexRange& Other) {
00107     return Assign(Other);
00108   }
00109   
00110   Standard_EXPORT
00111     Standard_Boolean IsInvalidIndex(const Standard_Integer Index) const;
00112 
00113 
00114   Standard_Address myStart;
00115   Standard_Integer myLength;
00116   Standard_Integer myFactLength;
00117   Standard_Integer myBlockLength;
00118   Standard_Boolean myIsAllocated;
00119 };
00120 
00121 #endif