OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [libstdc++-v3/] [include/] [tr1/] [unordered_map] - Blame information for rev 20

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 17 jlechner
// TR1 unordered_map -*- C++ -*-
2
 
3
// Copyright (C) 2005 Free Software Foundation, Inc.
4
//
5
// This file is part of the GNU ISO C++ Library.  This library is free
6
// software; you can redistribute it and/or modify it under the
7
// terms of the GNU General Public License as published by the
8
// Free Software Foundation; either version 2, or (at your option)
9
// any later version.
10
 
11
// This library is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
// GNU General Public License for more details.
15
 
16
// You should have received a copy of the GNU General Public License along
17
// with this library; see the file COPYING.  If not, write to the Free
18
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19
// USA.
20
 
21
// As a special exception, you may use this file as part of a free software
22
// library without restriction.  Specifically, if other files instantiate
23
// templates or use macros or inline functions from this file, or you compile
24
// this file and link it with other files to produce an executable, this
25
// file does not by itself cause the resulting executable to be covered by
26
// the GNU General Public License.  This exception does not however
27
// invalidate any other reasons why the executable file might be covered by
28
// the GNU General Public License.
29
 
30
/** @file
31
 *  This is a TR1 C++ Library header.
32
 */
33
 
34
#ifndef GNU_LIBSTDCXX_TR1_UNORDERED_MAP_
35
#define GNU_LIBSTDCXX_TR1_UNORDERED_MAP_
36
 
37
#include 
38
#include 
39
#include 
40
#include 
41
#include 
42
 
43
namespace std
44
{
45
namespace tr1
46
{
47
  // XXX When we get typedef templates these class definitions
48
  // will be unnecessary.
49
 
50
  template
51
           class Hash = hash,
52
           class Pred = std::equal_to,
53
           class Alloc = std::allocator >,
54
           bool cache_hash_code = false>
55
    class unordered_map
56
    : public hashtable ,
57
                        Alloc,
58
                        Internal::extract1st >, Pred,
59
                        Hash, Internal::mod_range_hashing,
60
                        Internal::default_ranged_hash,
61
                        Internal::prime_rehash_policy,
62
                        cache_hash_code, false, true>
63
    {
64
      typedef hashtable ,
65
                         Alloc,
66
                         Internal::extract1st >, Pred,
67
                         Hash, Internal::mod_range_hashing,
68
                         Internal::default_ranged_hash,
69
                         Internal::prime_rehash_policy,
70
                         cache_hash_code, false, true>
71
        Base;
72
 
73
    public:
74
      typedef typename Base::size_type size_type;
75
      typedef typename Base::hasher hasher;
76
      typedef typename Base::key_equal key_equal;
77
      typedef typename Base::allocator_type allocator_type;
78
 
79
      explicit
80
      unordered_map(size_type n = 10,
81
                    const hasher& hf = hasher(),
82
                    const key_equal& eql = key_equal(),
83
                    const allocator_type& a = allocator_type())
84
      : Base(n, hf, Internal::mod_range_hashing(),
85
             Internal::default_ranged_hash(),
86
             eql, Internal::extract1st >(), a)
87
      { }
88
 
89
      template
90
        unordered_map(InputIterator f, InputIterator l,
91
                      size_type n = 10,
92
                      const hasher& hf = hasher(),
93
                      const key_equal& eql = key_equal(),
94
                      const allocator_type& a = allocator_type())
95
        : Base (f, l, n, hf, Internal::mod_range_hashing(),
96
                Internal::default_ranged_hash(),
97
                eql, Internal::extract1st >(), a)
98
        { }
99
    };
100
 
101
  template
102
           class Hash = hash,
103
           class Pred = std::equal_to,
104
           class Alloc = std::allocator >,
105
           bool cache_hash_code = false>
106
    class unordered_multimap
107
    : public hashtable ,
108
                        Alloc,
109
                        Internal::extract1st >, Pred,
110
                        Hash, Internal::mod_range_hashing,
111
                        Internal::default_ranged_hash,
112
                        Internal::prime_rehash_policy,
113
                        cache_hash_code, false, false>
114
    {
115
      typedef hashtable ,
116
                         Alloc,
117
                         Internal::extract1st >, Pred,
118
                         Hash, Internal::mod_range_hashing,
119
                         Internal::default_ranged_hash,
120
                         Internal::prime_rehash_policy,
121
                         cache_hash_code, false, false>
122
        Base;
123
 
124
    public:
125
      typedef typename Base::size_type size_type;
126
      typedef typename Base::hasher hasher;
127
      typedef typename Base::key_equal key_equal;
128
      typedef typename Base::allocator_type allocator_type;
129
 
130
      explicit
131
      unordered_multimap(size_type n = 10,
132
                         const hasher& hf = hasher(),
133
                         const key_equal& eql = key_equal(),
134
                         const allocator_type& a = allocator_type())
135
      : Base (n, hf, Internal::mod_range_hashing(),
136
              Internal::default_ranged_hash(),
137
              eql, Internal::extract1st >(), a)
138
      { }
139
 
140
 
141
      template
142
        unordered_multimap(InputIterator f, InputIterator l,
143
                           typename Base::size_type n = 0,
144
                           const hasher& hf = hasher(),
145
                           const key_equal& eql = key_equal(),
146
                           const allocator_type& a = allocator_type())
147
        : Base (f, l, n, hf, Internal::mod_range_hashing(),
148
                Internal::default_ranged_hash(),
149
                eql, Internal::extract1st >(), a)
150
        { }
151
    };
152
 
153
  template
154
           bool cache_hash_code>
155
    inline void
156
    swap(unordered_map& x,
157
         unordered_map& y)
158
    { x.swap(y); }
159
 
160
  template
161
           bool cache_hash_code>
162
    inline void
163
    swap(unordered_multimap& x,
164
         unordered_multimap& y)
165
    { x.swap(y); }
166
 
167
}
168
}
169
 
170
#endif /* GNU_LIBSTDCXX_TR1_UNORDERED_MAP_ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.