From: Viktor UZLOV Date: Wed, 10 Feb 2021 14:01:33 +0000 (+0300) Subject: added smIdHasher for SMESH module X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4515f3407d14012bea54978ca08cf08f882f7166;p=modules%2Fkernel.git added smIdHasher for SMESH module --- 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);