1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // SALOME Basics : general SALOME definitions and tools (C++ part - no CORBA)
21 // File : smIdType.hxx
23 #ifndef _SMIDTYPE_HXX_
24 #define _SMIDTYPE_HXX_
26 #cmakedefine SALOME_USE_64BIT_IDS
31 #ifndef SALOME_USE_64BIT_IDS
32 typedef std::int32_t smIdType;
34 typedef std::int64_t smIdType;
39 static int HashCode(const smIdType theValue, const int theUpperBound)
41 return static_cast<int> ((theValue & std::numeric_limits<smIdType>::max()) % theUpperBound + 1);
44 static bool IsEqual( const smIdType& id1, const smIdType& id2 )
50 template <class T> inline smIdType ToSmIdType(T val)
52 return static_cast<smIdType>(val);
54 template <class T> inline T FromSmIdType(smIdType val)
56 return static_cast<T>(val);
59 #endif //_SMIDTYPE_HXX_