1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0033370: Foundation Classes - Moving into STL and Boost functionality

NCollection containers update:
  - NCollection_Array1 - updated functionality
  - NCollection_Array2 - NCollection_Array1 as a wrapper for 2array
  - NCollection_Vector -> NCollection_DynamicArray was renamed and reworked.
TCollection:
  - Use static empty string to avoid allocations on empty string
 NCollection allocators update:
  - NCollection_Allocator - allocator that used Standard::Allocate
  - NCollection_OccAllocator - allocator-wrapper that used OCC BaseAllocator objects
  - NCollection_IncAllocator - rework to increase performance
Standard:
  - Rework functionality to use different allocation libs
  - Implement basic of new way to wrap allocations tools
  - Define 4 ways to allocation (defines in configure stage)
 Additional changes:
  - Hash function uses std::hash functionality
   - size_t as a hash value
  - New HashUtils with Murmur and FVN hash algo for x32 and x64
  - Deprecated _0.cxx and .gxx DE classes reorganized
  - Create own utility for std memory
  - Update Standard_Transient to be more platform-independent
 Math TK changes:
  - math_Vector -> match_BaseVector<>
    - Buffer decreased to cash 32 elements instead of 512
This commit is contained in:
dpasukhi
2023-08-05 17:53:19 +01:00
parent 6dbfade692
commit 1103eb60af
649 changed files with 10704 additions and 12037 deletions

View File

@@ -21,8 +21,6 @@ MAT2d_DataMapOfIntegerConnexion.hxx
MAT2d_DataMapOfIntegerPnt2d.hxx
MAT2d_DataMapOfIntegerSequenceOfConnexion.hxx
MAT2d_DataMapOfIntegerVec2d.hxx
MAT2d_MapBiIntHasher.hxx
MAT2d_MapBiIntHasher.lxx
MAT2d_Mat2d.cxx
MAT2d_Mat2d.hxx
MAT2d_MiniPath.cxx

View File

@@ -22,7 +22,7 @@
#include <Standard_Handle.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_HashUtils.hxx>
//! BiInt is a set of two integers.
class MAT2d_BiInt
@@ -67,6 +67,19 @@ private:
};
namespace std
{
template <>
struct hash<MAT2d_BiInt>
{
size_t operator()(const MAT2d_BiInt& theBiInt) const noexcept
{
// Combine two int values into a single hash value.
int aCombination[2]{ theBiInt.FirstIndex(), theBiInt.SecondIndex() };
return opencascade::hashBytes(aCombination, sizeof(aCombination));
}
};
}

View File

@@ -18,11 +18,11 @@
#define MAT2d_DataMapOfBiIntInteger_HeaderFile
#include <Standard_Integer.hxx>
#include <MAT2d_MapBiIntHasher.hxx>
#include <MAT2d_BiInt.hxx>
#include <NCollection_DataMap.hxx>
typedef NCollection_DataMap<MAT2d_BiInt,Standard_Integer,MAT2d_MapBiIntHasher> MAT2d_DataMapOfBiIntInteger;
typedef NCollection_DataMap<MAT2d_BiInt,Standard_Integer,MAT2d_MapBiIntHasher>::Iterator MAT2d_DataMapIteratorOfDataMapOfBiIntInteger;
typedef NCollection_DataMap<MAT2d_BiInt,Standard_Integer> MAT2d_DataMapOfBiIntInteger;
typedef NCollection_DataMap<MAT2d_BiInt,Standard_Integer>::Iterator MAT2d_DataMapIteratorOfDataMapOfBiIntInteger;
#endif

View File

@@ -19,11 +19,10 @@
#include <MAT2d_BiInt.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <MAT2d_MapBiIntHasher.hxx>
#include <NCollection_DataMap.hxx>
typedef NCollection_DataMap<MAT2d_BiInt,TColStd_SequenceOfInteger,MAT2d_MapBiIntHasher> MAT2d_DataMapOfBiIntSequenceOfInteger;
typedef NCollection_DataMap<MAT2d_BiInt,TColStd_SequenceOfInteger,MAT2d_MapBiIntHasher>::Iterator MAT2d_DataMapIteratorOfDataMapOfBiIntSequenceOfInteger;
typedef NCollection_DataMap<MAT2d_BiInt,TColStd_SequenceOfInteger> MAT2d_DataMapOfBiIntSequenceOfInteger;
typedef NCollection_DataMap<MAT2d_BiInt,TColStd_SequenceOfInteger>::Iterator MAT2d_DataMapIteratorOfDataMapOfBiIntSequenceOfInteger;
#endif

View File

@@ -18,11 +18,10 @@
#define MAT2d_DataMapOfIntegerBisec_HeaderFile
#include <Bisector_Bisec.hxx>
#include <TColStd_MapIntegerHasher.hxx>
#include <NCollection_DataMap.hxx>
typedef NCollection_DataMap<Standard_Integer,Bisector_Bisec,TColStd_MapIntegerHasher> MAT2d_DataMapOfIntegerBisec;
typedef NCollection_DataMap<Standard_Integer,Bisector_Bisec,TColStd_MapIntegerHasher>::Iterator MAT2d_DataMapIteratorOfDataMapOfIntegerBisec;
typedef NCollection_DataMap<Standard_Integer,Bisector_Bisec> MAT2d_DataMapOfIntegerBisec;
typedef NCollection_DataMap<Standard_Integer,Bisector_Bisec>::Iterator MAT2d_DataMapIteratorOfDataMapOfIntegerBisec;
#endif

View File

