Embedded Template Library 1.0
flat_multiset.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) 2015 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_FLAT_MULTISET_INCLUDED
32#define ETL_FLAT_MULTISET_INCLUDED
33
34#include "platform.h"
36#include "pool.h"
37#include "placement_new.h"
38#include "nth_type.h"
39#include "type_traits.h"
40#include "initializer_list.h"
41
43
44//*****************************************************************************
50//*****************************************************************************
51
52namespace etl
53{
54 //***************************************************************************
58 //***************************************************************************
59 template <typename T, typename TKeyCompare = etl::less<T> >
60 class iflat_multiset : private etl::ireference_flat_multiset<T, TKeyCompare>
61 {
62 private:
63
65 typedef typename refset_t::lookup_t lookup_t;
66 typedef etl::ipool storage_t;
67
68 typedef const T& key_parameter_t;
69
70 public:
71
72 typedef T key_type;
73 typedef T value_type;
74 typedef TKeyCompare key_compare;
75 typedef value_type& reference;
76 typedef const value_type& const_reference;
77#if ETL_USING_CPP11
78 typedef value_type&& rvalue_reference;
79#endif
80 typedef value_type* pointer;
81 typedef const value_type* const_pointer;
82 typedef size_t size_type;
83
84 typedef typename refset_t::iterator iterator;
86
87 typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
88 typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
89 typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
90
91 public:
92
93 //*********************************************************************
96 //*********************************************************************
98 {
99 return refset_t::begin();
100 }
101
102 //*********************************************************************
105 //*********************************************************************
107 {
108 return refset_t::begin();
109 }
110
111 //*********************************************************************
114 //*********************************************************************
116 {
117 return refset_t::end();
118 }
119
120 //*********************************************************************
123 //*********************************************************************
125 {
126 return refset_t::end();
127 }
128
129 //*********************************************************************
132 //*********************************************************************
134 {
135 return refset_t::cbegin();
136 }
137
138 //*********************************************************************
141 //*********************************************************************
143 {
144 return refset_t::cend();
145 }
146
147 //*********************************************************************
150 //*********************************************************************
151 reverse_iterator rbegin()
152 {
153 return refset_t::rbegin();
154 }
155
156 //*********************************************************************
159 //*********************************************************************
160 const_reverse_iterator rbegin() const
161 {
162 return refset_t::rbegin();
163 }
164
165 //*********************************************************************
168 //*********************************************************************
169 reverse_iterator rend()
170 {
171 return refset_t::rend();
172 }
173
174 //*********************************************************************
177 //*********************************************************************
178 const_reverse_iterator rend() const
179 {
180 return refset_t::rend();
181 }
182
183 //*********************************************************************
186 //*********************************************************************
187 const_reverse_iterator crbegin() const
188 {
189 return refset_t::crbegin();
190 }
191
192 //*********************************************************************
195 //*********************************************************************
196 const_reverse_iterator crend() const
197 {
198 return refset_t::crend();
199 }
200
201 //*********************************************************************
207 //*********************************************************************
208 template <typename TIterator>
209 void assign(TIterator first, TIterator last)
210 {
211#if ETL_IS_DEBUG_BUILD
212 difference_type d = etl::distance(first, last);
213 ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_multiset_full));
214#endif
215
216 clear();
217
218 while (first != last)
219 {
220 insert(*first);
221 ++first;
222 }
223 }
224
225 //*********************************************************************
229 //*********************************************************************
230 ETL_OR_STD::pair<iterator, bool> insert(const_reference value)
231 {
232 ETL_OR_STD::pair<iterator, bool> result(end(), false);
233
234 ETL_ASSERT(!full(), ETL_ERROR(flat_multiset_full));
235
236 iterator i_element = etl::upper_bound(begin(), end(), value, compare);
237
238 value_type* pvalue = storage.allocate<value_type>();
239 ::new (pvalue) value_type(value);
240 ETL_INCREMENT_DEBUG_COUNT
241 result = refset_t::insert_at(i_element, *pvalue);
242
243 return result;
244 }
245
246#if ETL_USING_CPP11
247 //*********************************************************************
251 //*********************************************************************
252 ETL_OR_STD::pair<iterator, bool> insert(rvalue_reference value)
253 {
254 ETL_OR_STD::pair<iterator, bool> result(end(), false);
255
256 ETL_ASSERT(!full(), ETL_ERROR(flat_multiset_full));
257
258 iterator i_element = etl::upper_bound(begin(), end(), value, compare);
259
260 value_type* pvalue = storage.allocate<value_type>();
261 ::new (pvalue) value_type(etl::move(value));
262 ETL_INCREMENT_DEBUG_COUNT
263 result = refset_t::insert_at(i_element, *pvalue);
264
265 return result;
266 }
267#endif
268
269 //*********************************************************************
274 //*********************************************************************
275 iterator insert(const_iterator /*position*/, const_reference value)
276 {
277 return insert(value).first;
278 }
279
280#if ETL_USING_CPP11
281 //*********************************************************************
286 //*********************************************************************
287 iterator insert(const_iterator /*position*/, rvalue_reference value)
288 {
289 return insert(etl::move(value)).first;
290 }
291#endif
292
293 //*********************************************************************
299 //*********************************************************************
300 template <class TIterator>
301 void insert(TIterator first, TIterator last)
302 {
303 while (first != last)
304 {
305 insert(*first);
306 ++first;
307 }
308 }
309
310 //*************************************************************************
312 //*************************************************************************
313 template <typename T1>
314 ETL_OR_STD::pair<iterator, bool> emplace(const_reference value)
315 {
316 return insert(value);
317 }
318
319 //*************************************************************************
321 //*************************************************************************
322#if ETL_USING_CPP11 && ETL_NOT_USING_STLPORT
323 template <typename ... Args>
324 ETL_OR_STD::pair<iterator, bool> emplace(Args && ... args)
325 {
326 ETL_ASSERT(!full(), ETL_ERROR(flat_multiset_full));
327
328 // Create it.
329 value_type* pvalue = storage.allocate<value_type>();
330 ::new (pvalue) value_type(etl::forward<Args>(args)...);
331
332 iterator i_element = upper_bound(*pvalue);
333
334 ETL_INCREMENT_DEBUG_COUNT
335 return ETL_OR_STD::pair<iterator, bool>(refset_t::insert_at(i_element, *pvalue));
336 }
337#else
338 //*************************************************************************
340 //*************************************************************************
341 template <typename T1>
342 ETL_OR_STD::pair<iterator, bool> emplace(const T1& value1)
343 {
344 ETL_ASSERT(!full(), ETL_ERROR(flat_multiset_full));
345
346 // Create it.
347 value_type* pvalue = storage.allocate<value_type>();
348 ::new (pvalue) value_type(value1);
349
350 iterator i_element = upper_bound(*pvalue);
351
352 ETL_INCREMENT_DEBUG_COUNT
353 return ETL_OR_STD::pair<iterator, bool>(refset_t::insert_at(i_element, *pvalue));
354 }
355
356 //*************************************************************************
358 //*************************************************************************
359 template <typename T1, typename T2>
360 ETL_OR_STD::pair<iterator, bool> emplace(const T1& value1, const T2& value2)
361 {
362 ETL_ASSERT(!full(), ETL_ERROR(flat_multiset_full));
363
364 // Create it.
365 value_type* pvalue = storage.allocate<value_type>();
366 ::new (pvalue) value_type(value1, value2);
367
368 iterator i_element = upper_bound(*pvalue);
369
370 ETL_INCREMENT_DEBUG_COUNT
371 return ETL_OR_STD::pair<iterator, bool>(refset_t::insert_at(i_element, *pvalue));
372 }
373
374 //*************************************************************************
376 //*************************************************************************
377 template <typename T1, typename T2, typename T3>
378 ETL_OR_STD::pair<iterator, bool> emplace(const T1& value1, const T2& value2, const T3& value3)
379 {
380 ETL_ASSERT(!full(), ETL_ERROR(flat_multiset_full));
381
382 // Create it.
383 value_type* pvalue = storage.allocate<value_type>();
384 ::new (pvalue) value_type(value1, value2, value3);
385
386 iterator i_element = upper_bound(*pvalue);
387
388 ETL_INCREMENT_DEBUG_COUNT
389 return ETL_OR_STD::pair<iterator, bool>(refset_t::insert_at(i_element, *pvalue));
390 }
391
392 //*************************************************************************
394 //*************************************************************************
395 template <typename T1, typename T2, typename T3, typename T4>
396 ETL_OR_STD::pair<iterator, bool> emplace(const T1& value1, const T2& value2, const T3& value3, const T4& value4)
397 {
398 ETL_ASSERT(!full(), ETL_ERROR(flat_multiset_full));
399
400 // Create it.
401 value_type* pvalue = storage.allocate<value_type>();
402 ::new (pvalue) value_type(value1, value2, value3, value4);
403
404 iterator i_element = upper_bound(*pvalue);
405
406 ETL_INCREMENT_DEBUG_COUNT
407 return ETL_OR_STD::pair<iterator, bool>(refset_t::insert_at(i_element, *pvalue));
408 }
409#endif
410
411 //*********************************************************************
415 //*********************************************************************
416 size_t erase(key_parameter_t key)
417 {
418 ETL_OR_STD::pair<iterator, iterator> range = equal_range(key);
419
420 if (range.first == end())
421 {
422 return 0;
423 }
424 else
425 {
426 size_t d = etl::distance(range.first, range.second);
427 erase(range.first, range.second);
428 return d;
429 }
430 }
431
432#if ETL_USING_CPP11
433 //*********************************************************************
434 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
435 size_t erase(K&& key)
436 {
437 ETL_OR_STD::pair<iterator, iterator> range = equal_range(etl::forward<K>(key));
438
439 if (range.first == end())
440 {
441 return 0;
442 }
443 else
444 {
445 size_t d = etl::distance(range.first, range.second);
446 erase(range.first, range.second);
447 return d;
448 }
449 }
450#endif
451
452 //*********************************************************************
455 //*********************************************************************
457 {
458 etl::destroy_at(etl::addressof(*i_element));
459 storage.release(etl::addressof(*i_element));
460 ETL_DECREMENT_DEBUG_COUNT
461 return refset_t::erase(i_element);
462 }
463
464 //*********************************************************************
467 //*********************************************************************
469 {
470 etl::destroy_at(etl::addressof(*i_element));
471 storage.release(etl::addressof(*i_element));
472 ETL_DECREMENT_DEBUG_COUNT
473 return refset_t::erase(i_element);
474 }
475
476 //*********************************************************************
482 //*********************************************************************
484 {
485 const_iterator itr = first;
486
487 while (itr != last)
488 {
490 storage.release(etl::addressof(*itr));
491 ++itr;
492 ETL_DECREMENT_DEBUG_COUNT
493 }
494
495 return refset_t::erase(first, last);
496 }
497
498 //*************************************************************************
500 //*************************************************************************
501 void clear()
502 {
504 {
505 storage.release_all();
506 }
507 else
508 {
509 iterator itr = begin();
510
511 while (itr != end())
512 {
514 storage.release(etl::addressof(*itr));
515 ++itr;
516 }
517 }
518
519 ETL_RESET_DEBUG_COUNT
521 }
522
523 //*********************************************************************
527 //*********************************************************************
528 iterator find(key_parameter_t key)
529 {
530 return refset_t::find(key);
531 }
532
533#if ETL_USING_CPP11
534 //*********************************************************************
535 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
536 iterator find(const K& key)
537 {
538 return refset_t::find(key);
539 }
540#endif
541
542 //*********************************************************************
546 //*********************************************************************
547 const_iterator find(key_parameter_t key) const
548 {
549 return refset_t::find(key);
550 }
551
552#if ETL_USING_CPP11
553 //*********************************************************************
554 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
555 const_iterator find(const K& key) const
556 {
557 return refset_t::find(key);
558 }
559#endif
560
561 //*********************************************************************
565 //*********************************************************************
566 size_t count(key_parameter_t key) const
567 {
568 return refset_t::count(key);
569 }
570
571#if ETL_USING_CPP11
572 //*********************************************************************
573 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
574 size_t count(const K& key) const
575 {
576 return refset_t::count(key);
577 }
578#endif
579
580 //*********************************************************************
584 //*********************************************************************
585 iterator lower_bound(key_parameter_t key)
586 {
587 return refset_t::lower_bound(key);
588 }
589
590#if ETL_USING_CPP11
591 //*********************************************************************
592 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
593 iterator lower_bound(const K& key)
594 {
595 return refset_t::lower_bound(key);
596 }
597#endif
598
599 //*********************************************************************
603 //*********************************************************************
604 const_iterator lower_bound(key_parameter_t key) const
605 {
606 return refset_t::lower_bound(key);
607 }
608
609#if ETL_USING_CPP11
610 //*********************************************************************
611 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
612 const_iterator lower_bound(const K& key) const
613 {
614 return refset_t::lower_bound(key);
615 }
616#endif
617
618 //*********************************************************************
622 //*********************************************************************
623 iterator upper_bound(key_parameter_t key)
624 {
625 return refset_t::upper_bound(key);
626 }
627
628#if ETL_USING_CPP11
629 //*********************************************************************
630 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
631 iterator upper_bound(const K& key)
632 {
633 return refset_t::upper_bound(key);
634 }
635#endif
636
637 //*********************************************************************
641 //*********************************************************************
642 const_iterator upper_bound(key_parameter_t key) const
643 {
644 return refset_t::upper_bound(key);
645 }
646
647#if ETL_USING_CPP11
648 //*********************************************************************
649 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
650 const_iterator upper_bound(const K& key) const
651 {
652 return refset_t::upper_bound(key);
653 }
654#endif
655
656 //*********************************************************************
660 //*********************************************************************
661 ETL_OR_STD::pair<iterator, iterator> equal_range(key_parameter_t key)
662 {
663 return refset_t::equal_range(key);
664 }
665
666#if ETL_USING_CPP11
667 //*********************************************************************
668 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
669 ETL_OR_STD::pair<iterator, iterator> equal_range(const K& key)
670 {
671 return refset_t::equal_range(key);
672 }
673#endif
674
675 //*********************************************************************
679 //*********************************************************************
680 ETL_OR_STD::pair<const_iterator, const_iterator> equal_range(key_parameter_t key) const
681 {
682 return refset_t::equal_range(key);
683 }
684
685#if ETL_USING_CPP11
686 //*********************************************************************
687 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
688 ETL_OR_STD::pair<const_iterator, const_iterator> equal_range(const K& key) const
689 {
690 return refset_t::equal_range(key);
691 }
692#endif
693
694 //*************************************************************************
696 //*************************************************************************
697 bool contains(key_parameter_t key) const
698 {
699 return find(key) != end();
700 }
701
702#if ETL_USING_CPP11
703 //*************************************************************************
704 template <typename K, typename KC = TKeyCompare, etl::enable_if_t<comparator_is_transparent<KC>::value, int> = 0>
705 bool contains(const K& k) const
706 {
707 return find(k) != end();
708 }
709#endif
710
711 //*************************************************************************
713 //*************************************************************************
715 {
716 if (&rhs != this)
717 {
718 assign(rhs.cbegin(), rhs.cend());
719 }
720
721 return *this;
722 }
723
724#if ETL_USING_CPP11
725 //*************************************************************************
727 //*************************************************************************
729 {
730 move_container(etl::move(rhs));
731
732 return *this;
733 }
734#endif
735
736 //*************************************************************************
739 //*************************************************************************
740 size_type size() const
741 {
742 return refset_t::size();
743 }
744
745 //*************************************************************************
748 //*************************************************************************
749 bool empty() const
750 {
751 return refset_t::empty();
752 }
753
754 //*************************************************************************
757 //*************************************************************************
758 bool full() const
759 {
760 return refset_t::full();
761 }
762
763 //*************************************************************************
766 //*************************************************************************
767 size_type capacity() const
768 {
769 return refset_t::capacity();
770 }
771
772 //*************************************************************************
775 //*************************************************************************
776 size_type max_size() const
777 {
778 return refset_t::max_size();
779 }
780
781 //*************************************************************************
784 //*************************************************************************
785 size_t available() const
786 {
787 return refset_t::available();
788 }
789
790 protected:
791
792 //*********************************************************************
794 //*********************************************************************
795 iflat_multiset(lookup_t& lookup_, storage_t& storage_)
796 : refset_t(lookup_),
797 storage(storage_)
798 {
799 }
800
801#if ETL_USING_CPP11
802 //*************************************************************************
805 //*************************************************************************
806 void move_container(iflat_multiset&& rhs)
807 {
808 if (&rhs != this)
809 {
810 this->clear();
811
814
815 // Move all of the elements.
816 while (first != last)
817 {
819 ++temp;
820
821 this->insert(etl::move(*first));
822 first = temp;
823 }
824 }
825 }
826#endif
827
828 private:
829
830 // Disable copy construction.
832
833 storage_t& storage;
834
835 TKeyCompare compare;
836
838 ETL_DECLARE_DEBUG_COUNT
839
840 //*************************************************************************
842 //*************************************************************************
843#if defined(ETL_POLYMORPHIC_FLAT_MULTISET) || defined(ETL_POLYMORPHIC_CONTAINERS)
844 public:
845 virtual ~iflat_multiset()
846 {
847 }
848#else
849 protected:
851 {
852 }
853#endif
854 };
855
856 //***************************************************************************
862 //***************************************************************************
863 template <typename T, typename TKeyCompare>
865 {
866 return (lhs.size() == rhs.size()) && etl::equal(lhs.begin(), lhs.end(), rhs.begin());
867 }
868
869 //***************************************************************************
875 //***************************************************************************
876 template <typename T, typename TKeyCompare>
878 {
879 return !(lhs == rhs);
880 }
881
882 //***************************************************************************
888 //***************************************************************************
889 template <typename T, const size_t MAX_SIZE_, typename TCompare = etl::less<T> >
890 class flat_multiset : public etl::iflat_multiset<T, TCompare>
891 {
892 public:
893
894 static ETL_CONSTANT size_t MAX_SIZE = MAX_SIZE_;
895
896 //*************************************************************************
898 //*************************************************************************
900 : etl::iflat_multiset<T, TCompare>(lookup, storage)
901 {
902 }
903
904 //*************************************************************************
906 //*************************************************************************
908 : iflat_multiset<T, TCompare>(lookup, storage)
909 {
910 this->assign(other.cbegin(), other.cend());
911 }
912
913#if ETL_USING_CPP11
914 //*************************************************************************
916 //*************************************************************************
918 : etl::iflat_multiset<T, TCompare>(lookup, storage)
919 {
920 if (&other != this)
921 {
922 this->move_container(etl::move(other));
923 }
924 }
925#endif
926
927 //*************************************************************************
932 //*************************************************************************
933 template <typename TIterator>
934 flat_multiset(TIterator first, TIterator last)
935 : iflat_multiset<T, TCompare>(lookup, storage)
936 {
937 this->assign(first, last);
938 }
939
940#if ETL_HAS_INITIALIZER_LIST
941 //*************************************************************************
943 //*************************************************************************
944 flat_multiset(std::initializer_list<T> init)
945 : iflat_multiset<T, TCompare>(lookup, storage)
946 {
947 this->assign(init.begin(), init.end());
948 }
949#endif
950
951 //*************************************************************************
953 //*************************************************************************
955 {
956 this->clear();
957 }
958
959 //*************************************************************************
961 //*************************************************************************
963 {
964 if (&rhs != this)
965 {
966 this->assign(rhs.cbegin(), rhs.cend());
967 }
968
969 return *this;
970 }
971
972#if ETL_USING_CPP11
973 //*************************************************************************
975 //*************************************************************************
977 {
978 if (&rhs != this)
979 {
980 this->move_container(etl::move(rhs));
981 }
982
983 return *this;
984 }
985#endif
986
987 private:
988
989 typedef typename etl::iflat_multiset<T, TCompare>::value_type node_t;
990
991 // The pool of nodes.
993
994 // The vector that stores pointers to the nodes.
996 };
997
998 template <typename T,const size_t MAX_SIZE_, typename TCompare>
999 ETL_CONSTANT size_t flat_multiset<T, MAX_SIZE_, TCompare>::MAX_SIZE;
1000
1001 //*************************************************************************
1003 //*************************************************************************
1004#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST
1005 template <typename... T>
1006 flat_multiset(T...) -> flat_multiset<etl::nth_type_t<0, T...>, sizeof...(T)>;
1007#endif
1008
1009 //*************************************************************************
1011 //*************************************************************************
1012#if ETL_USING_CPP11 && ETL_HAS_INITIALIZER_LIST
1013 template <typename TKey, typename TKeyCompare = etl::less<TKey>, typename... T>
1014 constexpr auto make_flat_multiset(T&&... keys) -> etl::flat_multiset<TKey, sizeof...(T), TKeyCompare>
1015 {
1016 return { {etl::forward<T>(keys)...} };
1017 }
1018#endif
1019}
1020
1021#endif
Definition: reference_flat_multiset.h:71
Definition: reference_flat_multiset.h:204
Definition: reference_flat_multiset.h:121
Definition: reference_flat_multiset.h:101
iterator upper_bound(parameter_t key)
Definition: reference_flat_multiset.h:736
size_t count(parameter_t key) const
Definition: reference_flat_multiset.h:675
ETL_OR_STD::pair< iterator, bool > insert_at(iterator i_element, reference value)
Definition: reference_flat_multiset.h:884
iterator begin()
Definition: reference_flat_multiset.h:310
reverse_iterator rbegin()
Definition: reference_flat_multiset.h:364
size_t erase(parameter_t key)
Definition: reference_flat_multiset.h:502
bool empty() const
Definition: reference_flat_multiset.h:828
reverse_iterator rend()
Definition: reference_flat_multiset.h:382
size_t available() const
Definition: reference_flat_multiset.h:864
iterator find(parameter_t key)
Definition: reference_flat_multiset.h:581
size_type size() const
Definition: reference_flat_multiset.h:819
bool full() const
Definition: reference_flat_multiset.h:837
void clear()
Clears the reference_flat_multiset.
Definition: reference_flat_multiset.h:571
iterator end()
Definition: reference_flat_multiset.h:328
iterator lower_bound(parameter_t key)
Definition: reference_flat_multiset.h:698
ETL_OR_STD::pair< iterator, iterator > equal_range(parameter_t key)
Definition: reference_flat_multiset.h:774
size_type capacity() const
Definition: reference_flat_multiset.h:846
const_reverse_iterator crbegin() const
Definition: reference_flat_multiset.h:400
const_reverse_iterator crend() const
Definition: reference_flat_multiset.h:409
const_iterator cend() const
Definition: reference_flat_multiset.h:355
size_type max_size() const
Definition: reference_flat_multiset.h:855
const_iterator cbegin() const
Definition: reference_flat_multiset.h:346
#define ETL_ASSERT(b, e)
Definition: error_handler.h:316
void clear()
Clears the flat_multiset.
Definition: flat_multiset.h:501
ETL_OR_STD::pair< iterator, iterator > equal_range(key_parameter_t key)
Definition: flat_multiset.h:661
const_reverse_iterator crbegin() const
Definition: flat_multiset.h:187
ETL_OR_STD::pair< const_iterator, const_iterator > equal_range(key_parameter_t key) const
Definition: flat_multiset.h:680
const_iterator end() const
Definition: flat_multiset.h:124
iterator erase(const_iterator i_element)
Definition: flat_multiset.h:468
const_reverse_iterator rbegin() const
Definition: flat_multiset.h:160
const_reverse_iterator rend() const
Definition: flat_multiset.h:178
iterator erase(iterator i_element)
Definition: flat_multiset.h:456
flat_multiset()
Constructor.
Definition: flat_multiset.h:899
iflat_multiset(lookup_t &lookup_, storage_t &storage_)
Constructor.
Definition: flat_multiset.h:795
iterator begin()
Definition: flat_multiset.h:97
void insert(TIterator first, TIterator last)
Definition: flat_multiset.h:301
ETL_OR_STD::pair< iterator, bool > insert(const_reference value)
Definition: flat_multiset.h:230
const_iterator cend() const
Definition: flat_multiset.h:142
iterator erase(const_iterator first, const_iterator last)
Definition: flat_multiset.h:483
iterator lower_bound(key_parameter_t key)
Definition: flat_multiset.h:585
void assign(TIterator first, TIterator last)
Definition: flat_multiset.h:209
ETL_OR_STD::pair< iterator, bool > emplace(const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
Emplaces a value to the set.
Definition: flat_multiset.h:396
~iflat_multiset()
Internal debugging.
Definition: flat_multiset.h:850
iterator find(key_parameter_t key)
Definition: flat_multiset.h:528
const_iterator find(key_parameter_t key) const
Definition: flat_multiset.h:547
bool contains(key_parameter_t key) const
Check if the map contains the key.
Definition: flat_multiset.h:697
const_iterator lower_bound(key_parameter_t key) const
Definition: flat_multiset.h:604
ETL_OR_STD::pair< iterator, bool > emplace(const T1 &value1, const T2 &value2, const T3 &value3)
Emplaces a value to the set.
Definition: flat_multiset.h:378
size_t count(key_parameter_t key) const
Definition: flat_multiset.h:566
reverse_iterator rend()
Definition: flat_multiset.h:169
bool empty() const
Definition: flat_multiset.h:749
~flat_multiset()
Destructor.
Definition: flat_multiset.h:954
const_reverse_iterator crend() const
Definition: flat_multiset.h:196
flat_multiset(TIterator first, TIterator last)
Definition: flat_multiset.h:934
size_type max_size() const
Definition: flat_multiset.h:776
ETL_OR_STD::pair< iterator, bool > emplace(const_reference value)
Emplaces a value to the set.
Definition: flat_multiset.h:314
const_iterator upper_bound(key_parameter_t key) const
Definition: flat_multiset.h:642
ETL_OR_STD::pair< iterator, bool > emplace(const T1 &value1)
Emplaces a value to the set.
Definition: flat_multiset.h:342
size_type capacity() const
Definition: flat_multiset.h:767
flat_multiset & operator=(const flat_multiset &rhs)
Assignment operator.
Definition: flat_multiset.h:962
iterator end()
Definition: flat_multiset.h:115
const_iterator begin() const
Definition: flat_multiset.h:106
const_iterator cbegin() const
Definition: flat_multiset.h:133
reverse_iterator rbegin()
Definition: flat_multiset.h:151
bool full() const
Definition: flat_multiset.h:758
size_t erase(key_parameter_t key)
Definition: flat_multiset.h:416
iterator upper_bound(key_parameter_t key)
Definition: flat_multiset.h:623
size_type size() const
Definition: flat_multiset.h:740
ETL_OR_STD::pair< iterator, bool > emplace(const T1 &value1, const T2 &value2)
Emplaces a value to the set.
Definition: flat_multiset.h:360
size_t available() const
Definition: flat_multiset.h:785
flat_multiset(const flat_multiset &other)
Copy constructor.
Definition: flat_multiset.h:907
iterator insert(const_iterator, const_reference value)
Definition: flat_multiset.h:275
iflat_multiset & operator=(const iflat_multiset &rhs)
Assignment operator.
Definition: flat_multiset.h:714
Definition: flat_multiset.h:891
Definition: flat_multiset.h:61
etl::enable_if< etl::is_trivially_destructible< T >::value, void >::type destroy_at(T *)
Definition: memory.h:1006
ETL_CONSTEXPR17 T * addressof(T &t)
Definition: addressof.h:51
void release_all()
Release all objects in the pool.
Definition: ipool.h:248
T * allocate()
Definition: ipool.h:113
void release(const void *const p_object)
Definition: ipool.h:239
Definition: ipool.h:102
bitset_ext
Definition: absolute.h:38
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:645
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:633
Definition: compare.h:52
Definition: type_traits_generator.h:2055
iterator
Definition: iterator.h:399