Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:29

0001 // Created on: 1994-11-04
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1994-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Transfer_FindHasher_HeaderFile
0018 #define _Transfer_FindHasher_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Transfer_Finder.hxx>
0023 #include <Standard_Handle.hxx>
0024 
0025 //! FindHasher defines HashCode for Finder, which is : ask a
0026 //! Finder its HashCode !  Because this is the Finder itself which
0027 //! brings the HashCode for its Key
0028 //!
0029 //! This class complies to the template given in TCollection by
0030 //! MapHasher itself
0031 class Transfer_FindHasher
0032 {
0033 public:
0034   size_t operator()(const Handle(Transfer_Finder)& theFinder) const
0035   {
0036     return theFinder->GetHashCode();
0037   }
0038 
0039   //! Returns True if two keys are the same.
0040   //! The test does not work on the Finders themselves but by
0041   //! calling their methods Equates
0042   bool operator() (const Handle(Transfer_Finder)& theK1,
0043                    const Handle(Transfer_Finder)& theK2) const
0044   {
0045     if (theK1.IsNull()) return false;
0046     return theK1->Equates(theK2);
0047   }
0048 
0049 };
0050 
0051 #endif // _Transfer_FindHasher_HeaderFile