-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#ifndef _GEOMAlgo_PassKey_HeaderFile
#define _GEOMAlgo_PassKey_HeaderFile
+#include <Basics_OCCTVersion.hxx>
+
#include <Standard.hxx>
#include <Standard_Macro.hxx>
#include <Standard_Integer.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
#include <Standard_Boolean.hxx>
+
#include <TColStd_ListOfInteger.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
//=======================================================================
//class : GEOMAlgo_PassKey
Standard_EXPORT
void SetIds(const Standard_Integer aI1,
- const Standard_Integer aI2) ;
+ const Standard_Integer aI2) ;
Standard_EXPORT
void SetIds(const Standard_Integer aI1,
- const Standard_Integer aI2,
- const Standard_Integer aI3) ;
+ const Standard_Integer aI2,
+ const Standard_Integer aI3) ;
Standard_EXPORT
void SetIds(const Standard_Integer aI1,
- const Standard_Integer aI2,
- const Standard_Integer aI3,
- const Standard_Integer aI4) ;
+ const Standard_Integer aI2,
+ const Standard_Integer aI3,
+ const Standard_Integer aI4) ;
Standard_EXPORT
void SetIds(const TColStd_ListOfInteger& aLS) ;
Standard_EXPORT
Standard_Boolean IsEqual(const GEOMAlgo_PassKey& aOther) const;
+#if OCC_VERSION_LARGE < 0x07080000
Standard_EXPORT
Standard_Integer HashCode(const Standard_Integer Upper) const;
+#endif
+
+ Standard_EXPORT
+ bool operator==(const GEOMAlgo_PassKey& theOther) const
+ {
+ return IsEqual(theOther);
+ }
+
+ Standard_EXPORT
+ size_t GetSum() const { return (size_t)mySum; }
Standard_EXPORT
Standard_Integer Id(const Standard_Integer aIndex) const;
Standard_Integer mySum;
TColStd_IndexedMapOfInteger myMap;
};
+
+namespace std
+{
+ template <>
+ struct hash<GEOMAlgo_PassKey>
+ {
+ size_t operator()(const GEOMAlgo_PassKey& thePK) const noexcept
+ {
+ return thePK.GetSum();
+ }
+ };
+}
#endif