@@ -19,11 +19,10 @@
#include <Standard_Integer.hxx>
#include <MAT2d_Connexion.hxx>
#include <TColStd_MapIntegerHasher.hxx>
#include <NCollection_DataMap.hxx>
typedef NCollection_DataMap<Standard_Integer,Handle(MAT2d_Connexion),TColStd_MapIntegerHasher> MAT2d_DataMapOfIntegerConnexion;
typedef NCollection_DataMap<Standard_Integer,Handle(MAT2d_Connexion),TColStd_MapIntegerHasher>::Iterator MAT2d_DataMapIteratorOfDataMapOfIntegerConnexion;
typedef NCollection_DataMap<Standard_Integer,Handle(MAT2d_Connexion)> MAT2d_DataMapOfIntegerConnexion;
typedef NCollection_DataMap<Standard_Integer,Handle(MAT2d_Connexion)>::Iterator MAT2d_DataMapIteratorOfDataMapOfIntegerConnexion;
#endif

View File

@@ -18,11 +18,10 @@
#define MAT2d_DataMapOfIntegerPnt2d_HeaderFile
#include <gp_Pnt2d.hxx>
#include <TColStd_MapIntegerHasher.hxx>
#include <NCollection_DataMap.hxx>
typedef NCollection_DataMap<Standard_Integer,gp_Pnt2d,TColStd_MapIntegerHasher> MAT2d_DataMapOfIntegerPnt2d;
typedef NCollection_DataMap<Standard_Integer,gp_Pnt2d,TColStd_MapIntegerHasher>::Iterator MAT2d_DataMapIteratorOfDataMapOfIntegerPnt2d;
typedef NCollection_DataMap<Standard_Integer,gp_Pnt2d> MAT2d_DataMapOfIntegerPnt2d;
typedef NCollection_DataMap<Standard_Integer,gp_Pnt2d>::Iterator MAT2d_DataMapIteratorOfDataMapOfIntegerPnt2d;
#endif

View File

@@ -19,11 +19,10 @@
#include <Standard_Integer.hxx>
#include <MAT2d_SequenceOfConnexion.hxx>
#include <TColStd_MapIntegerHasher.hxx>
#include <NCollection_DataMap.hxx>
typedef NCollection_DataMap<Standard_Integer,MAT2d_SequenceOfConnexion,TColStd_MapIntegerHasher> MAT2d_DataMapOfIntegerSequenceOfConnexion;
typedef NCollection_DataMap<Standard_Integer,MAT2d_SequenceOfConnexion,TColStd_MapIntegerHasher>::Iterator MAT2d_DataMapIteratorOfDataMapOfIntegerSequenceOfConnexion;
typedef NCollection_DataMap<Standard_Integer,MAT2d_SequenceOfConnexion> MAT2d_DataMapOfIntegerSequenceOfConnexion;
typedef NCollection_DataMap<Standard_Integer,MAT2d_SequenceOfConnexion>::Iterator MAT2d_DataMapIteratorOfDataMapOfIntegerSequenceOfConnexion;
#endif

View File

@@ -19,11 +19,10 @@
#include <Standard_Integer.hxx>
#include <gp_Vec2d.hxx>
#include <TColStd_MapIntegerHasher.hxx>
#include <NCollection_DataMap.hxx>
typedef NCollection_DataMap<Standard_Integer,gp_Vec2d,TColStd_MapIntegerHasher> MAT2d_DataMapOfIntegerVec2d;
typedef NCollection_DataMap<Standard_Integer,gp_Vec2d,TColStd_MapIntegerHasher>::Iterator MAT2d_DataMapIteratorOfDataMapOfIntegerVec2d;
typedef NCollection_DataMap<Standard_Integer,gp_Vec2d> MAT2d_DataMapOfIntegerVec2d;
typedef NCollection_DataMap<Standard_Integer,gp_Vec2d>::Iterator MAT2d_DataMapIteratorOfDataMapOfIntegerVec2d;
#endif

View File

@@ -1,66 +0,0 @@
// Created on: 1993-11-19
// Created by: Yves FRICAUD
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _MAT2d_MapBiIntHasher_HeaderFile
#define _MAT2d_MapBiIntHasher_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Integer.hxx>
class MAT2d_BiInt;
class MAT2d_MapBiIntHasher
{
public:
DEFINE_STANDARD_ALLOC
//! Computes a hash code for the given key, in the range [1, theUpperBound]
//! @param theKey the key which hash code is to be computed
//! @param theUpperBound the upper bound of the range a computing hash code must be within
//! @return a computed hash code, in the range [1, theUpperBound]
static Standard_Integer HashCode (const MAT2d_BiInt& theKey, const Standard_Integer theUpperBound);
static Standard_Boolean IsEqual (const MAT2d_BiInt& Key1, const MAT2d_BiInt& Key2);
protected:
private:
};
#include <MAT2d_MapBiIntHasher.lxx>
#endif // _MAT2d_MapBiIntHasher_HeaderFile

View File

@@ -1,38 +0,0 @@
// Created on: 1993-11-19
// Created by: Yves FRICAUD
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <MAT2d_BiInt.hxx>
#include <TColStd_MapIntegerHasher.hxx>
//=======================================================================
// function : HashCode
// purpose :
//=======================================================================
inline Standard_Integer MAT2d_MapBiIntHasher::HashCode (const MAT2d_BiInt& theKey, const Standard_Integer theUpperBound)
{
return TColStd_MapIntegerHasher::HashCode (theKey.FirstIndex(), theUpperBound);
}
//=======================================================================
//function : IsEqual
//purpose :
//=======================================================================
inline Standard_Boolean MAT2d_MapBiIntHasher::IsEqual
(const MAT2d_BiInt& Key1,
const MAT2d_BiInt& Key2)
{
return (Key1 == Key2);
}