Embedded Template Library  1.0
flat_map.h
Go to the documentation of this file.
1 
3 /******************************************************************************
4 The MIT License(MIT)
5 
6 Embedded Template Library.
7 https://github.com/ETLCPP/etl
8 https://www.etlcpp.com
9 
10 Copyright(c) 2015 jwellbelove
11 
12 Permission is hereby granted, free of charge, to any person obtaining a copy
13 of this software and associated documentation files(the "Software"), to deal
14 in the Software without restriction, including without limitation the rights
15 to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
16 copies of the Software, and to permit persons to whom the Software is
17 furnished to do so, subject to the following conditions :
18 
19 The above copyright notice and this permission notice shall be included in all
20 copies or substantial portions of the Software.
21 
22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
25 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 SOFTWARE.
29 ******************************************************************************/
30 
31 #ifndef ETL_FLAT_MAP_INCLUDED
32 #define ETL_FLAT_MAP_INCLUDED
33 
34 #include "platform.h"
35 #include "reference_flat_map.h"
36 #include "pool.h"
37 #include "placement_new.h"
38 
39 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && ETL_USING_STL
40  #include <initializer_list>
41 #endif
42 #include "utility.h"
43 
44 #undef ETL_FILE
45 #define ETL_FILE "2"
46 
47 //*****************************************************************************
55 //*****************************************************************************
56 
57 namespace etl
58 {
59  //***************************************************************************
63  //***************************************************************************
64  template <typename TKey, typename TMapped, typename TKeyCompare = etl::less<TKey> >
65  class iflat_map : private etl::ireference_flat_map<TKey, TMapped, TKeyCompare>
66  {
67  private:
68 
70  typedef typename refmap_t::lookup_t lookup_t;
71  typedef etl::ipool storage_t;
72 
73  public:
74 
75  typedef ETL_OR_STD::pair<const TKey, TMapped> value_type;
76  typedef TKey key_type;
77  typedef TMapped mapped_type;
78  typedef TKeyCompare key_compare;
79  typedef value_type& reference;
80  typedef const value_type& const_reference;
81 #if ETL_CPP11_SUPPORTED
82  typedef value_type&& rvalue_reference;
83 #endif
84  typedef value_type* pointer;
85  typedef const value_type* const_pointer;
86  typedef size_t size_type;
87 
88  typedef typename refmap_t::iterator iterator;
90 
91  typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
92  typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
93  typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
94 
95  protected:
96 
97  typedef const key_type& key_parameter_t;
98 
99  private:
100 
101  //*********************************************************************
103  //*********************************************************************
104  class compare
105  {
106  public:
107 
108  bool operator ()(const value_type& element, key_type key) const
109  {
110  return comp(element.first, key);
111  }
112 
113  bool operator ()(key_type key, const value_type& element) const
114  {
115  return comp(key, element.first);
116  }
117 
118  key_compare comp;
119  };
120 
121  public:
122 
123  //*********************************************************************
126  //*********************************************************************
128  {
129  return refmap_t::begin();
130  }
131 
132  //*********************************************************************
135  //*********************************************************************
137  {
138  return refmap_t::begin();
139  }
140 
141  //*********************************************************************
144  //*********************************************************************
146  {
147  return refmap_t::end();
148  }
149 
150  //*********************************************************************
153  //*********************************************************************
155  {
156  return refmap_t::end();
157  }
158 
159  //*********************************************************************
162  //*********************************************************************
164  {
165  return refmap_t::cbegin();
166  }
167 
168  //*********************************************************************
171  //*********************************************************************
173  {
174  return refmap_t::cend();
175  }
176 
177  //*********************************************************************
180  //*********************************************************************
181  reverse_iterator rbegin()
182  {
183  return refmap_t::rbegin();
184  }
185 
186  //*********************************************************************
189  //*********************************************************************
190  const_reverse_iterator rbegin() const
191  {
192  return refmap_t::rbegin();
193  }
194 
195  //*********************************************************************
198  //*********************************************************************
199  reverse_iterator rend()
200  {
201  return refmap_t::rend();
202  }
203 
204  //*********************************************************************
207  //*********************************************************************
208  const_reverse_iterator rend() const
209  {
210  return refmap_t::rend();
211  }
212 
213  //*********************************************************************
216  //*********************************************************************
217  const_reverse_iterator crbegin() const
218  {
219  return refmap_t::crbegin();
220  }
221 
222  //*********************************************************************
225  //*********************************************************************
226  const_reverse_iterator crend() const
227  {
228  return refmap_t::crend();
229  }
230 
231  //*********************************************************************
235  //*********************************************************************
236  mapped_type& operator [](key_parameter_t key)
237  {
238  return insert(ETL_OR_STD::make_pair(key, mapped_type())).first->second;
239  }
240 
241  //*********************************************************************
246  //*********************************************************************
247  mapped_type& at(key_parameter_t key)
248  {
249  return refmap_t::at(key);
250  }
251 
252  //*********************************************************************
257  //*********************************************************************
258  const mapped_type& at(key_parameter_t key) const
259  {
260  return refmap_t::at(key);
261  }
262 
263  //*********************************************************************
269  //*********************************************************************
270  template <typename TIterator>
271  void assign(TIterator first, TIterator last)
272  {
273 #if defined(ETL_DEBUG)
274  difference_type d = etl::distance(first, last);
275  ETL_ASSERT(d <= difference_type(capacity()), ETL_ERROR(flat_map_full));
276 #endif
277 
278  clear();
279 
280  while (first != last)
281  {
282  insert(*first++);
283  }
284  }
285 
286  //*********************************************************************
290  //*********************************************************************
291  ETL_OR_STD::pair<iterator, bool> insert(const_reference value)
292  {
293  iterator i_element = lower_bound(value.first);
294 
295  ETL_OR_STD::pair<iterator, bool> result(i_element, false);
296 
297  // Doesn't already exist?
298  if ((i_element == end()) || compare(value.first, i_element->first))
299  {
300  ETL_ASSERT(!refmap_t::full(), ETL_ERROR(flat_map_full));
301 
302  value_type* pvalue = storage.allocate<value_type>();
303  ::new (pvalue) value_type(value);
304  ETL_INCREMENT_DEBUG_COUNT
305  result = refmap_t::insert_at(i_element, *pvalue);
306  }
307 
308  return result;
309  }
310 
311 #if ETL_CPP11_SUPPORTED
312  //*********************************************************************
316  //*********************************************************************
317  ETL_OR_STD::pair<iterator, bool> insert(rvalue_reference value)
318  {
319  iterator i_element = lower_bound(value.first);
320 
321  ETL_OR_STD::pair<iterator, bool> result(i_element, false);
322 
323  // Doesn't already exist?
324  if ((i_element == end()) || compare(value.first, i_element->first))
325  {
326  ETL_ASSERT(!refmap_t::full(), ETL_ERROR(flat_map_full));
327 
328  value_type* pvalue = storage.allocate<value_type>();
329  ::new (pvalue) value_type(etl::move(value));
330  ETL_INCREMENT_DEBUG_COUNT
331  result = refmap_t::insert_at(i_element, *pvalue);
332  }
333 
334  return result;
335  }
336 #endif
337 
338  //*********************************************************************
343  //*********************************************************************
344  iterator insert(iterator position, const_reference value)
345  {
346  return insert(value).first;
347  }
348 
349 #if ETL_CPP11_SUPPORTED
350  //*********************************************************************
355  //*********************************************************************
356  iterator insert(iterator position, rvalue_reference value)
357  {
358  return insert(etl::move(value)).first;
359  }
360 #endif
361 
362  //*********************************************************************
368  //*********************************************************************
369  template <class TIterator>
370  void insert(TIterator first, TIterator last)
371  {
372  while (first != last)
373  {
374  insert(*first++);
375  }
376  }
377 
378  //*************************************************************************
380  //*************************************************************************
381  ETL_OR_STD::pair<iterator, bool> emplace(const value_type& value)
382  {
383  return emplace(value.first, value.second);
384  }
385 
386 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT
387  //*************************************************************************
389  //*************************************************************************
390  template <typename ... Args>
391  ETL_OR_STD::pair<iterator, bool> emplace(const key_type& key, Args && ... args)
392  {
393  ETL_ASSERT(!full(), ETL_ERROR(flat_map_full));
394 
395  // Create it.
396  value_type* pvalue = storage.allocate<value_type>();
397  ::new ((void*)etl::addressof(pvalue->first)) key_type(key);
398  ::new ((void*)etl::addressof(pvalue->second)) mapped_type(etl::forward<Args>(args)...);
399 
400  iterator i_element = lower_bound(key);
401 
402  ETL_OR_STD::pair<iterator, bool> result(i_element, false);
403 
404  // Doesn't already exist?
405  if ((i_element == end()) || compare(key, i_element->first))
406  {
407  ETL_INCREMENT_DEBUG_COUNT
408  result = refmap_t::insert_at(i_element, *pvalue);
409  }
410  else
411  {
412  pvalue->~value_type();
413  storage.release(pvalue);
414  }
415 
416  return result;
417  }
418 
419 #else
420 
421  //*************************************************************************
423  //*************************************************************************
424  template <typename T1>
425  ETL_OR_STD::pair<iterator, bool> emplace(const key_type& key, const T1& value1)
426  {
427  ETL_ASSERT(!full(), ETL_ERROR(flat_map_full));
428 
429  // Create it.
430  value_type* pvalue = storage.allocate<value_type>();
431  ::new ((void*)etl::addressof(pvalue->first)) key_type(key);
432  ::new ((void*)etl::addressof(pvalue->second)) mapped_type(value1);
433 
434  iterator i_element = lower_bound(key);
435 
436  ETL_OR_STD::pair<iterator, bool> result(i_element, false);
437 
438  // Doesn't already exist?
439  if ((i_element == end()) || compare(key, i_element->first))
440  {
441  ETL_INCREMENT_DEBUG_COUNT
442  result = refmap_t::insert_at(i_element, *pvalue);
443  }
444  else
445  {
446  pvalue->~value_type();
447  storage.release(pvalue);
448  }
449 
450  return result;
451  }
452 
453  //*************************************************************************
455  //*************************************************************************
456  template <typename T1, typename T2>
457  ETL_OR_STD::pair<iterator, bool> emplace(const key_type& key, const T1& value1, const T2& value2)
458  {
459  ETL_ASSERT(!full(), ETL_ERROR(flat_map_full));
460 
461  // Create it.
462  value_type* pvalue = storage.allocate<value_type>();
463  ::new ((void*)etl::addressof(pvalue->first)) key_type(key);
464  ::new ((void*)etl::addressof(pvalue->second)) mapped_type(value1, value2);
465 
466  iterator i_element = lower_bound(key);
467 
468  ETL_OR_STD::pair<iterator, bool> result(i_element, false);
469 
470  // Doesn't already exist?
471  if ((i_element == end()) || compare(key, i_element->first))
472  {
473  ETL_INCREMENT_DEBUG_COUNT
474  result = refmap_t::insert_at(i_element, *pvalue);
475  }
476  else
477  {
478  pvalue->~value_type();
479  storage.release(pvalue);
480  }
481 
482  return result;
483  }
484 
485  //*************************************************************************
487  //*************************************************************************
488  template <typename T1, typename T2, typename T3>
489  ETL_OR_STD::pair<iterator, bool> emplace(const key_type& key, const T1& value1, const T2& value2, const T3& value3)
490  {
491  ETL_ASSERT(!full(), ETL_ERROR(flat_map_full));
492 
493  // Create it.
494  value_type* pvalue = storage.allocate<value_type>();
495  ::new ((void*)etl::addressof(pvalue->first)) key_type(key);
496  ::new ((void*)etl::addressof(pvalue->second)) mapped_type(value1, value2, value3);
497 
498  iterator i_element = lower_bound(key);
499 
500  ETL_OR_STD::pair<iterator, bool> result(i_element, false);
501 
502  // Doesn't already exist?
503  if ((i_element == end()) || compare(key, i_element->first))
504  {
505  ETL_INCREMENT_DEBUG_COUNT
506  result = refmap_t::insert_at(i_element, *pvalue);
507  }
508  else
509  {
510  pvalue->~value_type();
511  storage.release(pvalue);
512  }
513 
514  return result;
515  }
516 
517  //*************************************************************************
519  //*************************************************************************
520  template <typename T1, typename T2, typename T3, typename T4>
521  ETL_OR_STD::pair<iterator, bool> emplace(const key_type& key, const T1& value1, const T2& value2, const T3& value3, const T4& value4)
522  {
523  ETL_ASSERT(!full(), ETL_ERROR(flat_map_full));
524 
525  // Create it.
526  value_type* pvalue = storage.allocate<value_type>();
527  ::new ((void*)etl::addressof(pvalue->first)) key_type(key);
528  ::new ((void*)etl::addressof(pvalue->second)) mapped_type(value1, value2, value3, value4);
529 
530  iterator i_element = lower_bound(key);
531 
532  ETL_OR_STD::pair<iterator, bool> result(i_element, false);
533 
534  // Doesn't already exist?
535  if ((i_element == end()) || compare(key, i_element->first))
536  {
537  ETL_INCREMENT_DEBUG_COUNT
538  result = refmap_t::insert_at(i_element, *pvalue);
539  }
540  else
541  {
542  pvalue->~value_type();
543  storage.release(pvalue);
544  }
545 
546  return result;
547  }
548 
549 #endif
550 
551  //*********************************************************************
555  //*********************************************************************
556  size_t erase(key_parameter_t key)
557  {
558  iterator i_element = find(key);
559 
560  if (i_element == end())
561  {
562  return 0;
563  }
564  else
565  {
566  i_element->~value_type();
567  storage.release(etl::addressof(*i_element));
568  refmap_t::erase(i_element);
569  ETL_DECREMENT_DEBUG_COUNT
570  return 1;
571  }
572  }
573 
574  //*********************************************************************
577  //*********************************************************************
578  void erase(iterator i_element)
579  {
580  i_element->~value_type();
581  storage.release(etl::addressof(*i_element));
582  refmap_t::erase(i_element);
583  ETL_DECREMENT_DEBUG_COUNT
584  }
585 
586  //*********************************************************************
592  //*********************************************************************
593  void erase(iterator first, iterator last)
594  {
595  iterator itr = first;
596 
597  while (itr != last)
598  {
599  itr->~value_type();
600  storage.release(etl::addressof(*itr));
601  ++itr;
602  ETL_DECREMENT_DEBUG_COUNT
603  }
604 
605  refmap_t::erase(first, last);
606  }
607 
608  //*************************************************************************
610  //*************************************************************************
611  void clear()
612  {
614  {
615  storage.release_all();
616  }
617  else
618  {
619  iterator itr = begin();
620 
621  while (itr != end())
622  {
623  itr->~value_type();
624  storage.release(etl::addressof(*itr));
625  ++itr;
626  }
627  }
628 
629  ETL_RESET_DEBUG_COUNT
630  refmap_t::clear();
631  }
632 
633  //*********************************************************************
637  //*********************************************************************
638  iterator find(key_parameter_t key)
639  {
640  return refmap_t::find(key);
641  }
642 
643  //*********************************************************************
647  //*********************************************************************
648  const_iterator find(key_parameter_t key) const
649  {
650  return refmap_t::find(key);
651  }
652 
653  //*********************************************************************
657  //*********************************************************************
658  size_t count(key_parameter_t key) const
659  {
660  return refmap_t::count(key);
661  }
662 
663  //*********************************************************************
667  //*********************************************************************
668  iterator lower_bound(key_parameter_t key)
669  {
670  return refmap_t::lower_bound(key);
671  }
672 
673  //*********************************************************************
677  //*********************************************************************
678  const_iterator lower_bound(key_parameter_t key) const
679  {
680  return refmap_t::lower_bound(key);
681  }
682 
683  //*********************************************************************
687  //*********************************************************************
688  iterator upper_bound(key_parameter_t key)
689  {
690  return refmap_t::upper_bound(key);
691  }
692 
693  //*********************************************************************
697  //*********************************************************************
698  const_iterator upper_bound(key_parameter_t key) const
699  {
700  return refmap_t::upper_bound(key);
701  }
702 
703  //*********************************************************************
707  //*********************************************************************
708  ETL_OR_STD::pair<iterator, iterator> equal_range(key_parameter_t key)
709  {
710  return refmap_t::equal_range(key);
711  }
712 
713  //*********************************************************************
717  //*********************************************************************
718  ETL_OR_STD::pair<const_iterator, const_iterator> equal_range(key_parameter_t key) const
719  {
720  return refmap_t::equal_range(key);
721  }
722 
723  //*************************************************************************
725  //*************************************************************************
727  {
728  if (&rhs != this)
729  {
730  assign(rhs.cbegin(), rhs.cend());
731  }
732 
733  return *this;
734  }
735 
736 #if ETL_CPP11_SUPPORTED
737  //*************************************************************************
739  //*************************************************************************
741  {
742  move_container(etl::move(rhs));
743 
744  return *this;
745  }
746 #endif
747 
748  //*************************************************************************
751  //*************************************************************************
752  size_type size() const
753  {
754  return refmap_t::size();
755  }
756 
757  //*************************************************************************
760  //*************************************************************************
761  bool empty() const
762  {
763  return refmap_t::empty();
764  }
765 
766  //*************************************************************************
769  //*************************************************************************
770  bool full() const
771  {
772  return refmap_t::full();
773  }
774 
775  //*************************************************************************
778  //*************************************************************************
779  size_type capacity() const
780  {
781  return refmap_t::capacity();
782  }
783 
784  //*************************************************************************
787  //*************************************************************************
788  size_type max_size() const
789  {
790  return refmap_t::max_size();
791  }
792 
793  //*************************************************************************
796  //*************************************************************************
797  size_t available() const
798  {
799  return refmap_t::available();
800  }
801 
802  protected:
803 
804  //*********************************************************************
806  //*********************************************************************
807  iflat_map(lookup_t& lookup_, storage_t& storage_)
808  : refmap_t(lookup_),
809  storage(storage_)
810  {
811  }
812 
813 #if ETL_CPP11_SUPPORTED
814  //*************************************************************************
817  //*************************************************************************
818  void move_container(iflat_map&& rhs)
819  {
820  if (&rhs != this)
821  {
822  this->clear();
823 
826 
827  // Add all of the elements.
828  while (first != last)
829  {
830  this->insert(etl::move(*first++));
831  }
832  }
833  }
834 #endif
835 
836  private:
837 
838  // Disable copy construction.
839  iflat_map(const iflat_map&);
840 
841  storage_t& storage;
842 
843  TKeyCompare compare;
844 
846  ETL_DECLARE_DEBUG_COUNT
847 
848  //*************************************************************************
850  //*************************************************************************
851 #if defined(ETL_POLYMORPHIC_FLAT_MAP) || defined(ETL_POLYMORPHIC_CONTAINERS)
852  public:
853  virtual ~iflat_map()
854  {
855  }
856 #else
857  protected:
859  {
860  }
861 #endif
862  };
863 
864  //***************************************************************************
870  //***************************************************************************
871  template <typename TKey, typename TMapped, typename TKeyCompare>
873  {
874  return (lhs.size() == rhs.size()) && etl::equal(lhs.begin(), lhs.end(), rhs.begin());
875  }
876 
877  //***************************************************************************
883  //***************************************************************************
884  template <typename TKey, typename TMapped, typename TKeyCompare>
886  {
887  return !(lhs == rhs);
888  }
889 
890  //***************************************************************************
897  //***************************************************************************
898  template <typename TKey, typename TValue, const size_t MAX_SIZE_, typename TCompare = etl::less<TKey> >
899  class flat_map : public etl::iflat_map<TKey, TValue, TCompare>
900  {
901  public:
902 
903  static const size_t MAX_SIZE = MAX_SIZE_;
904 
905  //*************************************************************************
907  //*************************************************************************
909  : etl::iflat_map<TKey, TValue, TCompare>(lookup, storage)
910  {
911  }
912 
913  //*************************************************************************
915  //*************************************************************************
916  flat_map(const flat_map& other)
917  : etl::iflat_map<TKey, TValue, TCompare>(lookup, storage)
918  {
919  this->assign(other.cbegin(), other.cend());
920  }
921 
922 #if ETL_CPP11_SUPPORTED
923  //*************************************************************************
925  //*************************************************************************
926  flat_map(flat_map&& other)
927  : etl::iflat_map<TKey, TValue, TCompare>(lookup, storage)
928  {
929  if (&other != this)
930  {
931  this->move_container(etl::move(other));
932  }
933  }
934 #endif
935 
936  //*************************************************************************
941  //*************************************************************************
942  template <typename TIterator>
943  flat_map(TIterator first, TIterator last)
944  : etl::iflat_map<TKey, TValue, TCompare>(lookup, storage)
945  {
946  this->assign(first, last);
947  }
948 
949 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && ETL_USING_STL
950  //*************************************************************************
952  //*************************************************************************
953  flat_map(std::initializer_list<typename etl::iflat_map<TKey, TValue, TCompare>::value_type> init)
954  : etl::iflat_map<TKey, TValue, TCompare>(lookup, storage)
955  {
956  this->assign(init.begin(), init.end());
957  }
958 #endif
959 
960  //*************************************************************************
962  //*************************************************************************
964  {
965  this->clear();
966  }
967 
968  //*************************************************************************
970  //*************************************************************************
972  {
973  if (&rhs != this)
974  {
975  this->assign(rhs.cbegin(), rhs.cend());
976  }
977 
978  return *this;
979  }
980 
981 #if ETL_CPP11_SUPPORTED
982  //*************************************************************************
984  //*************************************************************************
986  {
987  if (&rhs != this)
988  {
989  this->move_container(etl::move(rhs));
990  }
991 
992  return *this;
993  }
994 #endif
995 
996  private:
997 
998  typedef typename etl::iflat_map<TKey, TValue, TCompare>::value_type node_t;
999 
1002 
1005  };
1006 
1007  //*************************************************************************
1009  //*************************************************************************
1010 #if ETL_CPP17_SUPPORTED && ETL_NOT_USING_STLPORT && ETL_USING_STL
1011  template <typename T, typename... Ts>
1012  flat_map(T, Ts...)
1013  ->flat_map<etl::enable_if_t<(etl::is_same_v<T, Ts> && ...), typename T::first_type>,
1014  etl::enable_if_t<(etl::is_same_v<T, Ts> && ...), typename T::second_type>,
1015  1U + sizeof...(Ts)>;
1016 #endif
1017 }
1018 
1019 #undef ETL_FILE
1020 
1021 #endif
Definition: reference_flat_map.h:229
Definition: reference_flat_map.h:130
#define ETL_ASSERT(b, e)
Definition: error_handler.h:290
iterator upper_bound(key_parameter_t key)
Definition: flat_map.h:688
ETL_OR_STD::pair< iterator, bool > emplace(const key_type &key, const T1 &value1, const T2 &value2, const T3 &value3)
Emplaces a value to the map.
Definition: flat_map.h:489
size_type max_size() const
Definition: flat_map.h:788
reverse_iterator rbegin()
Definition: flat_map.h:181
iterator begin()
Definition: flat_map.h:127
iflat_map & operator=(const iflat_map &rhs)
Assignment operator.
Definition: flat_map.h:726
const_iterator lower_bound(key_parameter_t key) const
Definition: flat_map.h:678
void erase(iterator first, iterator last)
Definition: flat_map.h:593
~flat_map()
Destructor.
Definition: flat_map.h:963
void clear()
Clears the flat_map.
Definition: flat_map.h:611
iflat_map(lookup_t &lookup_, storage_t &storage_)
Constructor.
Definition: flat_map.h:807
size_t available() const
Definition: flat_map.h:797
iterator find(key_parameter_t key)
Definition: flat_map.h:638
const_reverse_iterator rbegin() const
Definition: flat_map.h:190
void erase(iterator i_element)
Definition: flat_map.h:578
iterator insert(iterator position, const_reference value)
Definition: flat_map.h:344
const mapped_type & at(key_parameter_t key) const
Definition: flat_map.h:258
const_iterator find(key_parameter_t key) const
Definition: flat_map.h:648
~iflat_map()
Internal debugging.
Definition: flat_map.h:858
const_iterator cend() const
Definition: flat_map.h:172
size_t erase(key_parameter_t key)
Definition: flat_map.h:556
const_reverse_iterator crbegin() const
Definition: flat_map.h:217
reverse_iterator rend()
Definition: flat_map.h:199
ETL_OR_STD::pair< iterator, bool > emplace(const key_type &key, const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
Emplaces a value to the map.
Definition: flat_map.h:521
size_type capacity() const
Definition: flat_map.h:779
flat_map()
Constructor.
Definition: flat_map.h:908
ETL_OR_STD::pair< iterator, iterator > equal_range(key_parameter_t key)
Definition: flat_map.h:708
mapped_type & at(key_parameter_t key)
Definition: flat_map.h:247
const_iterator cbegin() const
Definition: flat_map.h:163
flat_map & operator=(const flat_map &rhs)
Assignment operator.
Definition: flat_map.h:971
const_iterator begin() const
Definition: flat_map.h:136
const_iterator end() const
Definition: flat_map.h:154
ETL_OR_STD::pair< iterator, bool > insert(const_reference value)
Definition: flat_map.h:291
bool full() const
Definition: flat_map.h:770
const_reverse_iterator rend() const
Definition: flat_map.h:208
ETL_OR_STD::pair< const_iterator, const_iterator > equal_range(key_parameter_t key) const
Definition: flat_map.h:718
iterator end()
Definition: flat_map.h:145
bool empty() const
Definition: flat_map.h:761
iterator lower_bound(key_parameter_t key)
Definition: flat_map.h:668
flat_map(const flat_map &other)
Copy constructor.
Definition: flat_map.h:916
ETL_OR_STD::pair< iterator, bool > emplace(const key_type &key, const T1 &value1)
Emplaces a value to the map.
Definition: flat_map.h:425
size_t count(key_parameter_t key) const
Definition: flat_map.h:658
void insert(TIterator first, TIterator last)
Definition: flat_map.h:370
ETL_OR_STD::pair< iterator, bool > emplace(const key_type &key, const T1 &value1, const T2 &value2)
Emplaces a value to the map.
Definition: flat_map.h:457
void assign(TIterator first, TIterator last)
Definition: flat_map.h:271
mapped_type & operator[](key_parameter_t key)
Definition: flat_map.h:236
const_reverse_iterator crend() const
Definition: flat_map.h:226
flat_map(TIterator first, TIterator last)
Definition: flat_map.h:943
const_iterator upper_bound(key_parameter_t key) const
Definition: flat_map.h:698
size_type size() const
Definition: flat_map.h:752
ETL_OR_STD::pair< iterator, bool > emplace(const value_type &value)
Emplaces a value to the map.
Definition: flat_map.h:381
Definition: flat_map.h:900
Definition: flat_map.h:66
T * addressof(T &t)
Definition: memory.h:61
void release_all()
Release all objects in the pool.
Definition: pool.h:264
void release(const void *const p_object)
Definition: pool.h:255
T * allocate()
Definition: pool.h:129
Definition: pool.h:118
iterator begin()
Definition: reference_flat_map.h:357
void clear()
Clears the reference_flat_map.
Definition: reference_flat_map.h:627
const_reverse_iterator crbegin() const
Definition: reference_flat_map.h:447
reverse_iterator rend()
Definition: reference_flat_map.h:429
ETL_OR_STD::pair< iterator, iterator > equal_range(key_parameter_t key)
Definition: reference_flat_map.h:735
size_t count(key_parameter_t key) const
Definition: reference_flat_map.h:685
iterator end()
Definition: reference_flat_map.h:375
const_iterator cbegin() const
Definition: reference_flat_map.h:393
size_t available() const
Definition: reference_flat_map.h:803
const_reverse_iterator crend() const
Definition: reference_flat_map.h:456
size_type max_size() const
Definition: reference_flat_map.h:794
bool empty() const
Definition: reference_flat_map.h:767
iterator lower_bound(key_parameter_t key)
Definition: reference_flat_map.h:695
reverse_iterator rbegin()
Definition: reference_flat_map.h:411
iterator upper_bound(key_parameter_t key)
Definition: reference_flat_map.h:715
size_type size() const
Definition: reference_flat_map.h:758
iterator find(key_parameter_t key)
Definition: reference_flat_map.h:637
const_iterator cend() const
Definition: reference_flat_map.h:402
mapped_type & at(key_parameter_t key)
Definition: reference_flat_map.h:495
size_t erase(key_parameter_t key)
Definition: reference_flat_map.h:588
bool full() const
Definition: reference_flat_map.h:776
ETL_OR_STD::pair< iterator, bool > insert_at(iterator i_element, value_type &value)
Definition: reference_flat_map.h:823
size_type capacity() const
Definition: reference_flat_map.h:785
Definition: reference_flat_map.h:78
Definition: reference_flat_map.h:108
is_trivially_destructible
Definition: type_traits_generator.h:1171
Definition: vector.h:80
Definition: absolute.h:37
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:594
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:582
Definition: compare.h:52
iterator
Definition: iterator.h:422
Definition: utility.h:108