174462Salfred// -*- C++ -*- 274462Salfred 3258578Shrs// Copyright (C) 2005, 2006, 2009 Free Software Foundation, Inc. 4258578Shrs// 5258578Shrs// This file is part of the GNU ISO C++ Library. This library is free 68870Srgrimes// software; you can redistribute it and/or modify it under the terms 7258578Shrs// of the GNU General Public License as published by the Free Software 8258578Shrs// Foundation; either version 3, or (at your option) any later 9258578Shrs// version. 10258578Shrs 11258578Shrs// This library is distributed in the hope that it will be useful, but 12258578Shrs// WITHOUT ANY WARRANTY; without even the implied warranty of 13258578Shrs// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14258578Shrs// General Public License for more details. 15258578Shrs 16258578Shrs// Under Section 7 of GPL version 3, you are granted additional 17258578Shrs// permissions described in the GCC Runtime Library Exception, version 18258578Shrs// 3.1, as published by the Free Software Foundation. 19258578Shrs 20258578Shrs// You should have received a copy of the GNU General Public License and 21258578Shrs// a copy of the GCC Runtime Library Exception along with this program; 22258578Shrs// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 23258578Shrs// <http://www.gnu.org/licenses/>. 24258578Shrs 25258578Shrs// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL. 26258578Shrs 27258578Shrs// Permission to use, copy, modify, sell, and distribute this software 28258578Shrs// is hereby granted without fee, provided that the above copyright 291901Swollman// notice appears in all copies, and that both that copyright notice 3074462Salfred// and this permission notice appear in supporting documentation. None 3174462Salfred// of the above authors, nor IBM Haifa Research Laboratories, make any 3274462Salfred// representation about the suitability of this software for any 331901Swollman// purpose. It is provided "as is" without express or implied 341901Swollman// warranty. 35136581Sobrien 3692990Sobrien/** 371901Swollman * @file sample_ranged_hash_fn.hpp 3892990Sobrien * Contains a ranged hash policy. 3992990Sobrien */ 401901Swollman 418870Srgrimes#ifndef PB_DS_SAMPLE_RANGED_HASH_FN_HPP 421901Swollman#define PB_DS_SAMPLE_RANGED_HASH_FN_HPP 4374462Salfred 441901Swollman// A sample ranged-hash functor. 451901Swollmanclass sample_ranged_hash_fn 461901Swollman{ 4775094Siedowse 4874462Salfredpublic: 4921070Speter 501901Swollman // Size type. 5174462Salfred typedef size_t size_type; 5274462Salfred 5374462Salfredpublic: 541901Swollman 5574462Salfred // Default constructor. 5611666Sphk sample_ranged_hash_fn(); 5771579Sdeischen 58156090Sdeischen // Copy constructor. 591901Swollman sample_ranged_hash_fn(const sample_ranged_hash_fn& other); 6074462Salfred 6174462Salfred // Swaps content. 6274462Salfred inline void 631901Swollman swap(sample_ranged_hash_fn& other); 6474462Salfred 6574462Salfredprotected: 6674462Salfred 6774462Salfred // Notifies the policy object that the container's __size has changed to size. 6874462Salfred void 6974462Salfred notify_resized(size_type size); 7074462Salfred 7174462Salfred // Transforms r_key into a position within the table. 7274462Salfred inline size_type 7374462Salfred operator()(const_key_reference r_key) const; 7474462Salfred 7574462Salfred}; 7674462Salfred 7774462Salfred#endif // #ifndef PB_DS_SAMPLE_RANGED_HASH_FN_HPP 78204950Sjhb