From 4515f3407d14012bea54978ca08cf08f882f7166 Mon Sep 17 00:00:00 2001 From: Viktor UZLOV Date: Wed, 10 Feb 2021 17:01:33 +0300 Subject: [PATCH] added smIdHasher for SMESH module --- src/Basics/smIdType.hxx.in | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Basics/smIdType.hxx.in b/src/Basics/smIdType.hxx.in index 75315a5da..28b184a37 100644 --- a/src/Basics/smIdType.hxx.in +++ b/src/Basics/smIdType.hxx.in @@ -26,6 +26,8 @@ #cmakedefine SALOME_USE_64BIT_IDS #include +#include +#include #ifndef SALOME_USE_64BIT_IDS typedef std::int32_t smIdType; @@ -33,6 +35,19 @@ typedef std::int32_t smIdType; typedef std::int64_t smIdType; #endif +struct smIdHasher +{ + static Standard_Integer HashCode(const smIdType theValue, const Standard_Integer theUpperBound) + { + return IntegerHashCode(static_cast (theValue), std::numeric_limits::max(), theUpperBound); + } + + static Standard_Boolean IsEqual( const smIdType& id1, const smIdType& id2 ) + { + return id1 == id2; + } +}; + template inline smIdType ToIdType(T val) { return static_cast(val); -- 2.39.2