Embedded Template Library 1.0
Loading...
Searching...
No Matches
flat_set.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_SET_INCLUDED
32#define ETL_FLAT_SET_INCLUDED
33
34#include "platform.h"
35#include "reference_flat_set.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_set : private etl::ireference_flat_set<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;
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_set_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 {
233
234 ETL_OR_STD::pair<iterator, bool> result(i_element, false);
235
236 // Doesn't already exist?
237 if ((i_element == end()) || compare(value, *i_element))
238 {
240
241 value_type* pvalue = storage.allocate<value_type>();
242 ::new (pvalue) value_type(value);
243 ETL_INCREMENT_DEBUG_COUNT;
245 }
246
247 return result;
248 }
249
250#if ETL_USING_CPP11
251 //*********************************************************************
255 //*********************************************************************
256 ETL_OR_STD::pair<iterator, bool> insert(rvalue_reference value)
257 {
259
260 ETL_OR_STD::pair<iterator, bool> result(i_element, false);
261
262 // Doesn't already exist?
263 if ((i_element == end()) || compare(value, *i_element))
264 {
266
267 value_type* pvalue = storage.allocate<value_type>();
268 ::new (pvalue) value_type(etl::move(value));
269 ETL_INCREMENT_DEBUG_COUNT;
271 }
272
273 return result;
274 }
275#endif
276
277 //*********************************************************************
282 //*********************************************************************
283 iterator insert(const_iterator /*position*/, const_reference value)
284 {
285 return insert(value).first;
286 }
287
288#if ETL_USING_CPP11
289 //*********************************************************************
294 //*********************************************************************
295 iterator insert(const_iterator /*position*/, rvalue_reference value)
296 {
297 return insert(etl::move(value)).first;
298 }
299#endif
300
301 //*********************************************************************
307 //*********************************************************************
308 template <class TIterator>
309 void insert(TIterator first, TIterator last)
310 {
311 while (first != last)
312 {
313 insert(*first);
314 ++first;
315 }
316 }
317
318 //*************************************************************************
320 //*************************************************************************
321 ETL_OR_STD::pair<iterator, bool> emplace(const_reference value)
322 {
323 return insert(value);
324 }
325
326 //*************************************************************************
328 //*************************************************************************
329#if ETL_USING_CPP11 && ETL_NOT_USING_STLPORT && !defined(ETL_FLAT_SET_FORCE_CPP03_IMPLEMENTATION)
330 template <typename ... Args>
331 ETL_OR_STD::pair<iterator, bool> emplace(Args && ... args)
332 {
333 ETL_ASSERT(!full(), ETL_ERROR(flat_set_full));
334
335 ETL_OR_STD::pair<iterator, bool> result;
336
337 // Create it.
338 value_type* pvalue = storage.allocate<value_type>();
339 ::new (pvalue) value_type(etl::forward<Args>(args)...);
340
342
343 // Doesn't already exist?
344 if ((i_element == end()) || compare(*pvalue, *i_element))
345 {
346 ETL_INCREMENT_DEBUG_COUNT;
348 }
349 else
350 {
351 // Destroy it.
352 pvalue->~value_type();
353 storage.release(pvalue);
354 result = ETL_OR_STD::pair<iterator, bool>(end(), false);
355 }
356
357 return result;
358 }
359#else
360 //*************************************************************************
362 //*************************************************************************
363 ETL_OR_STD::pair<iterator, bool> emplace()
364 {
365 ETL_ASSERT(!full(), ETL_ERROR(flat_set_full));
366
367 ETL_OR_STD::pair<iterator, bool> result;
368
369 // Create it.
370 value_type* pvalue = storage.allocate<value_type>();
371 ::new (pvalue) value_type();
372
374
375 // Doesn't already exist?
376 if ((i_element == end()) || compare(*pvalue, *i_element))
377 {
378 ETL_INCREMENT_DEBUG_COUNT;
380 }
381 else
382 {
383 // Destroy it.
384 pvalue->~value_type();
385 storage.release(pvalue);
386 result = ETL_OR_STD::pair<iterator, bool>(end(), false);
387 }
388
389 return result;
390 }
391
392 //*************************************************************************
394 //*************************************************************************
395 template <typename T1>
396 ETL_OR_STD::pair<iterator, bool> emplace(const T1& value1)
397 {
398 ETL_ASSERT(!full(), ETL_ERROR(flat_set_full));
399
400 ETL_OR_STD::pair<iterator, bool> result;
401
402 // Create it.
403 value_type* pvalue = storage.allocate<value_type>();
404 ::new (pvalue) value_type(value1);
405
407
408 // Doesn't already exist?
409 if ((i_element == end()) || compare(*pvalue, *i_element))
410 {
411 ETL_INCREMENT_DEBUG_COUNT;
413 }
414 else
415 {
416 // Destroy it.
417 pvalue->~value_type();
418 storage.release(pvalue);
419 result = ETL_OR_STD::pair<iterator, bool>(end(), false);
420 }
421
422 return result;
423 }
424
425 //*************************************************************************
427 //*************************************************************************
428 template <typename T1, typename T2>
429 ETL_OR_STD::pair<iterator, bool> emplace(const T1& value1, const T2& value2)
430 {
431 ETL_ASSERT(!full(), ETL_ERROR(flat_set_full));
432
433 ETL_OR_STD::pair<iterator, bool> result;
434
435 // Create it.
436 value_type* pvalue = storage.allocate<value_type>();
437 ::new (pvalue) value_type(value1, value2);
438
440
441 // Doesn't already exist?
442 if ((i_element == end()) || compare(*pvalue, *i_element))
443 {
444 ETL_INCREMENT_DEBUG_COUNT;
446 }
447 else
448 {
449 // Destroy it.
450 pvalue->~value_type();
451 storage.release(pvalue);
452 result = ETL_OR_STD::pair<iterator, bool>(end(), false);
453 }
454
455 return result;
456 }
457
458 //*************************************************************************
460 //*************************************************************************
461 template <typename T1, typename T2, typename T3>
462 ETL_OR_STD::pair<iterator, bool> emplace(const T1& value1, const T2& value2, const T3& value3)
463 {
464 ETL_ASSERT(!full(), ETL_ERROR(flat_set_full));
465
466 ETL_OR_STD::pair<iterator, bool> result;
467
468 // Create it.
469 value_type* pvalue = storage.allocate<value_type>();
470 ::new (pvalue) value_type(value1, value2, value3);
471
473
474 // Doesn't already exist?
475 if ((i_element == end()) || compare(*pvalue, *i_element))
476 {
477 ETL_INCREMENT_DEBUG_COUNT;
479 }
480 else
481 {
482 // Destroy it.
483 pvalue->~value_type();
484 storage.release(pvalue);
485 result = ETL_OR_STD::pair<iterator, bool>(end(), false);
486 }
487
488 return result;
489 }
490
491 //*************************************************************************
493 //*************************************************************************
494 template <typename T1, typename T2, typename T3, typename T4>
495 ETL_OR_STD::pair<iterator, bool> emplace(const T1& value1, const T2& value2, const T3& value3, const T4& value4)
496 {
497 ETL_ASSERT(!full(), ETL_ERROR(flat_set_full));
498
499 ETL_OR_STD::pair<iterator, bool> result;
500
501 // Create it.
502 value_type* pvalue = storage.allocate<value_type>();
503 ::new (pvalue) value_type(value1, value2, value3, value4);
504
506
507 // Doesn't already exist?
508 if ((i_element == end()) || compare(*pvalue, *i_element))
509 {
510 ETL_INCREMENT_DEBUG_COUNT;
512 }
513 else
514 {
515 // Destroy it.
516 pvalue->~value_type();
517 storage.release(pvalue);
518 result = ETL_OR_STD::pair<iterator, bool>(end(), false);
519 }
520
521 return result;
522 }
523#endif
524
525 //*********************************************************************
529 //*********************************************************************
530 size_t erase(key_parameter_t key)
531 {
532 iterator i_element = find(key);
533
534 if (i_element == end())
535 {
536 return 0;
537 }
538 else
539 {
543 ETL_DECREMENT_DEBUG_COUNT;
544 return 1;
545 }
546 }
547
548#if ETL_USING_CPP11
549 //*********************************************************************
551 size_t erase(K&& key)
552 {
554
555 if (i_element == end())
556 {
557 return 0;
558 }
559 else
560 {
561 etl::destroy_at(etl::addressof(*i_element));
562 storage.release(etl::addressof(*i_element));
563 refset_t::erase(i_element);
564 ETL_DECREMENT_DEBUG_COUNT;
565 return 1;
566 }
567 }
568#endif
569
570 //*********************************************************************
573 //*********************************************************************
575 {
578 ETL_DECREMENT_DEBUG_COUNT;
580 }
581
582 //*********************************************************************
585 //*********************************************************************
587 {
590 ETL_DECREMENT_DEBUG_COUNT;
592 }
593
594 //*********************************************************************
600 //*********************************************************************
602 {
603 const_iterator itr = first;
604
605 while (itr != last)
606 {
608 storage.release(etl::addressof(*itr));
609 ++itr;
610 ETL_DECREMENT_DEBUG_COUNT;
611 }
612
613 return refset_t::erase(first, last);
614 }
615
616 //*************************************************************************
618 //*************************************************************************
619 void clear()
620 {
622 {
623 storage.release_all();
624 }
625 else
626 {
627 iterator itr = begin();
628
629 while (itr != end())
630 {
632 storage.release(etl::addressof(*itr));
633 ++itr;
634 ETL_DECREMENT_DEBUG_COUNT;
635 }
636 }
637
638 ETL_RESET_DEBUG_COUNT;
640 }
641
642 //*********************************************************************
646 //*********************************************************************
647 iterator find(key_parameter_t key)
648 {
649 return refset_t::find(key);
650 }
651
652#if ETL_USING_CPP11
653 //*********************************************************************
655 iterator find(const K& key)
656 {
657 return refset_t::find(key);
658 }
659#endif
660
661 //*********************************************************************
665 //*********************************************************************
666 const_iterator find(key_parameter_t key) const
667 {
668 return refset_t::find(key);
669 }
670
671#if ETL_USING_CPP11
672 //*********************************************************************
674 const_iterator find(const K& key) const
675 {
676 return refset_t::find(key);
677 }
678#endif
679
680 //*********************************************************************
684 //*********************************************************************
685 size_t count(key_parameter_t key) const
686 {
687 return refset_t::count(key);
688 }
689
690#if ETL_USING_CPP11
691 //*********************************************************************
693 size_t count(const K& key) const
694 {
695 return refset_t::count(key);
696 }
697#endif
698
699 //*********************************************************************
703 //*********************************************************************
704 iterator lower_bound(key_parameter_t key)
705 {
706 return refset_t::lower_bound(key);
707 }
708
709#if ETL_USING_CPP11
710 //*********************************************************************
712 iterator lower_bound(const K& key)
713 {
714 return refset_t::lower_bound(key);
715 }
716#endif
717
718 //*********************************************************************
722 //*********************************************************************
723 const_iterator lower_bound(key_parameter_t key) const
724 {
725 return refset_t::lower_bound(key);
726 }
727
728#if ETL_USING_CPP11
729 //*********************************************************************
731 const_iterator lower_bound(const K& key) const
732 {
733 return refset_t::lower_bound(key);
734 }
735#endif
736
737 //*********************************************************************
741 //*********************************************************************
742 iterator upper_bound(key_parameter_t key)
743 {
744 return refset_t::upper_bound(key);
745 }
746
747#if ETL_USING_CPP11
748 //*********************************************************************
750 iterator upper_bound(const K& key)
751 {
752 return refset_t::upper_bound(key);
753 }
754#endif
755
756 //*********************************************************************
760 //*********************************************************************
761 const_iterator upper_bound(key_parameter_t key) const
762 {
763 return refset_t::upper_bound(key);
764 }
765
766#if ETL_USING_CPP11
767 //*********************************************************************
769 const_iterator upper_bound(const K& key) const
770 {
771 return refset_t::upper_bound(key);
772 }
773#endif
774
775 //*********************************************************************
779 //*********************************************************************
780 ETL_OR_STD::pair<iterator, iterator> equal_range(key_parameter_t key)
781 {
782 return refset_t::equal_range(key);
783 }
784
785#if ETL_USING_CPP11
786 //*********************************************************************
788 ETL_OR_STD::pair<iterator, iterator> equal_range(const K& key)
789 {
790 return refset_t::equal_range(key);
791 }
792#endif
793
794 //*********************************************************************
798 //*********************************************************************
799 ETL_OR_STD::pair<const_iterator, const_iterator> equal_range(key_parameter_t key) const
800 {
801 return refset_t::upper_bound(key);
802 }
803
804#if ETL_USING_CPP11
805 //*********************************************************************
807 ETL_OR_STD::pair<const_iterator, const_iterator> equal_range(const K& key) const
808 {
809 return refset_t::upper_bound(key);
810 }
811#endif
812
813 //*************************************************************************
815 //*************************************************************************
816 bool contains(key_parameter_t key) const
817 {
818 return find(key) != end();
819 }
820
821#if ETL_USING_CPP11
822 //*************************************************************************
824 bool contains(const K& k) const
825 {
826 return find(k) != end();
827 }
828#endif
829
830 //*************************************************************************
832 //*************************************************************************
834 {
835 if (&rhs != this)
836 {
837 assign(rhs.cbegin(), rhs.cend());
838 }
839
840 return *this;
841 }
842
843#if ETL_USING_CPP11
844 //*************************************************************************
846 //*************************************************************************
848 {
849 move_container(etl::move(rhs));
850
851 return *this;
852 }
853#endif
854
855 //*************************************************************************
858 //*************************************************************************
860 {
861 return refset_t::size();
862 }
863
864 //*************************************************************************
867 //*************************************************************************
868 bool empty() const
869 {
870 return refset_t::empty();
871 }
872
873 //*************************************************************************
876 //*************************************************************************
877 bool full() const
878 {
879 return refset_t::full();
880 }
881
882 //*************************************************************************
885 //*************************************************************************
887 {
888 return refset_t::capacity();
889 }
890
891 //*************************************************************************
894 //*************************************************************************
896 {
897 return refset_t::max_size();
898 }
899
900 //*************************************************************************
903 //*************************************************************************
904 size_t available() const
905 {
906 return refset_t::available();
907 }
908
909 protected:
910
911 //*********************************************************************
913 //*********************************************************************
915 : refset_t(lookup_),
916 storage(storage_)
917 {
918 }
919
920#if ETL_USING_CPP11
921 //*************************************************************************
924 //*************************************************************************
926 {
927 if (&rhs != this)
928 {
929 this->clear();
930
933
934 // Move all of the elements.
935 while (first != last)
936 {
938 ++temp;
939
940 this->insert(etl::move(*first));
941 first = temp;
942 }
943 }
944 }
945#endif
946
947 private:
948
949 // Disable copy construction.
950 iflat_set(const iflat_set&);
951
952 storage_t& storage;
953
954 TKeyCompare compare;
955
957 ETL_DECLARE_DEBUG_COUNT;
958
959 //*************************************************************************
961 //*************************************************************************
962#if defined(ETL_POLYMORPHIC_FLAT_SET) || defined(ETL_POLYMORPHIC_CONTAINERS)
963 public:
964 virtual ~iflat_set()
965 {
966 }
967#else
968 protected:
970 {
971 }
972#endif
973 };
974
975 //***************************************************************************
981 //***************************************************************************
982 template <typename T, typename TKeyCompare>
984 {
985 return (lhs.size() == rhs.size()) && etl::equal(lhs.begin(), lhs.end(), rhs.begin());
986 }
987
988 //***************************************************************************
994 //***************************************************************************
995 template <typename T, typename TKeyCompare>
997 {
998 return !(lhs == rhs);
999 }
1000
1001 //***************************************************************************
1007 //***************************************************************************
1008 template <typename T, const size_t MAX_SIZE_, typename TCompare = etl::less<T> >
1009 class flat_set : public etl::iflat_set<T, TCompare>
1010 {
1011 public:
1012
1013 static ETL_CONSTANT size_t MAX_SIZE = MAX_SIZE_;
1014
1015 //*************************************************************************
1017 //*************************************************************************
1019 : etl::iflat_set<T, TCompare>(lookup, storage)
1020 {
1021 }
1022
1023 //*************************************************************************
1025 //*************************************************************************
1027 : etl::iflat_set<T, TCompare>(lookup, storage)
1028 {
1029 this->assign(other.cbegin(), other.cend());
1030 }
1031
1032#if ETL_USING_CPP11
1033 //*************************************************************************
1035 //*************************************************************************
1037 : etl::iflat_set<T, TCompare>(lookup, storage)
1038 {
1039 if (&other != this)
1040 {
1041 this->move_container(etl::move(other));
1042 }
1043 }
1044#endif
1045
1046 //*************************************************************************
1051 //*************************************************************************
1052 template <typename TIterator>
1054 : etl::iflat_set<T, TCompare>(lookup, storage)
1055 {
1056 this->assign(first, last);
1057 }
1058
1059#if ETL_HAS_INITIALIZER_LIST
1060 //*************************************************************************
1062 //*************************************************************************
1063 flat_set(std::initializer_list<T> init)
1064 : etl::iflat_set<T, TCompare>(lookup, storage)
1065 {
1066 this->assign(init.begin(), init.end());
1067 }
1068#endif
1069
1070 //*************************************************************************
1072 //*************************************************************************
1074 {
1075 this->clear();
1076 }
1077
1078 //*************************************************************************
1080 //*************************************************************************
1082 {
1083 if (&rhs != this)
1084 {
1085 this->assign(rhs.cbegin(), rhs.cend());
1086 }
1087
1088 return *this;
1089 }
1090
1091#if ETL_USING_CPP11
1092 //*************************************************************************
1094 //*************************************************************************
1096 {
1097 if (&rhs != this)
1098 {
1099 this->move_container(etl::move(rhs));
1100 }
1101
1102 return *this;
1103 }
1104#endif
1105
1106 private:
1107
1108 typedef typename etl::iflat_set<T, TCompare>::value_type node_t;
1109
1110 // The pool of nodes.
1112
1113 // The vector that stores pointers to the nodes.
1115 };
1116
1117 template <typename T, const size_t MAX_SIZE_, typename TCompare>
1118 ETL_CONSTANT size_t flat_set<T, MAX_SIZE_, TCompare>::MAX_SIZE;
1119
1120 //*************************************************************************
1122 //*************************************************************************
1123#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST
1124 template <typename... T>
1125 flat_set(T...) -> flat_set<etl::nth_type_t<0, T...>, sizeof...(T)>;
1126#endif
1127
1128 //*************************************************************************
1130 //*************************************************************************
1131#if ETL_USING_CPP11 && ETL_HAS_INITIALIZER_LIST
1132 template <typename TKey, typename TKeyCompare = etl::less<TKey>, typename... T>
1133 constexpr auto make_flat_set(T&&... keys) -> etl::flat_set<TKey, sizeof...(T), TKeyCompare>
1134 {
1135 return { etl::forward<T>(keys)... };
1136 }
1137#endif
1138}
1139
1140#endif
Definition reference_flat_set.h:72
Definition reference_flat_set.h:206
Definition reference_flat_set.h:122
Definition reference_flat_set.h:102
size_type capacity() const
Definition reference_flat_set.h:832
ETL_OR_STD::pair< iterator, bool > insert_at(iterator i_element, reference value)
Definition reference_flat_set.h:870
size_t available() const
Definition reference_flat_set.h:850
iterator upper_bound(parameter_t key)
Definition reference_flat_set.h:713
const_reverse_iterator crbegin() const
Definition reference_flat_set.h:402
iterator begin()
Definition reference_flat_set.h:312
size_t erase(parameter_t key)
Definition reference_flat_set.h:485
iterator end()
Definition reference_flat_set.h:330
ETL_OR_STD::pair< iterator, iterator > equal_range(parameter_t key)
Definition reference_flat_set.h:751
const_iterator cend() const
Definition reference_flat_set.h:357
const_iterator cbegin() const
Definition reference_flat_set.h:348
iterator find(parameter_t key)
Definition reference_flat_set.h:562
size_type max_size() const
Definition reference_flat_set.h:841
const_reverse_iterator crend() const
Definition reference_flat_set.h:411
bool empty() const
Definition reference_flat_set.h:814
size_type size() const
Definition reference_flat_set.h:805
reverse_iterator rbegin()
Definition reference_flat_set.h:366
size_t count(parameter_t key) const
Definition reference_flat_set.h:656
bool full() const
Definition reference_flat_set.h:823
void clear()
Clears the reference_flat_set.
Definition reference_flat_set.h:552
iterator lower_bound(parameter_t key)
Definition reference_flat_set.h:675
reverse_iterator rend()
Definition reference_flat_set.h:384
#define ETL_ASSERT(b, e)
Definition error_handler.h:316
const_iterator cbegin() const
Definition flat_set.h:133
iterator insert(const_iterator, const_reference value)
Definition flat_set.h:283
~iflat_set()
Destructor.
Definition flat_set.h:969
iterator upper_bound(key_parameter_t key)
Definition flat_set.h:742
size_t available() const
Definition flat_set.h:904
flat_set()
Constructor.
Definition flat_set.h:1018
size_t erase(key_parameter_t key)
Definition flat_set.h:530
iterator begin()
Definition flat_set.h:97
iflat_set(lookup_t &lookup_, storage_t &storage_)
Constructor.
Definition flat_set.h:914
const_iterator begin() const
Definition flat_set.h:106
const_reverse_iterator crbegin() const
Definition flat_set.h:187
iterator erase(iterator i_element)
Definition flat_set.h:574
ETL_OR_STD::pair< iterator, bool > emplace(const T1 &value1)
Emplaces a value to the set.
Definition flat_set.h:396
size_type max_size() const
Definition flat_set.h:895
iterator find(key_parameter_t key)
Definition flat_set.h:647
ETL_OR_STD::pair< iterator, iterator > equal_range(key_parameter_t key)
Definition flat_set.h:780
size_type capacity() const
Definition flat_set.h:886
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_set.h:495
size_t count(key_parameter_t key) const
Definition flat_set.h:685
ETL_OR_STD::pair< iterator, bool > emplace(const_reference value)
Emplaces a value to the set.
Definition flat_set.h:321
iterator erase(const_iterator first, const_iterator last)
Definition flat_set.h:601
iterator lower_bound(key_parameter_t key)
Definition flat_set.h:704
ETL_OR_STD::pair< iterator, bool > emplace()
Emplaces a value to the set.
Definition flat_set.h:363
bool empty() const
Definition flat_set.h:868
const_iterator find(key_parameter_t key) const
Definition flat_set.h:666
~flat_set()
Destructor.
Definition flat_set.h:1073
iflat_set & operator=(const iflat_set &rhs)
Assignment operator.
Definition flat_set.h:833
const_iterator end() const
Definition flat_set.h:124
bool full() const
Definition flat_set.h:877
iterator end()
Definition flat_set.h:115
bool contains(key_parameter_t key) const
Check if the map contains the key.
Definition flat_set.h:816
iterator erase(const_iterator i_element)
Definition flat_set.h:586
ETL_OR_STD::pair< iterator, bool > insert(const_reference value)
Definition flat_set.h:230
const_reverse_iterator rbegin() const
Definition flat_set.h:160
ETL_OR_STD::pair< iterator, bool > emplace(const T1 &value1, const T2 &value2)
Emplaces a value to the set.
Definition flat_set.h:429
void insert(TIterator first, TIterator last)
Definition flat_set.h:309
const_reverse_iterator crend() const
Definition flat_set.h:196
void assign(TIterator first, TIterator last)
Definition flat_set.h:209
reverse_iterator rend()
Definition flat_set.h:169
flat_set & operator=(const flat_set &rhs)
Assignment operator.
Definition flat_set.h:1081
flat_set(const flat_set &other)
Copy constructor.
Definition flat_set.h:1026
size_type size() const
Definition flat_set.h:859
const_iterator lower_bound(key_parameter_t key) const
Definition flat_set.h:723
reverse_iterator rbegin()
Definition flat_set.h:151
const_iterator upper_bound(key_parameter_t key) const
Definition flat_set.h:761
const_reverse_iterator rend() const
Definition flat_set.h:178
const_iterator cend() const
Definition flat_set.h:142
ETL_OR_STD::pair< const_iterator, const_iterator > equal_range(key_parameter_t key) const
Definition flat_set.h:799
ETL_OR_STD::pair< iterator, bool > emplace(const T1 &value1, const T2 &value2, const T3 &value3)
Emplaces a value to the set.
Definition flat_set.h:462
flat_set(TIterator first, TIterator last)
Definition flat_set.h:1053
void clear()
Clears the flat_set.
Definition flat_set.h:619
Definition flat_set.h:1010
Definition flat_set.h:61
ETL_CONSTEXPR17 etl::enable_if<!etl::is_same< T, etl::nullptr_t >::value, T >::type * addressof(T &t)
Definition addressof.h:52
etl::enable_if< etl::is_trivially_destructible< T >::value, void >::type destroy_at(T *)
Definition memory.h:1006
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:654
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:642
Definition compare.h:51
Definition type_traits_generator.h:2101
iterator
Definition iterator.h:399
pair holds two objects of arbitrary type
Definition utility.h:164