Embedded Template Library 1.0
Loading...
Searching...
No Matches
reference_flat_multimap.h
Go to the documentation of this file.
1
2
3/******************************************************************************
4The MIT License(MIT)
5
6Embedded Template Library.
7https://github.com/ETLCPP/etl
8https://www.etlcpp.com
9
10Copyright(c) 2017 John Wellbelove
11
12Permission is hereby granted, free of charge, to any person obtaining a copy
13of this software and associated documentation files(the "Software"), to deal
14in the Software without restriction, including without limitation the rights
15to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
16copies of the Software, and to permit persons to whom the Software is
17furnished to do so, subject to the following conditions :
18
19The above copyright notice and this permission notice shall be included in all
20copies or substantial portions of the Software.
21
22THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
25AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28SOFTWARE.
29******************************************************************************/
30
31#ifndef ETL_REFERENCE_FLAT_MULTIMAP_INCLUDED
32#define ETL_REFERENCE_FLAT_MULTIMAP_INCLUDED
33
34#include "platform.h"
35#include "debug_count.h"
36#include "error_handler.h"
37#include "exception.h"
38#include "iterator.h"
39#include "nth_type.h"
40#include "type_traits.h"
41#include "vector.h"
42
44
45#include <stddef.h>
46
47namespace etl
48{
49 //***************************************************************************
52 //***************************************************************************
53 class flat_multimap_exception : public exception
54 {
55 public:
56
57 flat_multimap_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
58 : exception(reason_, file_name_, line_number_)
59 {
60 }
61 };
62
63 //***************************************************************************
66 //***************************************************************************
67 class flat_multimap_full : public flat_multimap_exception
68 {
69 public:
70
71 flat_multimap_full(string_type file_name_, numeric_type line_number_)
72 : flat_multimap_exception(ETL_ERROR_TEXT("flat_multimap:full", ETL_REFERENCE_FLAT_MULTIMAP_FILE_ID"A"), file_name_, line_number_)
73 {
74 }
75 };
76
77 //***************************************************************************
82 //***************************************************************************
83 template <typename TKey, typename TMapped, typename TKeyCompare = etl::less<TKey> >
85 {
86 public:
87
88 typedef ETL_OR_STD::pair<const TKey, TMapped> value_type;
89
90 protected:
91
92 typedef etl::ivector<value_type*> lookup_t;
93
94 public:
95
96 typedef TKey key_type;
97 typedef TMapped mapped_type;
98 typedef TKeyCompare key_compare;
99 typedef value_type& reference;
100 typedef const value_type& const_reference;
101 typedef value_type* pointer;
102 typedef const value_type* const_pointer;
103 typedef size_t size_type;
104
105 //*************************************************************************
106 class iterator : public etl::iterator<ETL_OR_STD::bidirectional_iterator_tag, value_type>
107 {
108 public:
109
110 friend class ireference_flat_multimap;
111 friend class const_iterator;
112
113 iterator() {}
114
115 iterator(typename lookup_t::iterator ilookup_)
116 : ilookup(ilookup_)
117 {
118 }
119
120 iterator(const iterator& other)
121 : ilookup(other.ilookup)
122 {
123 }
124
125 iterator& operator=(const iterator& other)
126 {
127 ilookup = other.ilookup;
128 return *this;
129 }
130
131 iterator& operator++()
132 {
133 ++ilookup;
134 return *this;
135 }
136
137 iterator operator++(int)
138 {
139 iterator temp(*this);
140 ++ilookup;
141 return temp;
142 }
143
144 iterator& operator--()
145 {
146 --ilookup;
147 return *this;
148 }
149
150 iterator operator--(int)
151 {
152 iterator temp(*this);
153 --ilookup;
154 return temp;
155 }
156
157 reference operator*() const
158 {
159 return *(*ilookup);
160 }
161
162 pointer operator&() const
163 {
164 return etl::addressof(*(*ilookup));
165 }
166
167 pointer operator->() const
168 {
169 return etl::addressof(*(*ilookup));
170 }
171
172 friend bool operator==(const iterator& lhs, const iterator& rhs)
173 {
174 return lhs.ilookup == rhs.ilookup;
175 }
176
177 friend bool operator!=(const iterator& lhs, const iterator& rhs)
178 {
179 return !(lhs == rhs);
180 }
181
182 private:
183
184 typename lookup_t::iterator ilookup;
185 };
186
187 //*************************************************************************
188 class const_iterator : public etl::iterator<ETL_OR_STD::bidirectional_iterator_tag, const value_type>
189 {
190 public:
191
192 friend class ireference_flat_multimap;
193
194 const_iterator() {}
195
196 const_iterator(typename lookup_t::const_iterator ilookup_)
197 : ilookup(ilookup_)
198 {
199 }
200
201 const_iterator(const typename ireference_flat_multimap::iterator& other)
202 : ilookup(other.ilookup)
203 {
204 }
205
206 const_iterator(const const_iterator& other)
207 : ilookup(other.ilookup)
208 {
209 }
210
211 const_iterator& operator=(const iterator& other)
212 {
213 ilookup = other.ilookup;
214 return *this;
215 }
216
217 const_iterator& operator=(const const_iterator& other)
218 {
219 ilookup = other.ilookup;
220 return *this;
221 }
222
223 const_iterator& operator++()
224 {
225 ++ilookup;
226 return *this;
227 }
228
229 const_iterator operator++(int)
230 {
231 const_iterator temp(*this);
232 ++ilookup;
233 return temp;
234 }
235
236 const_iterator& operator--()
237 {
238 --ilookup;
239 return *this;
240 }
241
242 const_iterator operator--(int)
243 {
244 const_iterator temp(*this);
245 --ilookup;
246 return temp;
247 }
248
249 const_reference operator*() const
250 {
251 return *(*ilookup);
252 }
253
254 const_pointer operator&() const
255 {
256 return etl::addressof(*(*ilookup));
257 }
258
259 const_pointer operator->() const
260 {
261 return etl::addressof(*(*ilookup));
262 }
263
264 friend bool operator==(const const_iterator& lhs, const const_iterator& rhs)
265 {
266 return lhs.ilookup == rhs.ilookup;
267 }
268
269 friend bool operator!=(const const_iterator& lhs, const const_iterator& rhs)
270 {
271 return !(lhs == rhs);
272 }
273
274 private:
275
276 typename lookup_t::const_iterator ilookup;
277 };
278
279 typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
280 typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
281 typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
282
283 protected:
284
285 typedef const TKey& key_parameter_t;
286
287 private:
288
289 //*********************************************************************
291 //*********************************************************************
292 class Compare
293 {
294 public:
295
296 bool operator()(const value_type& element, key_type key) const
297 {
298 return comp(element.first, key);
299 }
300
301 bool operator()(key_type key, const value_type& element) const
302 {
303 return comp(key, element.first);
304 }
305
306#if ETL_USING_CPP11
307 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
308 bool operator()(const value_type& element, const K& key) const
309 {
310 return comp(element.first, key);
311 }
312
313 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
314 bool operator()(const K& key, const value_type& element) const
315 {
316 return comp(key, element.first);
317 }
318#endif
319
320 key_compare comp;
321 };
322
323 public:
324
325 //*********************************************************************
328 //*********************************************************************
329 iterator begin()
330 {
331 return iterator(lookup.begin());
332 }
333
334 //*********************************************************************
338 //*********************************************************************
339 const_iterator begin() const
340 {
341 return const_iterator(lookup.begin());
342 }
343
344 //*********************************************************************
347 //*********************************************************************
348 iterator end()
349 {
350 return iterator(lookup.end());
351 }
352
353 //*********************************************************************
356 //*********************************************************************
357 const_iterator end() const
358 {
359 return const_iterator(lookup.end());
360 }
361
362 //*********************************************************************
366 //*********************************************************************
367 const_iterator cbegin() const
368 {
369 return const_iterator(lookup.cbegin());
370 }
371
372 //*********************************************************************
375 //*********************************************************************
376 const_iterator cend() const
377 {
378 return const_iterator(lookup.cend());
379 }
380
381 //*********************************************************************
385 //*********************************************************************
386 reverse_iterator rbegin()
387 {
388 return reverse_iterator(lookup.rbegin());
389 }
390
391 //*********************************************************************
396 //*********************************************************************
397 const_reverse_iterator rbegin() const
398 {
399 return const_reverse_iterator(lookup.rbegin());
400 }
401
402 //*********************************************************************
406 //*********************************************************************
407 reverse_iterator rend()
408 {
409 return reverse_iterator(lookup.rend());
410 }
411
412 //*********************************************************************
417 //*********************************************************************
418 const_reverse_iterator rend() const
419 {
420 return const_reverse_iterator(lookup.rend());
421 }
422
423 //*********************************************************************
428 //*********************************************************************
429 const_reverse_iterator crbegin() const
430 {
431 return const_reverse_iterator(lookup.crbegin());
432 }
433
434 //*********************************************************************
439 //*********************************************************************
440 const_reverse_iterator crend() const
441 {
442 return const_reverse_iterator(lookup.crend());
443 }
444
445 //*********************************************************************
453 //*********************************************************************
454 template <typename TIterator>
455 void assign(TIterator first, TIterator last)
456 {
457#if ETL_IS_DEBUG_BUILD
458 difference_type d = etl::distance(first, last);
459 ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_multimap_full));
460#endif
461
462 clear();
463
464 while (first != last)
465 {
466 insert(*first);
467 ++first;
468 }
469 }
470
471 //*********************************************************************
476 //*********************************************************************
477 ETL_OR_STD::pair<iterator, bool> insert(value_type& value)
478 {
479 ETL_ASSERT(!lookup.full(), ETL_ERROR(flat_multimap_full));
480
481 ETL_OR_STD::pair<iterator, bool> result(end(), false);
482
483 iterator i_element = upper_bound(value.first);
484
485 return insert_at(i_element, value);
486 }
487
488 //*********************************************************************
494 //*********************************************************************
495 iterator insert(const_iterator /*position*/, const value_type& value)
496 {
497 return insert(value).first;
498 }
499
500 //*********************************************************************
507 //*********************************************************************
508 template <class TIterator>
509 void insert(TIterator first, TIterator last)
510 {
511 while (first != last)
512 {
513 insert(*first);
514 ++first;
515 }
516 }
517
518 //*********************************************************************
522 //*********************************************************************
523 size_t erase(key_parameter_t key)
524 {
525 ETL_OR_STD::pair<iterator, iterator> range = equal_range(key);
526
527 if (range.first == end())
528 {
529 return 0;
530 }
531 else
532 {
533 size_t d = static_cast<size_t>(etl::distance(range.first, range.second));
534 erase(range.first, range.second);
535 return d;
536 }
537 }
538
539#if ETL_USING_CPP11
540 //*********************************************************************
541 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
542 size_t erase(K&& key)
543 {
544 ETL_OR_STD::pair<iterator, iterator> range = equal_range(key);
545
546 if (range.first == end())
547 {
548 return 0U;
549 }
550 else
551 {
552 size_t d = static_cast<size_t>(etl::distance(range.first, range.second));
553 erase(range.first, range.second);
554 return d;
555 }
556 }
557#endif
558
559 //*********************************************************************
562 //*********************************************************************
563 iterator erase(iterator i_element)
564 {
565 return lookup.erase(i_element.ilookup);
566 }
567
568 //*********************************************************************
571 //*********************************************************************
572 iterator erase(const_iterator i_element)
573 {
574 return lookup.erase(i_element.ilookup);
575 }
576
577 //*********************************************************************
583 //*********************************************************************
584 iterator erase(const_iterator first, const_iterator last)
585 {
586 return lookup.erase(first.ilookup, last.ilookup);
587 }
588
589 //*************************************************************************
591 //*************************************************************************
592 void clear()
593 {
594 lookup.clear();
595 }
596
597 //*********************************************************************
601 //*********************************************************************
602 iterator find(key_parameter_t key)
603 {
604 iterator itr = lower_bound(key);
605
606 if (itr != end())
607 {
608 if (!key_compare()(itr->first, key) && !key_compare()(key, itr->first))
609 {
610 return itr;
611 }
612 else
613 {
614 return end();
615 }
616 }
617
618 return end();
619 }
620
621#if ETL_USING_CPP11
622 //*********************************************************************
623 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
624 iterator find(const K& key)
625 {
626 iterator itr = lower_bound(key);
627
628 if (itr != end())
629 {
630 if (!key_compare()(itr->first, key) && !key_compare()(key, itr->first))
631 {
632 return itr;
633 }
634 else
635 {
636 return end();
637 }
638 }
639
640 return end();
641 }
642#endif
643
644 //*********************************************************************
648 //*********************************************************************
649 const_iterator find(key_parameter_t key) const
650 {
651 const_iterator itr = lower_bound(key);
652
653 if (itr != end())
654 {
655 if (!key_compare()(itr->first, key) && !key_compare()(key, itr->first))
656 {
657 return itr;
658 }
659 else
660 {
661 return end();
662 }
663 }
664
665 return end();
666 }
667
668#if ETL_USING_CPP11
669 //*********************************************************************
670 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
671 const_iterator find(const K& key) const
672 {
673 const_iterator itr = lower_bound(key);
674
675 if (itr != end())
676 {
677 if (!key_compare()(itr->first, key) && !key_compare()(key, itr->first))
678 {
679 return itr;
680 }
681 else
682 {
683 return end();
684 }
685 }
686
687 return end();
688 }
689#endif
690
691 //*********************************************************************
695 //*********************************************************************
696 size_t count(key_parameter_t key) const
697 {
698 ETL_OR_STD::pair<const_iterator, const_iterator> range = equal_range(key);
699
700 return static_cast<size_t>(etl::distance(range.first, range.second));
701 }
702
703#if ETL_USING_CPP11
704 //*********************************************************************
705 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
706 size_t count(const K& key) const
707 {
708 ETL_OR_STD::pair<const_iterator, const_iterator> range = equal_range(key);
709
710 return static_cast<size_t>(etl::distance(range.first, range.second));
711 }
712#endif
713
714 //*********************************************************************
718 //*********************************************************************
719 iterator lower_bound(key_parameter_t key)
720 {
721 return etl::lower_bound(begin(), end(), key, compare);
722 }
723
724#if ETL_USING_CPP11
725 //*********************************************************************
726 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
727 iterator lower_bound(const K& key)
728 {
729 return etl::lower_bound(begin(), end(), key, compare);
730 }
731#endif
732
733 //*********************************************************************
737 //*********************************************************************
738 const_iterator lower_bound(key_parameter_t key) const
739 {
740 return etl::lower_bound(cbegin(), cend(), key, compare);
741 }
742
743#if ETL_USING_CPP11
744 //*********************************************************************
745 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
746 const_iterator lower_bound(const K& key) const
747 {
748 return etl::lower_bound(cbegin(), cend(), key, compare);
749 }
750#endif
751
752 //*********************************************************************
756 //*********************************************************************
757 iterator upper_bound(key_parameter_t key)
758 {
759 return etl::upper_bound(begin(), end(), key, compare);
760 }
761
762#if ETL_USING_CPP11
763 //*********************************************************************
764 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
765 iterator upper_bound(const K& key)
766 {
767 return etl::upper_bound(begin(), end(), key, compare);
768 }
769#endif
770
771 //*********************************************************************
775 //*********************************************************************
776 const_iterator upper_bound(key_parameter_t key) const
777 {
778 return etl::upper_bound(begin(), end(), key, compare);
779 }
780
781#if ETL_USING_CPP11
782 //*********************************************************************
783 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
784 const_iterator upper_bound(const K& key) const
785 {
786 return etl::upper_bound(begin(), end(), key, compare);
787 }
788#endif
789
790 //*********************************************************************
794 //*********************************************************************
795 ETL_OR_STD::pair<iterator, iterator> equal_range(key_parameter_t key)
796 {
797 iterator i_lower = etl::lower_bound(begin(), end(), key, compare);
798
799 return ETL_OR_STD::make_pair(i_lower, etl::upper_bound(i_lower, end(), key, compare));
800 }
801
802#if ETL_USING_CPP11
803 //*********************************************************************
804 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
805 ETL_OR_STD::pair<iterator, iterator> equal_range(const K& key)
806 {
807 iterator i_lower = etl::lower_bound(begin(), end(), key, compare);
808
809 return ETL_OR_STD::make_pair(i_lower, etl::upper_bound(i_lower, end(), key, compare));
810 }
811#endif
812
813 //*********************************************************************
817 //*********************************************************************
818 ETL_OR_STD::pair<const_iterator, const_iterator> equal_range(key_parameter_t key) const
819 {
820 const_iterator i_lower = etl::lower_bound(cbegin(), cend(), key, compare);
821
822 return ETL_OR_STD::make_pair(i_lower, etl::upper_bound(i_lower, cend(), key, compare));
823 }
824
825#if ETL_USING_CPP11
826 //*********************************************************************
827 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
828 ETL_OR_STD::pair<const_iterator, const_iterator> equal_range(const K& key) const
829 {
830 const_iterator i_lower = etl::lower_bound(cbegin(), cend(), key, compare);
831
832 return ETL_OR_STD::make_pair(i_lower, etl::upper_bound(i_lower, cend(), key, compare));
833 }
834#endif
835
836 //*************************************************************************
838 //*************************************************************************
839 bool contains(const TKey& key) const
840 {
841 return find(key) != end();
842 }
843
844#if ETL_USING_CPP11
845 //*************************************************************************
846 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
847 bool contains(const K& k) const
848 {
849 return find(k) != end();
850 }
851#endif
852
853 //*************************************************************************
856 //*************************************************************************
857 size_type size() const
858 {
859 return lookup.size();
860 }
861
862 //*************************************************************************
865 //*************************************************************************
866 bool empty() const
867 {
868 return lookup.empty();
869 }
870
871 //*************************************************************************
874 //*************************************************************************
875 bool full() const
876 {
877 return lookup.full();
878 }
879
880 //*************************************************************************
883 //*************************************************************************
884 size_type capacity() const
885 {
886 return lookup.capacity();
887 }
888
889 //*************************************************************************
892 //*************************************************************************
893 size_type max_size() const
894 {
895 return lookup.max_size();
896 }
897
898 //*************************************************************************
901 //*************************************************************************
902 size_t available() const
903 {
904 return lookup.available();
905 }
906
907 protected:
908
909 //*********************************************************************
911 //*********************************************************************
912 ireference_flat_multimap(lookup_t& lookup_)
913 : lookup(lookup_)
914 {
915 }
916
917 //*********************************************************************
921 //*********************************************************************
922 ETL_OR_STD::pair<iterator, bool> insert_at(iterator i_element, value_type& value)
923 {
924 ETL_OR_STD::pair<iterator, bool> result(end(), false);
925
926 if (i_element == end())
927 {
928 // At the end.
929 lookup.push_back(&value);
930 result.first = --end();
931 result.second = true;
932 }
933 else
934 {
935 // Not at the end.
936 lookup.insert(i_element.ilookup, &value);
937 result.first = i_element;
938 result.second = true;
939 }
940
941 return result;
942 }
943
944 private:
945
946 // Disable copy construction and assignment.
949
950 lookup_t& lookup;
951
952 Compare compare;
953
954 //*************************************************************************
956 //*************************************************************************
957#if defined(ETL_POLYMORPHIC_REFERENCE_FLAT_MULTIMAP) || defined(ETL_POLYMORPHIC_CONTAINERS)
958
959 public:
960
961 virtual ~ireference_flat_multimap() {}
962#else
963
964 protected:
965
967#endif
968 };
969
970 //***************************************************************************
976 //***************************************************************************
977 template <typename TKey, typename TMapped, typename TKeyCompare>
980 {
981 return (lhs.size() == rhs.size()) && etl::equal(lhs.begin(), lhs.end(), rhs.begin());
982 }
983
984 //***************************************************************************
990 //***************************************************************************
991 template <typename TKey, typename TMapped, typename TKeyCompare>
997
998 //***************************************************************************
1005 //***************************************************************************
1006 template <typename TKey, typename TValue, const size_t MAX_SIZE_, typename TCompare = etl::less<TKey> >
1007 class reference_flat_multimap : public ireference_flat_multimap<TKey, TValue, TCompare>
1008 {
1009 public:
1010
1011 static ETL_CONSTANT size_t MAX_SIZE = MAX_SIZE_;
1012
1013 //*************************************************************************
1015 //*************************************************************************
1017 : ireference_flat_multimap<TKey, TValue, TCompare>(lookup)
1018 {
1019 }
1020
1021 //*************************************************************************
1023 //*************************************************************************
1025 : ireference_flat_multimap<TKey, TValue, TCompare>(lookup)
1026 {
1028 }
1029
1030 //*************************************************************************
1035 //*************************************************************************
1036 template <typename TIterator>
1037 reference_flat_multimap(TIterator first, TIterator last)
1038 : ireference_flat_multimap<TKey, TValue, TCompare>(lookup)
1039 {
1041 }
1042
1043 //*************************************************************************
1045 //*************************************************************************
1050
1051 private:
1052
1053 typedef typename ireference_flat_multimap<TKey, TValue, TCompare>::value_type node_t;
1054
1055 // The vector that stores pointers to the nodes.
1057 };
1058
1059 template <typename TKey, typename TValue, const size_t MAX_SIZE_, typename TCompare>
1060 ETL_CONSTANT size_t reference_flat_multimap< TKey, TValue, MAX_SIZE_, TCompare>::MAX_SIZE;
1061
1062 //*************************************************************************
1064 //*************************************************************************
1065#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST
1066 template <typename... TPairs>
1067 reference_flat_multimap(TPairs...) -> reference_flat_multimap< typename etl::nth_type_t<0, TPairs...>::first_type,
1068 typename etl::nth_type_t<0, TPairs...>::second_type, sizeof...(TPairs)>;
1069#endif
1070
1071 //*************************************************************************
1073 //*************************************************************************
1074#if ETL_USING_CPP11 && ETL_HAS_INITIALIZER_LIST
1075 template <typename TKey, typename TMapped, typename TKeyCompare = etl::less<TKey>, typename... TPairs>
1076 constexpr auto make_reference_flat_multimap(TPairs&&... pairs) -> etl::reference_flat_multimap<TKey, TMapped, sizeof...(TPairs), TKeyCompare>
1077 {
1078 return {etl::forward<TPairs>(pairs)...};
1079 }
1080#endif
1081} // namespace etl
1082
1083#endif
Definition reference_flat_multimap.h:68
Definition reference_flat_multimap.h:107
Definition reference_flat_multimap.h:85
const_reverse_iterator crbegin() const
Definition reference_flat_multimap.h:429
iterator erase(const_iterator i_element)
Definition reference_flat_multimap.h:572
size_t count(key_parameter_t key) const
Definition reference_flat_multimap.h:696
ETL_OR_STD::pair< iterator, iterator > equal_range(key_parameter_t key)
Definition reference_flat_multimap.h:795
iterator lower_bound(key_parameter_t key)
Definition reference_flat_multimap.h:719
const_iterator find(key_parameter_t key) const
Definition reference_flat_multimap.h:649
reverse_iterator rbegin()
Definition reference_flat_multimap.h:386
const_reverse_iterator crend() const
Definition reference_flat_multimap.h:440
iterator upper_bound(key_parameter_t key)
Definition reference_flat_multimap.h:757
bool empty() const
Definition reference_flat_multimap.h:866
const_reverse_iterator rbegin() const
Definition reference_flat_multimap.h:397
const_iterator cbegin() const
Definition reference_flat_multimap.h:367
size_type size() const
Definition reference_flat_multimap.h:857
ETL_OR_STD::pair< iterator, bool > insert_at(iterator i_element, value_type &value)
Definition reference_flat_multimap.h:922
size_t available() const
Definition reference_flat_multimap.h:902
iterator erase(const_iterator first, const_iterator last)
Definition reference_flat_multimap.h:584
iterator insert(const_iterator, const value_type &value)
Definition reference_flat_multimap.h:495
bool full() const
Definition reference_flat_multimap.h:875
size_t erase(key_parameter_t key)
Definition reference_flat_multimap.h:523
bool contains(const TKey &key) const
Check if the map contains the key.
Definition reference_flat_multimap.h:839
~ireference_flat_multimap()
Destructor.
Definition reference_flat_multimap.h:966
const_iterator end() const
Definition reference_flat_multimap.h:357
const_iterator upper_bound(key_parameter_t key) const
Definition reference_flat_multimap.h:776
const_reverse_iterator rend() const
Definition reference_flat_multimap.h:418
iterator begin()
Definition reference_flat_multimap.h:329
ETL_OR_STD::pair< iterator, bool > insert(value_type &value)
Definition reference_flat_multimap.h:477
iterator end()
Definition reference_flat_multimap.h:348
iterator find(key_parameter_t key)
Definition reference_flat_multimap.h:602
const_iterator cend() const
Definition reference_flat_multimap.h:376
size_type max_size() const
Definition reference_flat_multimap.h:893
void clear()
Clears the reference_flat_multimap.
Definition reference_flat_multimap.h:592
ETL_OR_STD::pair< const_iterator, const_iterator > equal_range(key_parameter_t key) const
Definition reference_flat_multimap.h:818
void insert(TIterator first, TIterator last)
Definition reference_flat_multimap.h:509
ireference_flat_multimap(lookup_t &lookup_)
Constructor.
Definition reference_flat_multimap.h:912
void assign(TIterator first, TIterator last)
Definition reference_flat_multimap.h:455
size_type capacity() const
Definition reference_flat_multimap.h:884
iterator erase(iterator i_element)
Definition reference_flat_multimap.h:563
reverse_iterator rend()
Definition reference_flat_multimap.h:407
const_iterator lower_bound(key_parameter_t key) const
Definition reference_flat_multimap.h:738
const_iterator begin() const
Definition reference_flat_multimap.h:339
Definition reference_flat_multimap.h:1008
~reference_flat_multimap()
Destructor.
Definition reference_flat_multimap.h:1046
reference_flat_multimap()
Constructor.
Definition reference_flat_multimap.h:1016
reference_flat_multimap(const reference_flat_multimap &other)
Copy constructor.
Definition reference_flat_multimap.h:1024
reference_flat_multimap(TIterator first, TIterator last)
Definition reference_flat_multimap.h:1037
ETL_CONSTEXPR14 bool operator!=(const etl::bitset< Active_Bits, TElement > &lhs, const etl::bitset< Active_Bits, TElement > &rhs) ETL_NOEXCEPT
Definition bitset_new.h:2529
#define ETL_ASSERT(b, e)
Definition error_handler.h:511
ETL_EXCEPTION_CONSTEXPR exception(string_type reason_, string_type, numeric_type)
Constructor.
Definition exception.h:81
ETL_CONSTEXPR17 etl::enable_if<!etl::is_same< T, etl::nullptr_t >::value, T >::type * addressof(T &t)
Definition addressof.h:52
Definition vector.h:71
Definition vector.h:1277
bitset_ext
Definition absolute.h:40
ETL_CONSTEXPR14 bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1081
ETL_CONSTEXPR14 bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1093
ETL_CONSTEXPR TContainer::iterator end(TContainer &container)
Definition iterator.h:997
Definition compare.h:51
iterator
Definition iterator.h:424