Embedded Template Library  1.0
flat_multimap.h
Go to the documentation of this file.
1 
3 /******************************************************************************
4 The MIT License(MIT)
5 
6 Embedded Template Library.
7 https://github.com/ETLCPP/etl
8 https://www.etlcpp.com
9 
10 Copyright(c) 2015 jwellbelove
11 
12 Permission is hereby granted, free of charge, to any person obtaining a copy
13 of this software and associated documentation files(the "Software"), to deal
14 in the Software without restriction, including without limitation the rights
15 to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
16 copies of the Software, and to permit persons to whom the Software is
17 furnished to do so, subject to the following conditions :
18 
19 The above copyright notice and this permission notice shall be included in all
20 copies or substantial portions of the Software.
21 
22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
25 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 SOFTWARE.
29 ******************************************************************************/
30 
31 #ifndef ETL_FLAT_MULTMAP_INCLUDED
32 #define ETL_FLAT_MULTMAP_INCLUDED
33 
34 #include "platform.h"
36 #include "pool.h"
37 #include "utility.h"
38 #include "placement_new.h"
39 
40 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && ETL_USING_STL
41  #include <initializer_list>
42 #endif
43 
44 #undef ETL_FILE
45 #define ETL_FILE "3"
46 
47 //*****************************************************************************
53 //*****************************************************************************
54 
55 namespace etl
56 {
57  //***************************************************************************
61  //***************************************************************************
62  template <typename TKey, typename TMapped, typename TKeyCompare = etl::less<TKey> >
63  class iflat_multimap : public etl::ireference_flat_multimap<TKey, TMapped, TKeyCompare>
64  {
65  public:
66 
67  typedef ETL_OR_STD::pair<const TKey, TMapped> value_type;
68 
69  private:
70 
72  typedef typename refmap_t::lookup_t lookup_t;
73  typedef etl::ipool storage_t;
74 
75  public:
76 
77  typedef TKey key_type;
78  typedef TMapped mapped_type;
79  typedef TKeyCompare key_compare;
80  typedef value_type& reference;
81  typedef const value_type& const_reference;
82 #if ETL_CPP11_SUPPORTED
83  typedef value_type&& rvalue_reference;
84 #endif
85  typedef value_type* pointer;
86  typedef const value_type* const_pointer;
87  typedef size_t size_type;
88 
89  typedef typename refmap_t::iterator iterator;
91 
92  typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
93  typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
94  typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
95 
96  protected:
97 
98  typedef const key_type& key_parameter_t;
99 
100  private:
101 
102  //*********************************************************************
104  //*********************************************************************
105  class compare
106  {
107  public:
108 
109  bool operator ()(const value_type& element, key_type key) const
110  {
111  return comp(element.first, key);
112  }
113 
114  bool operator ()(key_type key, const value_type& element) const
115  {
116  return comp(key, element.first);
117  }
118 
119  key_compare comp;
120  };
121 
122  public:
123 
124  //*********************************************************************
127  //*********************************************************************
129  {
130  return refmap_t::begin();
131  }
132 
133  //*********************************************************************
136  //*********************************************************************
138  {
139  return refmap_t::begin();
140  }
141 
142  //*********************************************************************
145  //*********************************************************************
147  {
148  return refmap_t::end();
149  }
150 
151  //*********************************************************************
154  //*********************************************************************
156  {
157  return refmap_t::end();
158  }
159 
160  //*********************************************************************
163  //*********************************************************************
165  {
166  return refmap_t::cbegin();
167  }
168 
169  //*********************************************************************
172  //*********************************************************************
174  {
175  return refmap_t::cend();
176  }
177 
178  //*********************************************************************
181  //*********************************************************************
182  reverse_iterator rbegin()
183  {
184  return refmap_t::rbegin();
185  }
186 
187  //*********************************************************************
190  //*********************************************************************
191  const_reverse_iterator rbegin() const
192  {
193  return refmap_t::rbegin();
194  }
195 
196  //*********************************************************************
199  //*********************************************************************
200  reverse_iterator rend()
201  {
202  return refmap_t::rend();
203  }
204 
205  //*********************************************************************
208  //*********************************************************************
209  const_reverse_iterator rend() const
210  {
211  refmap_t::rend();
212  }
213 
214  //*********************************************************************
217  //*********************************************************************
218  const_reverse_iterator crbegin() const
219  {
220  return refmap_t::crbegin();
221  }
222 
223  //*********************************************************************
226  //*********************************************************************
227  const_reverse_iterator crend() const
228  {
229  return refmap_t::crend();
230  }
231 
232  //*********************************************************************
238  //*********************************************************************
239  template <typename TIterator>
240  void assign(TIterator first, TIterator last)
241  {
242 #if defined(ETL_DEBUG)
243  difference_type d = etl::distance(first, last);
244  ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_multimap_full));
245 #endif
246 
247  clear();
248 
249  while (first != last)
250  {
251  insert(*first++);
252  }
253  }
254 
255  //*********************************************************************
259  //*********************************************************************
260  ETL_OR_STD::pair<iterator, bool> insert(const value_type& value)
261  {
263 
264  ETL_OR_STD::pair<iterator, bool> result(end(), false);
265 
266  iterator i_element = lower_bound(value.first);
267 
268  value_type* pvalue = storage.allocate<value_type>();
269  ::new (pvalue) value_type(value);
270  ETL_INCREMENT_DEBUG_COUNT
271  result = refmap_t::insert_at(i_element, *pvalue);
272 
273  return result;
274  }
275 
276 #if ETL_CPP11_SUPPORTED
277  //*********************************************************************
281  //*********************************************************************
282  ETL_OR_STD::pair<iterator, bool> insert(rvalue_reference value)
283  {
285 
286  ETL_OR_STD::pair<iterator, bool> result(end(), false);
287 
288  iterator i_element = lower_bound(value.first);
289 
290  value_type* pvalue = storage.allocate<value_type>();
291  ::new (pvalue) value_type(etl::move(value));
292  ETL_INCREMENT_DEBUG_COUNT
293  result = refmap_t::insert_at(i_element, *pvalue);
294 
295  return result;
296  }
297 #endif
298 
299  //*********************************************************************
304  //*********************************************************************
305  iterator insert(iterator position, const value_type& value)
306  {
307  return insert(value).first;
308  }
309 
310 #if ETL_CPP11_SUPPORTED
311  //*********************************************************************
316  //*********************************************************************
317  iterator insert(iterator position, rvalue_reference value)
318  {
319  return insert(etl::move(value)).first;
320  }
321 #endif
322 
323  //*********************************************************************
329  //*********************************************************************
330  template <class TIterator>
331  void insert(TIterator first, TIterator last)
332  {
333  while (first != last)
334  {
335  insert(*first++);
336  }
337  }
338 
339  //*************************************************************************
341  //*************************************************************************
342  ETL_OR_STD::pair<iterator, bool> emplace(const value_type& value)
343  {
344  return insert(value);
345  }
346 
347  //*************************************************************************
349  //*************************************************************************
350  ETL_OR_STD::pair<iterator, bool> emplace(const key_type& key, const mapped_type& value)
351  {
352  ETL_ASSERT(!full(), ETL_ERROR(flat_multimap_full));
353 
354  // Create it.
355  value_type* pvalue = storage.allocate<value_type>();
356  ::new ((void*)etl::addressof(pvalue->first)) key_type(key);
357  ::new ((void*)etl::addressof(pvalue->second)) mapped_type(value);
358  iterator i_element = lower_bound(key);
359  ETL_INCREMENT_DEBUG_COUNT
360 
361  return refmap_t::insert_at(i_element, *pvalue);
362  }
363 
364 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT
365  //*************************************************************************
367  //*************************************************************************
368  template <typename ... Args>
369  ETL_OR_STD::pair<iterator, bool> emplace(const key_type& key, Args && ... args)
370  {
371  ETL_ASSERT(!full(), ETL_ERROR(flat_multimap_full));
372 
373  // Create it.
374  value_type* pvalue = storage.allocate<value_type>();
375  ::new ((void*)etl::addressof(pvalue->first)) key_type(key);
376  ::new ((void*)etl::addressof(pvalue->second)) mapped_type(etl::forward<Args>(args)...);
377  iterator i_element = lower_bound(key);
378  ETL_INCREMENT_DEBUG_COUNT
379 
380  return refmap_t::insert_at(i_element, *pvalue);
381  }
382 
383 #else
384  //*************************************************************************
386  //*************************************************************************
387  template <typename T1>
388  ETL_OR_STD::pair<iterator, bool> emplace(const key_type& key, const T1& value1)
389  {
390  ETL_ASSERT(!full(), ETL_ERROR(flat_multimap_full));
391 
392  // Create it.
393  value_type* pvalue = storage.allocate<value_type>();
394  ::new ((void*)etl::addressof(pvalue->first)) key_type(key);
395  ::new ((void*)etl::addressof(pvalue->second)) mapped_type(value1);
396  iterator i_element = lower_bound(key);
397  ETL_INCREMENT_DEBUG_COUNT
398 
399  return refmap_t::insert_at(i_element, *pvalue);
400  }
401 
402  //*************************************************************************
404  //*************************************************************************
405  template <typename T1, typename T2>
406  ETL_OR_STD::pair<iterator, bool> emplace(const key_type& key, const T1& value1, const T2& value2)
407  {
408  ETL_ASSERT(!full(), ETL_ERROR(flat_multimap_full));
409 
410  // Create it.
411  value_type* pvalue = storage.allocate<value_type>();
412  ::new ((void*)etl::addressof(pvalue->first)) key_type(key);
413  ::new ((void*)etl::addressof(pvalue->second)) mapped_type(value1, value2);
414  iterator i_element = lower_bound(key);
415  ETL_INCREMENT_DEBUG_COUNT
416 
417  return refmap_t::insert_at(i_element, *pvalue);
418  }
419 
420  //*************************************************************************
422  //*************************************************************************
423  template <typename T1, typename T2, typename T3>
424  ETL_OR_STD::pair<iterator, bool> emplace(const key_type& key, const T1& value1, const T2& value2, const T3& value3)
425  {
426  ETL_ASSERT(!full(), ETL_ERROR(flat_multimap_full));
427 
428  // Create it.
429  value_type* pvalue = storage.allocate<value_type>();
430  ::new ((void*)etl::addressof(pvalue->first)) key_type(key);
431  ::new ((void*)etl::addressof(pvalue->second)) mapped_type(value1, value2, value3);
432  iterator i_element = lower_bound(key);
433  ETL_INCREMENT_DEBUG_COUNT
434 
435  return refmap_t::insert_at(i_element, *pvalue);
436  }
437 
438  //*************************************************************************
440  //*************************************************************************
441  template <typename T1, typename T2, typename T3, typename T4>
442  ETL_OR_STD::pair<iterator, bool> emplace(const key_type& key, const T1& value1, const T2& value2, const T3& value3, const T4& value4)
443  {
444  ETL_ASSERT(!full(), ETL_ERROR(flat_multimap_full));
445 
446  // Create it.
447  value_type* pvalue = storage.allocate<value_type>();
448  ::new ((void*)etl::addressof(pvalue->first)) key_type(key);
449  ::new ((void*)etl::addressof(pvalue->second)) mapped_type(value1, value2, value3, value4);
450  iterator i_element = lower_bound(key);
451  ETL_INCREMENT_DEBUG_COUNT
452 
453  return refmap_t::insert_at(i_element, *pvalue);
454  }
455 
456 #endif
457 
458  //*********************************************************************
462  //*********************************************************************
463  size_t erase(key_parameter_t key)
464  {
465  ETL_OR_STD::pair<iterator, iterator> range = equal_range(key);
466 
467  if (range.first == end())
468  {
469  return 0;
470  }
471  else
472  {
473  size_t d = etl::distance(range.first, range.second);
474  erase(range.first, range.second);
475  return d;
476  }
477  }
478 
479  //*********************************************************************
482  //*********************************************************************
483  void erase(iterator i_element)
484  {
485  i_element->~value_type();
486  storage.release(etl::addressof(*i_element));
487  refmap_t::erase(i_element);
488  ETL_DECREMENT_DEBUG_COUNT
489  }
490 
491  //*********************************************************************
497  //*********************************************************************
498  void erase(iterator first, iterator last)
499  {
500  iterator itr = first;
501 
502  while (itr != last)
503  {
504  itr->~value_type();
505  storage.release(etl::addressof(*itr));
506  ++itr;
507  ETL_DECREMENT_DEBUG_COUNT
508  }
509 
510  refmap_t::erase(first, last);
511  }
512 
513  //*************************************************************************
515  //*************************************************************************
516  void clear()
517  {
519  {
520  storage.release_all();
521  }
522  else
523  {
524  iterator itr = begin();
525 
526  while (itr != end())
527  {
528  itr->~value_type();
529  storage.release(etl::addressof(*itr));
530  ++itr;
531  }
532  }
533 
534  ETL_RESET_DEBUG_COUNT
535  refmap_t::clear();
536  }
537 
538  //*********************************************************************
542  //*********************************************************************
543  iterator find(key_parameter_t key)
544  {
545  return refmap_t::find(key);
546  }
547 
548  //*********************************************************************
552  //*********************************************************************
553  const_iterator find(key_parameter_t key) const
554  {
555  return refmap_t::find(key);
556  }
557 
558  //*********************************************************************
562  //*********************************************************************
563  size_t count(key_parameter_t key) const
564  {
565  return refmap_t::count(key);
566  }
567 
568  //*********************************************************************
572  //*********************************************************************
573  iterator lower_bound(key_parameter_t key)
574  {
575  return refmap_t::lower_bound(key);
576  }
577 
578  //*********************************************************************
582  //*********************************************************************
583  const_iterator lower_bound(key_parameter_t key) const
584  {
585  return refmap_t::lower_bound(key);
586  }
587 
588  //*********************************************************************
592  //*********************************************************************
593  iterator upper_bound(key_parameter_t key)
594  {
595  return refmap_t::upper_bound(key);
596  }
597 
598  //*********************************************************************
602  //*********************************************************************
603  const_iterator upper_bound(key_parameter_t key) const
604  {
605  return refmap_t::upper_bound(key);
606  }
607 
608  //*********************************************************************
612  //*********************************************************************
613  ETL_OR_STD::pair<iterator, iterator> equal_range(key_parameter_t key)
614  {
615  return refmap_t::equal_range(key);
616  }
617 
618  //*********************************************************************
622  //*********************************************************************
623  ETL_OR_STD::pair<const_iterator, const_iterator> equal_range(key_parameter_t key) const
624  {
625  return refmap_t::equal_range(key);
626  }
627 
628  //*************************************************************************
630  //*************************************************************************
632  {
633  if (&rhs != this)
634  {
635  assign(rhs.cbegin(), rhs.cend());
636  }
637 
638  return *this;
639  }
640 
641 #if ETL_CPP11_SUPPORTED
642  //*************************************************************************
644  //*************************************************************************
646  {
647  move_container(etl::move(rhs));
648 
649  return *this;
650  }
651 #endif
652 
653  //*************************************************************************
656  //*************************************************************************
657  size_type size() const
658  {
659  return refmap_t::size();
660  }
661 
662  //*************************************************************************
665  //*************************************************************************
666  bool empty() const
667  {
668  return refmap_t::empty();
669  }
670 
671  //*************************************************************************
674  //*************************************************************************
675  bool full() const
676  {
677  return refmap_t::full();
678  }
679 
680  //*************************************************************************
683  //*************************************************************************
684  size_type capacity() const
685  {
686  return refmap_t::capacity();
687  }
688 
689  //*************************************************************************
692  //*************************************************************************
693  size_type max_size() const
694  {
695  return refmap_t::max_size();
696  }
697 
698  //*************************************************************************
701  //*************************************************************************
702  size_t available() const
703  {
704  return refmap_t::available();
705  }
706 
707  protected:
708 
709  //*********************************************************************
711  //*********************************************************************
712  iflat_multimap(lookup_t& lookup_, storage_t& storage_)
713  : refmap_t(lookup_),
714  storage(storage_)
715  {
716  }
717 
718 #if ETL_CPP11_SUPPORTED
719  //*************************************************************************
722  //*************************************************************************
723  void move_container(iflat_multimap&& rhs)
724  {
725  if (&rhs != this)
726  {
727  this->clear();
728 
731 
732  // Add all of the elements.
733  while (first != last)
734  {
735  this->insert(etl::move(*first++));
736  }
737  }
738  }
739 #endif
740 
741  private:
742 
743  // Disable copy construction.
745 
746  storage_t& storage;
747 
749  ETL_DECLARE_DEBUG_COUNT
750 
751  //*************************************************************************
753  //*************************************************************************
754 #if defined(ETL_POLYMORPHIC_FLAT_MULTIMAP) || defined(ETL_POLYMORPHIC_CONTAINERS)
755  public:
756  virtual ~iflat_multimap()
757  {
758  }
759 #else
760  protected:
762  {
763  }
764 #endif
765  };
766 
767  //***************************************************************************
773  //***************************************************************************
774  template <typename TKey, typename TMapped, typename TKeyCompare>
776  {
777  return (lhs.size() == rhs.size()) && etl::equal(lhs.begin(), lhs.end(), rhs.begin());
778  }
779 
780  //***************************************************************************
786  //***************************************************************************
787  template <typename TKey, typename TMapped, typename TKeyCompare>
789  {
790  return !(lhs == rhs);
791  }
792 
793  //***************************************************************************
800  //***************************************************************************
801  template <typename TKey, typename TValue, const size_t MAX_SIZE_, typename TCompare = etl::less<TKey> >
802  class flat_multimap : public etl::iflat_multimap<TKey, TValue, TCompare>
803  {
804  public:
805 
806  static const size_t MAX_SIZE = MAX_SIZE_;
807 
808  //*************************************************************************
810  //*************************************************************************
812  : etl::iflat_multimap<TKey, TValue, TCompare>(lookup, storage)
813  {
814  }
815 
816  //*************************************************************************
818  //*************************************************************************
820  : etl::iflat_multimap<TKey, TValue, TCompare>(lookup, storage)
821  {
822  this->assign(other.cbegin(), other.cend());
823  }
824 
825 #if ETL_CPP11_SUPPORTED
826  //*************************************************************************
828  //*************************************************************************
830  : etl::iflat_multimap<TKey, TValue, TCompare>(lookup, storage)
831  {
832  if (&other != this)
833  {
834  this->move_container(etl::move(other));
835  }
836  }
837 #endif
838 
839  //*************************************************************************
844  //*************************************************************************
845  template <typename TIterator>
846  flat_multimap(TIterator first, TIterator last)
847  : etl::iflat_multimap<TKey, TValue, TCompare>(lookup, storage)
848  {
849  this->assign(first, last);
850  }
851 
852 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && ETL_USING_STL
853  //*************************************************************************
855  //*************************************************************************
856  flat_multimap(std::initializer_list<typename etl::iflat_multimap<TKey, TValue, TCompare>::value_type> init)
857  : etl::iflat_multimap<TKey, TValue, TCompare>(lookup, storage)
858  {
859  this->assign(init.begin(), init.end());
860  }
861 #endif
862 
863  //*************************************************************************
865  //*************************************************************************
867  {
868  this->clear();
869  }
870 
871  //*************************************************************************
873  //*************************************************************************
875  {
876  if (&rhs != this)
877  {
878  this->assign(rhs.cbegin(), rhs.cend());
879  }
880 
881  return *this;
882  }
883 
884 #if ETL_CPP11_SUPPORTED
885  //*************************************************************************
887  //*************************************************************************
889  {
890  if (&rhs != this)
891  {
892  this->move_container(etl::move(rhs));
893  }
894 
895  return *this;
896  }
897 #endif
898 
899  private:
900 
901  typedef typename etl::iflat_multimap<TKey, TValue, TCompare>::value_type node_t;
902 
903  // The pool of nodes.
905 
906  // The vector that stores pointers to the nodes.
908  };
909 
910  //*************************************************************************
912  //*************************************************************************
913 #if ETL_CPP17_SUPPORTED && ETL_NOT_USING_STLPORT && ETL_USING_STL
914  template <typename T, typename... Ts>
915  flat_multimap(T, Ts...)
916  ->flat_multimap<etl::enable_if_t<(etl::is_same_v<T, Ts> && ...), typename T::first_type>,
917  etl::enable_if_t<(etl::is_same_v<T, Ts> && ...), typename T::second_type>,
918  1U + sizeof...(Ts)>;
919 #endif
920 }
921 
922 #undef ETL_FILE
923 
924 #endif
Definition: reference_flat_multimap.h:67
Definition: reference_flat_multimap.h:204
Definition: reference_flat_multimap.h:105
Definition: reference_flat_multimap.h:83
const_reverse_iterator crbegin() const
Definition: reference_flat_multimap.h:422
size_t count(key_parameter_t key) const
Definition: reference_flat_multimap.h:605
iterator lower_bound(key_parameter_t key)
Definition: reference_flat_multimap.h:617
reverse_iterator rbegin()
Definition: reference_flat_multimap.h:386
const_reverse_iterator crend() const
Definition: reference_flat_multimap.h:431
iterator upper_bound(key_parameter_t key)
Definition: reference_flat_multimap.h:637
bool empty() const
Definition: reference_flat_multimap.h:689
const_iterator cbegin() const
Definition: reference_flat_multimap.h:368
size_type size() const
Definition: reference_flat_multimap.h:680
ETL_OR_STD::pair< iterator, iterator > equal_range(key_parameter_t key)
Definition: reference_flat_multimap.h:657
size_t available() const
Definition: reference_flat_multimap.h:725
bool full() const
Definition: reference_flat_multimap.h:698
size_t erase(key_parameter_t key)
Definition: reference_flat_multimap.h:507
ETL_OR_STD::pair< iterator, bool > insert_at(iterator i_element, value_type &value)
Definition: reference_flat_multimap.h:745
iterator begin()
Definition: reference_flat_multimap.h:332
iterator end()
Definition: reference_flat_multimap.h:350
iterator find(key_parameter_t key)
Definition: reference_flat_multimap.h:557
const_iterator cend() const
Definition: reference_flat_multimap.h:377
size_type max_size() const
Definition: reference_flat_multimap.h:716
void clear()
Clears the reference_flat_multimap.
Definition: reference_flat_multimap.h:547
size_type capacity() const
Definition: reference_flat_multimap.h:707
reverse_iterator rend()
Definition: reference_flat_multimap.h:404
#define ETL_ASSERT(b, e)
Definition: error_handler.h:290
const_iterator begin() const
Definition: flat_multimap.h:137
ETL_OR_STD::pair< iterator, bool > emplace(const key_type &key, const T1 &value1, const T2 &value2)
Emplaces a value to the map.
Definition: flat_multimap.h:406
const_reverse_iterator crbegin() const
Definition: flat_multimap.h:218
reverse_iterator rbegin()
Definition: flat_multimap.h:182
iterator end()
Definition: flat_multimap.h:146
size_type capacity() const
Definition: flat_multimap.h:684
size_type size() const
Definition: flat_multimap.h:657
const_iterator cbegin() const
Definition: flat_multimap.h:164
iterator find(key_parameter_t key)
Definition: flat_multimap.h:543
const_iterator upper_bound(key_parameter_t key) const
Definition: flat_multimap.h:603
size_t available() const
Definition: flat_multimap.h:702
ETL_OR_STD::pair< iterator, bool > emplace(const key_type &key, const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
Emplaces a value to the map.
Definition: flat_multimap.h:442
flat_multimap(TIterator first, TIterator last)
Definition: flat_multimap.h:846
const_reverse_iterator rbegin() const
Definition: flat_multimap.h:191
ETL_OR_STD::pair< iterator, bool > emplace(const key_type &key, const T1 &value1)
Emplaces a value to the map.
Definition: flat_multimap.h:388
bool full() const
Definition: flat_multimap.h:675
const_iterator find(key_parameter_t key) const
Definition: flat_multimap.h:553
size_type max_size() const
Definition: flat_multimap.h:693
iflat_multimap & operator=(const iflat_multimap &rhs)
Assignment operator.
Definition: flat_multimap.h:631
ETL_OR_STD::pair< iterator, bool > emplace(const key_type &key, const T1 &value1, const T2 &value2, const T3 &value3)
Emplaces a value to the map.
Definition: flat_multimap.h:424
iterator upper_bound(key_parameter_t key)
Definition: flat_multimap.h:593
const_reverse_iterator rend() const
Definition: flat_multimap.h:209
iflat_multimap(lookup_t &lookup_, storage_t &storage_)
Constructor.
Definition: flat_multimap.h:712
size_t erase(key_parameter_t key)
Definition: flat_multimap.h:463
const_iterator end() const
Definition: flat_multimap.h:155
ETL_OR_STD::pair< const_iterator, const_iterator > equal_range(key_parameter_t key) const
Definition: flat_multimap.h:623
flat_multimap()
Constructor.
Definition: flat_multimap.h:811
const_reverse_iterator crend() const
Definition: flat_multimap.h:227
iterator insert(iterator position, const value_type &value)
Definition: flat_multimap.h:305
iterator begin()
Definition: flat_multimap.h:128
const_iterator cend() const
Definition: flat_multimap.h:173
void clear()
Clears the flat_multimap.
Definition: flat_multimap.h:516
reverse_iterator rend()
Definition: flat_multimap.h:200
ETL_OR_STD::pair< iterator, iterator > equal_range(key_parameter_t key)
Definition: flat_multimap.h:613
const_iterator lower_bound(key_parameter_t key) const
Definition: flat_multimap.h:583
~flat_multimap()
Destructor.
Definition: flat_multimap.h:866
void assign(TIterator first, TIterator last)
Definition: flat_multimap.h:240
void erase(iterator i_element)
Definition: flat_multimap.h:483
~iflat_multimap()
Internal debugging.
Definition: flat_multimap.h:761
ETL_OR_STD::pair< iterator, bool > insert(const value_type &value)
Definition: flat_multimap.h:260
void erase(iterator first, iterator last)
Definition: flat_multimap.h:498
flat_multimap(const flat_multimap &other)
Copy constructor.
Definition: flat_multimap.h:819
iterator lower_bound(key_parameter_t key)
Definition: flat_multimap.h:573
bool empty() const
Definition: flat_multimap.h:666
ETL_OR_STD::pair< iterator, bool > emplace(const key_type &key, const mapped_type &value)
Emplaces a value to the map.
Definition: flat_multimap.h:350
ETL_OR_STD::pair< iterator, bool > emplace(const value_type &value)
Emplaces a value to the map.
Definition: flat_multimap.h:342
void insert(TIterator first, TIterator last)
Definition: flat_multimap.h:331
size_t count(key_parameter_t key) const
Definition: flat_multimap.h:563
Definition: flat_multimap.h:803
Definition: flat_multimap.h:64
T * addressof(T &t)
Definition: memory.h:61
void release_all()
Release all objects in the pool.
Definition: pool.h:264
void release(const void *const p_object)
Definition: pool.h:255
T * allocate()
Definition: pool.h:129
Definition: pool.h:118
is_trivially_destructible
Definition: type_traits_generator.h:1171
Definition: vector.h:80
Definition: absolute.h:37
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:594
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:582
iterator
Definition: iterator.h:422