standard_policies.hpp revision 169692
1112758Ssam// -*- C++ -*-
2112758Ssam
3112758Ssam// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
4112758Ssam//
5112758Ssam// This file is part of the GNU ISO C++ Library.  This library is free
6112758Ssam// software; you can redistribute it and/or modify it under the terms
7112758Ssam// of the GNU General Public License as published by the Free Software
8112758Ssam// Foundation; either version 2, or (at your option) any later
9112758Ssam// version.
10112758Ssam
11112758Ssam// This library is distributed in the hope that it will be useful, but
12112758Ssam// WITHOUT ANY WARRANTY; without even the implied warranty of
13112758Ssam// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14112758Ssam// General Public License for more details.
15112758Ssam
16112758Ssam// You should have received a copy of the GNU General Public License
17112758Ssam// along with this library; see the file COPYING.  If not, write to
18112758Ssam// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
19112758Ssam// MA 02111-1307, USA.
20112758Ssam
21112758Ssam// As a special exception, you may use this file as part of a free
22112758Ssam// software library without restriction.  Specifically, if other files
23112758Ssam// instantiate templates or use macros or inline functions from this
24112758Ssam// file, or you compile this file and link it with other files to
25112758Ssam// produce an executable, this file does not by itself cause the
26112758Ssam// resulting executable to be covered by the GNU General Public
27112758Ssam// License.  This exception does not however invalidate any other
28105197Ssam// reasons why the executable file might be covered by the GNU General
29105197Ssam// Public License.
30105197Ssam
31105197Ssam// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
32105197Ssam
33105197Ssam// Permission to use, copy, modify, sell, and distribute this software
34105197Ssam// is hereby granted without fee, provided that the above copyright
35105197Ssam// notice appears in all copies, and that both that copyright notice
36105197Ssam// and this permission notice appear in supporting documentation. None
37105197Ssam// of the above authors, nor IBM Haifa Research Laboratories, make any
38105197Ssam// representation about the suitability of this software for any
39105197Ssam// purpose. It is provided "as is" without express or implied
40105197Ssam// warranty.
41105197Ssam
42105197Ssam/**
43105197Ssam * @file standard_policies.hpp
44105197Ssam * Contains standard policies for gp_ht_map types.
45105197Ssam */
46105197Ssam
47105197Ssam#ifndef PB_DS_GP_HT_MAP_STANDARD_POLICIES_HPP
48105197Ssam#define PB_DS_GP_HT_MAP_STANDARD_POLICIES_HPP
49105197Ssam
50105197Ssam#include <ext/pb_ds/detail/standard_policies.hpp>
51105197Ssam#include <ext/pb_ds/ht_load_check_resize_trigger.hpp>
52105197Ssam#include <ext/pb_ds/linear_probe_fn.hpp>
53105197Ssam#include <ext/pb_ds/quadratic_probe_fn.hpp>
54105197Ssam
55105197Ssamnamespace pb_ds
56105197Ssam{
57105197Ssam  namespace detail
58105197Ssam  {
59105197Ssam    template<typename Comb_Probe_Fn>
60105197Ssam    struct default_probe_fn
61105197Ssam    {
62105197Ssam    private:
63105197Ssam      typedef typename Comb_Probe_Fn::size_type size_type;
64105197Ssam
65105197Ssam    public:
66105197Ssam      typedef
67105197Ssam      typename __conditional_type<
68105197Ssam      is_same<
69105197Ssam      pb_ds::direct_mask_range_hashing<size_t>,
70105197Ssam      Comb_Probe_Fn>::value,
71105197Ssam      pb_ds::linear_probe_fn<size_type>,
72105197Ssam      pb_ds::quadratic_probe_fn<size_type> >::__type
73105197Ssam      type;
74105197Ssam    };
75105197Ssam
76105197Ssam  } // namespace detail
77105197Ssam} // namespace pb_ds
78105197Ssam
79105197Ssam#endif
80105197Ssam
81105197Ssam