Nugget
fixed_map.h
1 // Copyright (c) Electronic Arts Inc. All rights reserved.
4 
6 // This file implements a map and multimap which use a fixed size memory
7 // pool for their nodes.
9 
10 
11 #ifndef EASTL_FIXED_MAP_H
12 #define EASTL_FIXED_MAP_H
13 
14 
15 #include <EASTL/map.h>
16 #include <EASTL/fixed_set.h> // Included because fixed_rbtree_base resides here.
17 
18 #if defined(EA_PRAGMA_ONCE_SUPPORTED)
19  #pragma once // Some compilers (e.g. VC++) benefit significantly from using this. We've measured 3-4% build speed improvements in apps as a result.
20 #endif
21 
22 
23 
24 namespace eastl
25 {
32  #ifndef EASTL_FIXED_MAP_DEFAULT_NAME
33  #define EASTL_FIXED_MAP_DEFAULT_NAME EASTL_DEFAULT_NAME_PREFIX " fixed_map" // Unless the user overrides something, this is "EASTL fixed_map".
34  #endif
35 
36  #ifndef EASTL_FIXED_MULTIMAP_DEFAULT_NAME
37  #define EASTL_FIXED_MULTIMAP_DEFAULT_NAME EASTL_DEFAULT_NAME_PREFIX " fixed_multimap" // Unless the user overrides something, this is "EASTL fixed_multimap".
38  #endif
39 
40 
44  #ifndef EASTL_FIXED_MAP_DEFAULT_ALLOCATOR
45  #define EASTL_FIXED_MAP_DEFAULT_ALLOCATOR overflow_allocator_type(EASTL_FIXED_MAP_DEFAULT_NAME)
46  #endif
47 
48  #ifndef EASTL_FIXED_MULTIMAP_DEFAULT_ALLOCATOR
49  #define EASTL_FIXED_MULTIMAP_DEFAULT_ALLOCATOR overflow_allocator_type(EASTL_FIXED_MULTIMAP_DEFAULT_NAME)
50  #endif
51 
52 
53 
66  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow = true, typename Compare = eastl::less<Key>, typename OverflowAllocator = EASTLAllocatorType>
67  class fixed_map : public map<Key, T, Compare, fixed_node_allocator<sizeof(typename map<Key, T>::node_type),
68  nodeCount, EASTL_ALIGN_OF(eastl::pair<Key, T>), 0, bEnableOverflow, OverflowAllocator> >
69  {
70  public:
71  typedef fixed_node_allocator<sizeof(typename map<Key, T>::node_type), nodeCount,
72  EASTL_ALIGN_OF(eastl::pair<Key, T>), 0, bEnableOverflow, OverflowAllocator> fixed_allocator_type;
73  typedef typename fixed_allocator_type::overflow_allocator_type overflow_allocator_type;
76  typedef typename base_type::value_type value_type;
77  typedef typename base_type::node_type node_type;
78  typedef typename base_type::size_type size_type;
79 
80  enum { kMaxSize = nodeCount };
81 
82  using base_type::insert;
83 
84  protected:
85  char mBuffer[fixed_allocator_type::kBufferSize]; // kBufferSize will take into account alignment requirements.
86 
88 
89  public:
90  fixed_map();
91  explicit fixed_map(const overflow_allocator_type& overflowAllocator);
92  explicit fixed_map(const Compare& compare);
93  fixed_map(const this_type& x);
94  fixed_map(this_type&& x);
95  fixed_map(this_type&& x, const overflow_allocator_type& overflowAllocator);
96  fixed_map(std::initializer_list<value_type> ilist, const overflow_allocator_type& overflowAllocator = EASTL_FIXED_MAP_DEFAULT_ALLOCATOR);
97 
98  template <typename InputIterator>
99  fixed_map(InputIterator first, InputIterator last);
100 
101  this_type& operator=(const this_type& x);
103  this_type& operator=(this_type&& x);
104 
105  void swap(this_type& x);
106 
107  void reset_lose_memory(); // This is a unilateral reset to an initially empty state. No destructors are called, no deallocation occurs.
108 
109  size_type max_size() const;
110 
111  const overflow_allocator_type& get_overflow_allocator() const EA_NOEXCEPT;
112  overflow_allocator_type& get_overflow_allocator() EA_NOEXCEPT;
113  void set_overflow_allocator(const overflow_allocator_type& allocator);
114  }; // fixed_map
115 
116 
117 
118 
131  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow = true, typename Compare = eastl::less<Key>, typename OverflowAllocator = EASTLAllocatorType>
132  class fixed_multimap : public multimap<Key, T, Compare, fixed_node_allocator<sizeof(typename multimap<Key, T>::node_type),
133  nodeCount, EASTL_ALIGN_OF(eastl::pair<Key, T>), 0, bEnableOverflow, OverflowAllocator> >
134  {
135  public:
136  typedef fixed_node_allocator<sizeof(typename multimap<Key, T>::node_type), nodeCount,
137  EASTL_ALIGN_OF(eastl::pair<Key, T>), 0, bEnableOverflow, OverflowAllocator> fixed_allocator_type;
138  typedef typename fixed_allocator_type::overflow_allocator_type overflow_allocator_type;
141  typedef typename base_type::value_type value_type;
142  typedef typename base_type::node_type node_type;
143  typedef typename base_type::size_type size_type;
144 
145  enum { kMaxSize = nodeCount };
146 
147  using base_type::insert;
148 
149  protected:
150  char mBuffer[fixed_allocator_type::kBufferSize]; // kBufferSize will take into account alignment requirements.
151 
152  using base_type::mAllocator;
153  using base_type::get_compare;
154 
155  public:
156  fixed_multimap();
157  fixed_multimap(const overflow_allocator_type& overflowAllocator);
158  explicit fixed_multimap(const Compare& compare);
159  fixed_multimap(const this_type& x);
161  fixed_multimap(this_type&& x, const overflow_allocator_type& overflowAllocator);
162  fixed_multimap(std::initializer_list<value_type> ilist, const overflow_allocator_type& overflowAllocator = EASTL_FIXED_MULTIMAP_DEFAULT_ALLOCATOR);
163 
164  template <typename InputIterator>
165  fixed_multimap(InputIterator first, InputIterator last);
166 
167  this_type& operator=(const this_type& x);
169  this_type& operator=(this_type&& x);
170 
171  void swap(this_type& x);
172 
173  void reset_lose_memory(); // This is a unilateral reset to an initially empty state. No destructors are called, no deallocation occurs.
174 
175  size_type max_size() const;
176 
177  const overflow_allocator_type& get_overflow_allocator() const EA_NOEXCEPT;
178  overflow_allocator_type& get_overflow_allocator() EA_NOEXCEPT;
179  void set_overflow_allocator(const overflow_allocator_type& allocator);
180  }; // fixed_multimap
181 
182 
183 
184 
185 
187  // fixed_map
189 
190  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
192  : base_type(fixed_allocator_type(mBuffer))
193  {
194  #if EASTL_NAME_ENABLED
195  mAllocator.set_name(EASTL_FIXED_MAP_DEFAULT_NAME);
196  #endif
197  }
198 
199 
200  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
201  inline fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::fixed_map(const overflow_allocator_type& overflowAllocator)
202  : base_type(fixed_allocator_type(mBuffer, overflowAllocator))
203  {
204  #if EASTL_NAME_ENABLED
205  mAllocator.set_name(EASTL_FIXED_MAP_DEFAULT_NAME);
206  #endif
207  }
208 
209 
210  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
211  inline fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::fixed_map(const Compare& compare)
212  : base_type(compare, fixed_allocator_type(mBuffer))
213  {
214  #if EASTL_NAME_ENABLED
215  mAllocator.set_name(EASTL_FIXED_MAP_DEFAULT_NAME);
216  #endif
217  }
218 
219 
220  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
221  inline fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::fixed_map(const this_type& x)
222  : base_type(x.get_compare(), fixed_allocator_type(mBuffer))
223  {
224  mAllocator.copy_overflow_allocator(x.mAllocator);
225 
226  #if EASTL_NAME_ENABLED
227  mAllocator.set_name(x.mAllocator.get_name());
228  #endif
229 
230  base_type::operator=(x);
231  }
232 
233 
234  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
235  inline fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::fixed_map(this_type&& x)
236  : base_type(x.get_compare(), fixed_allocator_type(mBuffer))
237  {
238  mAllocator.copy_overflow_allocator(x.mAllocator);
239 
240  #if EASTL_NAME_ENABLED
241  mAllocator.set_name(x.mAllocator.get_name());
242  #endif
243 
244  base_type::operator=(x);
245  }
246 
247 
248  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
249  inline fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::fixed_map(this_type&& x, const overflow_allocator_type& overflowAllocator)
250  : base_type(x.get_compare(), fixed_allocator_type(mBuffer, overflowAllocator))
251  {
252  mAllocator.copy_overflow_allocator(x.mAllocator);
253 
254  #if EASTL_NAME_ENABLED
255  mAllocator.set_name(x.mAllocator.get_name());
256  #endif
257 
258  base_type::operator=(x);
259  }
260 
261 
262  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
263  fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::fixed_map(std::initializer_list<value_type> ilist, const overflow_allocator_type& overflowAllocator)
264  : base_type(fixed_allocator_type(mBuffer, overflowAllocator))
265  {
266  #if EASTL_NAME_ENABLED
267  mAllocator.set_name(EASTL_FIXED_MAP_DEFAULT_NAME);
268  #endif
269 
270  insert(ilist.begin(), ilist.end());
271  }
272 
273 
274  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
275  template <typename InputIterator>
276  fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::fixed_map(InputIterator first, InputIterator last)
277  : base_type(fixed_allocator_type(mBuffer))
278  {
279  #if EASTL_NAME_ENABLED
280  mAllocator.set_name(EASTL_FIXED_MAP_DEFAULT_NAME);
281  #endif
282 
283  insert(first, last);
284  }
285 
286 
287  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
288  inline typename fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::this_type&
289  fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::operator=(const this_type& x)
290  {
291  base_type::operator=(x);
292  return *this;
293  }
294 
295 
296  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
297  inline typename fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::this_type&
298  fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::operator=(std::initializer_list<value_type> ilist)
299  {
300  base_type::clear();
301  insert(ilist.begin(), ilist.end());
302  return *this;
303  }
304 
305 
306  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
307  inline typename fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::this_type&
308  fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::operator=(this_type&& x)
309  {
310  base_type::operator=(x);
311  return *this;
312  }
313 
314 
315  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
316  inline void fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::swap(this_type& x)
317  {
318  // Fixed containers use a special swap that can deal with excessively large buffers.
319  eastl::fixed_swap(*this, x);
320  }
321 
322 
323  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
324  inline void fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::reset_lose_memory()
325  {
326  base_type::reset_lose_memory();
327  base_type::get_allocator().reset(mBuffer);
328  }
329 
330 
331  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
332  inline typename fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::size_type
333  fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::max_size() const
334  {
335  return kMaxSize;
336  }
337 
338 
339  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
340  inline const typename fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::overflow_allocator_type&
341  fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::get_overflow_allocator() const EA_NOEXCEPT
342  {
343  return mAllocator.get_overflow_allocator();
344  }
345 
346 
347  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
348  inline typename fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::overflow_allocator_type&
349  fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::get_overflow_allocator() EA_NOEXCEPT
350  {
351  return mAllocator.get_overflow_allocator();
352  }
353 
354 
355  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
356  inline void
357  fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::set_overflow_allocator(const overflow_allocator_type& allocator)
358  {
359  mAllocator.set_overflow_allocator(allocator);
360  }
361 
363  // global operators
365 
366  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
367  inline void swap(fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>& a,
368  fixed_map<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>& b)
369  {
370  // Fixed containers use a special swap that can deal with excessively large buffers.
371  eastl::fixed_swap(a, b);
372  }
373 
374 
375 
376 
378  // fixed_multimap
380 
381  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
382  inline fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::fixed_multimap()
383  : base_type(fixed_allocator_type(mBuffer))
384  {
385  #if EASTL_NAME_ENABLED
386  mAllocator.set_name(EASTL_FIXED_MULTIMAP_DEFAULT_NAME);
387  #endif
388  }
389 
390 
391  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
392  inline fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::fixed_multimap(const overflow_allocator_type& overflowAllocator)
393  : base_type(fixed_allocator_type(mBuffer, overflowAllocator))
394  {
395  #if EASTL_NAME_ENABLED
396  mAllocator.set_name(EASTL_FIXED_MULTIMAP_DEFAULT_NAME);
397  #endif
398  }
399 
400 
401  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
402  inline fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::fixed_multimap(const Compare& compare)
403  : base_type(compare, fixed_allocator_type(mBuffer))
404  {
405  #if EASTL_NAME_ENABLED
406  mAllocator.set_name(EASTL_FIXED_MULTIMAP_DEFAULT_NAME);
407  #endif
408  }
409 
410 
411  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
412  inline fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::fixed_multimap(const this_type& x)
413  : base_type(x.get_compare(), fixed_allocator_type(mBuffer))
414  {
415  mAllocator.copy_overflow_allocator(x.mAllocator);
416 
417  #if EASTL_NAME_ENABLED
418  mAllocator.set_name(x.mAllocator.get_name());
419  #endif
420 
421  base_type::operator=(x);
422  }
423 
424 
425  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
426  inline fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::fixed_multimap(this_type&& x)
427  : base_type(x.get_compare(), fixed_allocator_type(mBuffer))
428  {
429  mAllocator.copy_overflow_allocator(x.mAllocator);
430 
431  #if EASTL_NAME_ENABLED
432  mAllocator.set_name(x.mAllocator.get_name());
433  #endif
434 
435  base_type::operator=(x);
436  }
437 
438 
439  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
440  inline fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::fixed_multimap(this_type&& x, const overflow_allocator_type& overflowAllocator)
441  : base_type(x.get_compare(), fixed_allocator_type(mBuffer, overflowAllocator))
442  {
443  mAllocator.copy_overflow_allocator(x.mAllocator);
444 
445  #if EASTL_NAME_ENABLED
446  mAllocator.set_name(x.mAllocator.get_name());
447  #endif
448 
449  base_type::operator=(x);
450  }
451 
452 
453  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
454  fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::fixed_multimap(std::initializer_list<value_type> ilist, const overflow_allocator_type& overflowAllocator)
455  : base_type(fixed_allocator_type(mBuffer, overflowAllocator))
456  {
457  #if EASTL_NAME_ENABLED
458  mAllocator.set_name(EASTL_FIXED_MULTIMAP_DEFAULT_NAME);
459  #endif
460 
461  insert(ilist.begin(), ilist.end());
462  }
463 
464 
465  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
466  template <typename InputIterator>
467  fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::
468  fixed_multimap(InputIterator first, InputIterator last)
469  : base_type(fixed_allocator_type(mBuffer))
470  {
471  #if EASTL_NAME_ENABLED
472  mAllocator.set_name(EASTL_FIXED_MULTIMAP_DEFAULT_NAME);
473  #endif
474 
475  insert(first, last);
476  }
477 
478 
479  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
480  inline typename fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::this_type&
481  fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::operator=(const this_type& x)
482  {
483  base_type::operator=(x);
484  return *this;
485  }
486 
487 
488  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
489  inline typename fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::this_type&
490  fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::operator=(std::initializer_list<value_type> ilist)
491  {
492  base_type::clear();
493  insert(ilist.begin(), ilist.end());
494  return *this;
495  }
496 
497 
498  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
499  inline typename fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::this_type&
500  fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::operator=(this_type&& x)
501  {
502  base_type::operator=(x);
503  return *this;
504  }
505 
506 
507  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
508  inline void fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::swap(this_type& x)
509  {
510  // Fixed containers use a special swap that can deal with excessively large buffers.
511  eastl::fixed_swap(*this, x);
512  }
513 
514 
515  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
516  inline void fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::reset_lose_memory()
517  {
518  base_type::reset_lose_memory();
519  base_type::get_allocator().reset(mBuffer);
520  }
521 
522 
523  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
524  inline typename fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::size_type
525  fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::max_size() const
526  {
527  return kMaxSize;
528  }
529 
530 
531  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
532  inline const typename fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::overflow_allocator_type&
533  fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::get_overflow_allocator() const EA_NOEXCEPT
534  {
535  return mAllocator.get_overflow_allocator();
536  }
537 
538 
539  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
540  inline typename fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::overflow_allocator_type&
541  fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::get_overflow_allocator() EA_NOEXCEPT
542  {
543  return mAllocator.get_overflow_allocator();
544  }
545 
546 
547  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
548  inline void
549  fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>::set_overflow_allocator(const overflow_allocator_type& allocator)
550  {
551  mAllocator.set_overflow_allocator(allocator);
552  }
553 
554 
556  // global operators
558 
559  template <typename Key, typename T, size_t nodeCount, bool bEnableOverflow, typename Compare, typename OverflowAllocator>
560  inline void swap(fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>& a,
561  fixed_multimap<Key, T, nodeCount, bEnableOverflow, Compare, OverflowAllocator>& b)
562  {
563  // Fixed containers use a special swap that can deal with excessively large buffers.
564  eastl::fixed_swap(a, b);
565  }
566 
567 
568 } // namespace eastl
569 
570 
571 #endif // Header include guard
572 
573 
574 
575 
576 
577 
578 
579 
580 
Definition: allocator.h:52
Definition: fixed_map.h:69
Definition: fixed_map.h:134
insert_return_type insert(const Key &key)
Definition: map.h:556
Definition: fixed_pool.h:607
Definition: map.h:76
Definition: map.h:186
allocator_type mAllocator
Stores the count of nodes in the tree (not counting the anchor node).
Definition: red_black_tree.h:422
Definition: initializer_list.h:38
EA Standard Template Library.
Definition: algorithm.h:288
Definition: utility.h:371
Definition: red_black_tree.h:108