Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:47:33

0001 // Created on: 2005-10-14
0002 // Created by: Mikhail KLOKOV
0003 // Copyright (c) 2005-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _IntTools_CurveRangeSampleMapHasher_HeaderFile
0017 #define _IntTools_CurveRangeSampleMapHasher_HeaderFile
0018 
0019 #include <IntTools_CurveRangeSample.hxx>
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Integer.hxx>
0023 
0024 //! class for range index management of curve
0025 class IntTools_CurveRangeSampleMapHasher 
0026 {
0027 public:
0028 
0029   DEFINE_STANDARD_ALLOC
0030 
0031   //! Computes a hash code for the given key, in the range [1, theUpperBound]
0032   //! @param theKey the key which hash code is to be computed
0033   //! @param theUpperBound the upper bound of the range a computing hash code must be within
0034   //! @return a computed hash code, in the range [1, theUpperBound]
0035   static Standard_Integer HashCode (const IntTools_CurveRangeSample& theKey, const Standard_Integer theUpperBound)
0036   {
0037     return ::HashCode(theKey.GetDepth(), theUpperBound);
0038   }
0039 
0040   //! Returns True  when the two  keys are the same. Two
0041   //! same  keys  must   have  the  same  hashcode,  the
0042   //! contrary is not necessary.
0043   static Standard_Boolean IsEqual (const IntTools_CurveRangeSample& S1, const IntTools_CurveRangeSample& S2)
0044   {
0045     return S1.IsEqual(S2);
0046   }
0047 
0048 };
0049 
0050 #endif // _IntTools_CurveRangeSampleMapHasher_HeaderFile