aGrUM  0.16.0
list.h
Go to the documentation of this file.
1 
30 #ifndef GUM_LIST_H
31 #define GUM_LIST_H
32 
33 #include <cstddef>
34 #include <initializer_list>
35 #include <iostream>
36 #include <sstream>
37 #include <vector>
38 
39 #include <agrum/agrum.h>
40 #include <agrum/core/refPtr.h>
41 
42 #define GUM_DEFAULT_ITERATOR_NUMBER 4
43 
44 namespace gum {
45 
46  // ==============================================================================
47  // templates provided by this header
48  // ==============================================================================
49 
50 #ifndef DOXYGEN_SHOULD_SKIP_THIS
51 
52  template < typename Val >
53  class ListBucket;
54  template < typename Val >
55  class ListIterator;
56  template < typename Val >
57  class ListConstIterator;
58  template < typename Val >
59  class ListIteratorSafe;
60  template < typename Val >
61  class ListConstIteratorSafe;
62  template < typename Val, typename Alloc >
63  class List;
64 
65 #endif // DOXYGEN_SHOULD_SKIP_THIS
66 
67 #ifndef SWIG // SWIG cannot read these lines
68  template < typename Val, typename Alloc >
70  std::ostream& operator<<(std::ostream& stream, const List< Val, Alloc >& list);
71 #endif // SWIG
72 
73 #ifndef DOXYGEN_SHOULD_SKIP_THIS
74  // __list_end is a 'pseudo static' iterator that represents both end and rend
75  // iterators for all Lists (whatever their type). This global variable
76  // avoids creating the same iterators whithin every List instance (this would
77  // be quite inefficient as end and rend are precisely identical for all
78  // lists).
79  // The type of __list_end is a pointer to void because C++ allows pointers to
80  // void to be cast into pointers to other types (and conversely). This avoids
81  // the weird strict-aliasing rule warning
82  extern const void* const __list_end_safe;
83  extern const void* const __list_end;
84 #endif // DOXYGEN_SHOULD_SKIP_THIS
85 
86 
87  // ===========================================================================
88  // === BUCKETS: SINGLE ELEMENTS OF A CHAINED LIST ===
89  // ===========================================================================
90 
104  template < typename Val >
105  class ListBucket {
106  private:
112  enum class Emplace { EMPLACE };
113 
114  public:
115  // ============================================================================
117  // ============================================================================
119 
121  ListBucket() = delete;
122 
127  explicit ListBucket(const Val& v);
128 
133  explicit ListBucket(Val&& v) noexcept;
134 
140  template < typename... Args >
141  explicit ListBucket(Emplace, Args&&... args);
142 
147  ListBucket(const ListBucket< Val >& src);
148 
153  ListBucket(ListBucket< Val >&& src) = delete;
154 
164  ~ListBucket();
165 
167  // ============================================================================
169  // ============================================================================
171 
178 
185 
191  bool operator==(const ListBucket< Val >& src) const;
192 
198  bool operator!=(const ListBucket< Val >& src) const;
199 
201  // ============================================================================
203  // ============================================================================
205 
210  Val& operator*() noexcept;
211 
216  const Val& operator*() const noexcept;
217 
222  const ListBucket< Val >* next() const noexcept;
223 
228  const ListBucket< Val >* previous() const noexcept;
229 
231 
232  private:
235  template < typename T, typename A >
236  friend class List;
237  friend class ListIterator< Val >;
238  friend class ListConstIterator< Val >;
239  friend class ListIteratorSafe< Val >;
240  friend class ListConstIteratorSafe< Val >;
241 
247 
249  Val __val;
250  };
251 
252  // ===========================================================================
253  // === GENERIC DOUBLY CHAINED LISTS ===
254  // ===========================================================================
255 
371  template < typename Val, typename Alloc = std::allocator< Val > >
372  class List {
373  public:
376  using value_type = Val;
377  using reference = Val&;
378  using const_reference = const Val&;
379  using pointer = Val*;
380  using const_pointer = const Val*;
381  using size_type = Size;
382  using difference_type = std::ptrdiff_t;
383  using allocator_type = Alloc;
389 
391  using BucketAllocator =
392  typename Alloc::template rebind< ListBucket< Val > >::other;
393 
396  enum class location { BEFORE, AFTER };
397 
398  // ============================================================================
400  // ============================================================================
402 
406  List();
407 
418  List(const List< Val, Alloc >& src);
419 
431  template < typename OtherAlloc >
432  List(const List< Val, OtherAlloc >& src);
433 
438  List(List< Val, Alloc >&& src);
439 
444  List(std::initializer_list< Val > list);
445 
449  ~List();
450 
452  // ============================================================================
454  // ============================================================================
456 
467  const const_iterator_safe& cendSafe() const noexcept;
468 
479  const iterator_safe& endSafe() noexcept;
480 
493  const const_iterator_safe& crendSafe() const noexcept;
494 
507  const iterator_safe& rendSafe() noexcept;
508 
521  const_iterator_safe cbeginSafe() const;
522 
533  iterator_safe beginSafe();
534 
547  const_iterator_safe crbeginSafe() const;
548 
560  iterator_safe rbeginSafe();
561 
574  const const_iterator& cend() const noexcept;
575 
588  const iterator& end() noexcept;
589 
603  const const_iterator& end() const noexcept;
604 
619  const const_iterator& crend() const noexcept;
620 
635  const iterator& rend() noexcept;
636 
651  const const_iterator& rend() const noexcept;
652 
667  const_iterator cbegin() const;
668 
682  iterator begin();
683 
698  const_iterator begin() const;
699 
714  const_iterator crbegin() const;
715 
730  iterator rbegin();
731 
746  const_iterator rbegin() const;
747 
749  // ============================================================================
751  // ============================================================================
753 
767  Val& pushFront(const Val& val);
768 
778  Val& pushFront(Val&& val);
779 
789  template < typename... Args >
790  Val& push_front(Args&&... args);
791 
801  template < typename... Args >
802  Val& emplaceFront(Args&&... args);
803 
816  Val& pushBack(const Val& val);
817 
830  Val& pushBack(Val&& val);
831 
840  template < typename... Args >
841  Val& push_back(Args&&... args);
842 
853  template < typename... Args >
854  Val& emplaceBack(Args&&... args);
855 
865  Val& insert(const Val& val);
866 
876  Val& insert(Val&& val);
877 
891  Val& insert(Size pos, const Val& val);
892 
904  Val& insert(Size pos, Val&& val);
905 
916  Val& insert(const const_iterator_safe& iter,
917  const Val& val,
918  location place = location::BEFORE);
919 
930  Val& insert(const const_iterator_safe& iter,
931  Val&& val,
932  location place = location::BEFORE);
933 
944  Val& insert(const const_iterator& iter,
945  const Val& val,
946  location place = location::BEFORE);
947 
958  Val& insert(const const_iterator& iter,
959  Val&& val,
960  location place = location::BEFORE);
961 
975  template < typename... Args >
976  Val& emplace(const const_iterator& iter, Args&&... args);
977 
991  template < typename... Args >
992  Val& emplace(const const_iterator_safe& iter, Args&&... args);
993 
998  Val& front() const;
999 
1004  Val& back() const;
1005 
1010  Size size() const noexcept;
1011 
1022  bool exists(const Val& val) const;
1023 
1033  void erase(Size i);
1034 
1044  void erase(const iterator_safe& iter);
1045 
1056  void erase(const const_iterator_safe& iter);
1057 
1068  void eraseByVal(const Val& val);
1069 
1080  void eraseAllVal(const Val& val);
1081 
1087  void popBack();
1088 
1094  void popFront();
1095 
1103  void clear();
1104 
1109  bool empty() const noexcept;
1110 
1115  void swap(List& other_list);
1116 
1121  std::string toString() const;
1122 
1130  template < typename Mount, typename OtherAlloc = std::allocator< Mount > >
1131  List< Mount, OtherAlloc > map(Mount (*f)(Val)) const;
1132 
1140  template < typename Mount, typename OtherAlloc = std::allocator< Mount > >
1141  List< Mount, OtherAlloc > map(Mount (*f)(Val&)) const;
1142 
1150  template < typename Mount, typename OtherAlloc = std::allocator< Mount > >
1151  List< Mount, OtherAlloc > map(Mount (*f)(const Val&)) const;
1152 
1161  template < typename Mount, typename OtherAlloc = std::allocator< Mount > >
1162  List< Mount, OtherAlloc > map(const Mount& mount) const;
1163 
1165  // ============================================================================
1167  // ============================================================================
1169 
1189 
1207  template < typename OtherAlloc >
1209 
1217 
1230  Val& operator+=(const Val& val);
1231 
1244  Val& operator+=(Val&& val);
1245 
1255  template < typename OtherAlloc >
1256  bool operator==(const List< Val, OtherAlloc >& src) const;
1257 
1267  template < typename OtherAlloc >
1268  bool operator!=(const List< Val, OtherAlloc >& src) const;
1269 
1282  Val& operator[](const Size i);
1283 
1296  const Val& operator[](const Size i) const;
1297 
1299 
1300  private:
1302  ListBucket< Val >* __deb_list{nullptr};
1303 
1305  ListBucket< Val >* __end_list{nullptr};
1306 
1308  Size __nb_elements{Size(0)};
1309 
1311  mutable std::vector< const_iterator_safe* > __safe_iterators;
1312 
1315 
1325  template < typename OtherAlloc >
1326  void __copy_elements(const List< Val, OtherAlloc >& src);
1327 
1337  ListBucket< Val >* __getIthBucket(Size i) const noexcept;
1338 
1352  ListBucket< Val >* __getBucket(const Val& val) const noexcept;
1353 
1365  void __erase(ListBucket< Val >* bucket);
1366 
1372  ListBucket< Val >* __createBucket(const Val& val) const;
1373 
1379  ListBucket< Val >* __createBucket(Val&& val) const;
1380 
1387  template < typename... Args >
1388  ListBucket< Val >* __createEmplaceBucket(Args&&... args) const;
1389 
1395  Val& __pushFront(ListBucket< Val >* new_elt);
1396 
1402  Val& __pushBack(ListBucket< Val >* new_elt);
1403 
1410  Val& __insertBefore(ListBucket< Val >* new_elt,
1411  ListBucket< Val >* current_elt);
1412 
1419  Val& __insertAfter(ListBucket< Val >* new_elt, ListBucket< Val >* current_elt);
1420 
1429  Val& __insert(const const_iterator_safe& iter,
1430  ListBucket< Val >* new_elt,
1431  location place);
1432 
1441  Val& __insert(const const_iterator& iter,
1442  ListBucket< Val >* new_elt,
1443  location place);
1444 
1447  friend class ListIterator< Val >;
1448  friend class ListConstIterator< Val >;
1449  friend class ListIteratorSafe< Val >;
1450  friend class ListConstIteratorSafe< Val >;
1452  };
1453 
1454  // ===========================================================================
1455  // === UNSAFE LIST CONST ITERATORS ===
1456  // ===========================================================================
1507  template < typename Val >
1509  public:
1512  using iterator_category = std::bidirectional_iterator_tag;
1513  using value_type = Val;
1514  using reference = Val&;
1515  using const_reference = const Val&;
1516  using pointer = Val*;
1517  using const_pointer = const Val*;
1518  using difference_type = std::ptrdiff_t;
1520 
1521  // ============================================================================
1523  // ============================================================================
1525 
1531  ListConstIterator() noexcept;
1532 
1537  template < typename Alloc >
1538  ListConstIterator(const List< Val, Alloc >& theList) noexcept;
1539 
1544  ListConstIterator(const ListConstIterator< Val >& src) noexcept;
1545 
1550  ListConstIterator(ListConstIterator< Val >&& src) noexcept;
1551 
1560  ListConstIterator(const List< Val >& theList, Size ind_elt);
1561 
1565  ~ListConstIterator() noexcept;
1566 
1568  // ============================================================================
1570  // ============================================================================
1572 
1580  void clear() noexcept;
1581 
1585  void setToEnd() noexcept;
1586 
1593  bool isEnd() const noexcept;
1594 
1596  // ============================================================================
1598  // ============================================================================
1600 
1609  ListConstIterator< Val >&
1610  operator=(const ListConstIterator< Val >& src) noexcept;
1611 
1618  ListConstIterator< Val >& operator=(ListConstIterator< Val >&& src) noexcept;
1619 
1633  ListConstIterator< Val >& operator++() noexcept;
1634 
1640  ListConstIterator< Val >& operator+=(difference_type i) noexcept;
1641 
1655  ListConstIterator< Val >& operator--() noexcept;
1656 
1663  ListConstIterator< Val >& operator-=(difference_type i) noexcept;
1664 
1671  ListConstIterator< Val > operator+(difference_type i) noexcept;
1672 
1679  ListConstIterator< Val > operator-(difference_type i) noexcept;
1680 
1690  bool operator!=(const ListConstIterator< Val >& src) const noexcept;
1691 
1701  bool operator==(const ListConstIterator< Val >& src) const noexcept;
1702 
1708  const Val& operator*() const;
1709 
1715  const Val* operator->() const;
1716 
1718 
1719  private:
1724  template < typename T, typename A >
1725  friend class List;
1726 
1728  ListBucket< Val >* __bucket{nullptr};
1729 
1731  ListBucket< Val >* __getBucket() const noexcept;
1732  };
1733 
1735  template < typename Val >
1737  operator-(const ListConstIterator< Val >& iter1,
1738  const ListConstIterator< Val >& iter2);
1739 
1740  // ===========================================================================
1741  // === UNSAFE LIST ITERATORS ===
1742  // ===========================================================================
1743 
1793  template < typename Val >
1794  class ListIterator : public ListConstIterator< Val > {
1795  public:
1798  using iterator_category = std::bidirectional_iterator_tag;
1799  using value_type = Val;
1800  using reference = Val&;
1801  using const_reference = const Val&;
1802  using pointer = Val*;
1803  using const_pointer = const Val*;
1804  using difference_type = std::ptrdiff_t;
1806 
1807  // ============================================================================
1809  // ============================================================================
1811 
1817  ListIterator() noexcept;
1818 
1824  template < typename Alloc >
1825  ListIterator(const List< Val, Alloc >& theList) noexcept;
1826 
1831  ListIterator(const ListIterator< Val >& src) noexcept;
1832 
1837  ListIterator(ListIterator< Val >&& src) noexcept;
1838 
1847  ListIterator(const List< Val >& theList, Size ind_elt);
1848 
1852  ~ListIterator() noexcept;
1853 
1855  // ============================================================================
1857  // ============================================================================
1859 
1860  using ListConstIterator< Val >::clear;
1861  using ListConstIterator< Val >::setToEnd;
1862  using ListConstIterator< Val >::isEnd;
1863 
1865 
1866  // ============================================================================
1868  // ============================================================================
1870 
1879  ListIterator< Val >& operator=(const ListIterator< Val >& src) noexcept;
1880 
1882 
1890  ListIterator< Val >& operator=(ListIterator< Val >&& src) noexcept;
1891 
1906  ListIterator< Val >& operator++() noexcept;
1907 
1913  ListIterator< Val >& operator+=(difference_type i) noexcept;
1914 
1928  ListIterator< Val >& operator--() noexcept;
1929 
1936  ListIterator< Val >& operator-=(difference_type i) noexcept;
1937 
1944  ListIterator< Val > operator+(difference_type i) noexcept;
1945 
1952  ListIterator< Val > operator-(difference_type i) noexcept;
1953 
1956  using ListConstIterator< Val >::operator==;
1957  using ListConstIterator< Val >::operator!=;
1958  using ListConstIterator< Val >::operator*;
1959  using ListConstIterator< Val >::operator->;
1961 
1968  Val& operator*();
1969 
1976  Val* operator->();
1977 
1979  };
1980 
1981  // ===========================================================================
1982  // === LIST CONST ITERATORS ===
1983  // ===========================================================================
2029  template < typename Val >
2031  public:
2034  using iterator_category = std::bidirectional_iterator_tag;
2035  using value_type = Val;
2036  using reference = Val&;
2037  using const_reference = const Val&;
2038  using pointer = Val*;
2039  using const_pointer = const Val*;
2040  using difference_type = std::ptrdiff_t;
2042 
2043  // ============================================================================
2045  // ============================================================================
2047 
2053  ListConstIteratorSafe() noexcept;
2054 
2059  template < typename Alloc >
2060  ListConstIteratorSafe(const List< Val, Alloc >& theList);
2061 
2066  ListConstIteratorSafe(const ListConstIteratorSafe< Val >& src);
2067 
2076  template < typename Alloc >
2077  ListConstIteratorSafe(const List< Val, Alloc >& theList, Size ind_elt);
2078 
2083  ListConstIteratorSafe(ListConstIteratorSafe< Val >&& src);
2084 
2088  ~ListConstIteratorSafe();
2089 
2091  // ============================================================================
2093  // ============================================================================
2095 
2104  void clear();
2105 
2109  void setToEnd();
2110 
2117  bool isEnd() const;
2118 
2120  // ============================================================================
2122  // ============================================================================
2124 
2133  ListConstIteratorSafe< Val >&
2134  operator=(const ListConstIteratorSafe< Val >& src);
2135 
2142  ListConstIteratorSafe< Val >& operator=(ListConstIteratorSafe< Val >&& src);
2143 
2157  ListConstIteratorSafe< Val >& operator++() noexcept;
2158 
2164  ListConstIteratorSafe< Val >& operator+=(difference_type i) noexcept;
2165 
2179  ListConstIteratorSafe< Val >& operator--() noexcept;
2180 
2187  ListConstIteratorSafe< Val >& operator-=(difference_type i) noexcept;
2188 
2195  ListConstIteratorSafe< Val > operator+(difference_type i) noexcept;
2196 
2203  ListConstIteratorSafe< Val > operator-(difference_type i) noexcept;
2204 
2214  bool operator!=(const ListConstIteratorSafe< Val >& src) const;
2215 
2225  bool operator==(const ListConstIteratorSafe< Val >& src) const;
2226 
2232  const Val& operator*() const;
2233 
2239  const Val* operator->() const;
2240 
2242 
2243  private:
2247  template < typename T, typename A >
2248  friend class List;
2249  friend class ListConstIterator< Val >;
2251 
2253  const List< Val, std::allocator< Val > >* __list{nullptr};
2254 
2256  ListBucket< Val >* __bucket{nullptr};
2257 
2260  ListBucket< Val >* __next_current_bucket{nullptr};
2261 
2264  ListBucket< Val >* __prev_current_bucket{nullptr};
2265 
2267  bool __null_pointing{false};
2268 
2270  ListBucket< Val >* __getBucket() const noexcept;
2271 
2273  void __removeFromSafeList() const;
2274 
2276  ListConstIteratorSafe< Val >& __opPlus(Size i) noexcept;
2277 
2279  ListConstIteratorSafe< Val >& __opMinus(Size i) noexcept;
2280  };
2281 
2283  template < typename Val >
2286  const ListConstIteratorSafe< Val >& iter2);
2287 
2288  // ===========================================================================
2289  // === LIST ITERATORS ===
2290  // ===========================================================================
2291 
2341  template < typename Val >
2342  class ListIteratorSafe : public ListConstIteratorSafe< Val > {
2343  public:
2346  using iterator_category = std::bidirectional_iterator_tag;
2347  using value_type = Val;
2348  using reference = Val&;
2349  using const_reference = const Val&;
2350  using pointer = Val*;
2351  using const_pointer = const Val*;
2352  using difference_type = std::ptrdiff_t;
2354 
2355  // ============================================================================
2357  // ============================================================================
2359 
2365  ListIteratorSafe() noexcept;
2366 
2371  template < typename Alloc >
2372  ListIteratorSafe(const List< Val, Alloc >& theList);
2373 
2378  ListIteratorSafe(const ListIteratorSafe< Val >& src);
2379 
2388  template < typename Alloc >
2389  ListIteratorSafe(const List< Val, Alloc >& theList, Size ind_elt);
2390 
2395  ListIteratorSafe(ListIteratorSafe< Val >&& src);
2396 
2400  ~ListIteratorSafe();
2401 
2403  // ============================================================================
2405  // ============================================================================
2407 
2408  using ListConstIteratorSafe< Val >::clear;
2409  using ListConstIteratorSafe< Val >::setToEnd;
2410  using ListConstIteratorSafe< Val >::isEnd;
2411 
2413  // ============================================================================
2415  // ============================================================================
2417 
2426  ListIteratorSafe< Val >& operator=(const ListIteratorSafe< Val >& src);
2427 
2434  ListIteratorSafe< Val >& operator=(ListIteratorSafe< Val >&& src);
2435 
2449  ListIteratorSafe< Val >& operator++() noexcept;
2450 
2456  ListIteratorSafe< Val >& operator+=(difference_type i) noexcept;
2457 
2471  ListIteratorSafe< Val >& operator--() noexcept;
2472 
2479  ListIteratorSafe< Val >& operator-=(difference_type i) noexcept;
2480 
2487  ListIteratorSafe< Val > operator+(difference_type i) noexcept;
2488 
2495  ListIteratorSafe< Val > operator-(difference_type i) noexcept;
2496 
2502  Val& operator*();
2503 
2509  Val* operator->();
2510 
2513  using ListConstIteratorSafe< Val >::operator!=;
2514  using ListConstIteratorSafe< Val >::operator==;
2515  using ListConstIteratorSafe< Val >::operator*;
2516  using ListConstIteratorSafe< Val >::operator->;
2518  };
2519 
2520 #ifndef DOXYGEN_SHOULD_SKIP_THIS
2521  // constructor and destructor for the iterator that represents end and rend
2522  template <>
2524  template <>
2526  template <>
2527  ListConstIterator< Debug >::ListConstIterator() noexcept;
2528  template <>
2529  ListConstIterator< Debug >::~ListConstIterator() noexcept;
2530 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
2531 
2532 } /* namespace gum */
2533 
2534 
2535 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
2536 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
2537 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
2538 extern template class gum::List< bool >;
2539 # endif
2540 # endif
2541 #endif
2542 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
2543 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
2544 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
2545 extern template class gum::List< int >;
2546 # endif
2547 # endif
2548 #endif
2549 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
2550 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
2551 # ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
2552 extern template class gum::List< unsigned int >;
2553 # endif
2554 # endif
2555 #endif
2556 
2557 
2558 // always include the implementation of the templates
2559 #include <agrum/core/list_tpl.h>
2560 
2561 #endif /* GUM_LIST_H */
ListBucket< Val > * __next
Chaining toward the adjacent elements.
Definition: list.h:245
aGrUM&#39;s Potential is a multi-dimensional array with tensor operators.
Definition: potential.h:60
ListConstIteratorSafe() noexcept
Default constructor.
Definition: list_tpl.h:492
Val & reference
Types for STL compliance.
Definition: list.h:1514
Val value_type
Types for STL compliance.
Definition: list.h:1513
Safe iterators for Lists.
Definition: list.h:2342
ListBucket< Val > * __prev
Chaining toward the adjacent elements.
Definition: list.h:244
Unsafe but fast iterators for Lists.
Definition: list.h:1794
location
Locations around iterators where insertions of new elements can take / place.
Definition: list.h:396
const Val & const_reference
Types for STL compliance.
Definition: list.h:1515
STL namespace.
std::ptrdiff_t difference_type
Types for STL compliance.
Definition: list.h:1518
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Generic doubly linked lists.
Definition: list.h:372
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
std::allocator< const gum::Potential< GUM_SCALAR > * > allocator_type
Definition: list.h:383
bool operator!=(const ListBucket< Val > &src) const
Inequality check.
Definition: list_tpl.h:101
const ListBucket< Val > * previous() const noexcept
Returns the bucket toward the preceding element.
Definition: list_tpl.h:125
friend class List
All the list containers and iterators should be able to access the buckets.
Definition: list.h:236
Val * pointer
Types for STL compliance.
Definition: list.h:2038
Emplace
C dummy type for the emplace constructor.
Definition: list.h:112
std::vector< const_iterator_safe *> __safe_iterators
The list of "safe" iterators attached to the list.
Definition: list.h:1311
ListBucket()=delete
Removes empty constructor.
const const gum::Potential< GUM_SCALAR > * & const_reference
Definition: list.h:378
Val * pointer
Types for STL compliance.
Definition: list.h:1516
std::bidirectional_iterator_tag iterator_category
Types for STL compliance.
Definition: list.h:2034
std::ptrdiff_t difference_type
Types for STL compliance.
Definition: list.h:2040
Val & reference
Types for STL compliance.
Definition: list.h:2036
bool operator==(const ListBucket< Val > &src) const
Equality check.
Definition: list_tpl.h:95
ListConstIterator< Val >::difference_type operator-(const ListConstIterator< Val > &iter1, const ListConstIterator< Val > &iter2)
For STL compliance, a distance operator.
Definition: list_tpl.h:349
const ListBucket< Val > * next() const noexcept
Returns the bucket toward the next element.
Definition: list_tpl.h:119
Unsafe but fast const iterators for Lists.
Definition: list.h:1508
const const gum::Potential< GUM_SCALAR > * * const_pointer
Definition: list.h:380
Val & operator*() noexcept
Dereferencing operator.
Definition: list_tpl.h:113
Val __val
Val is the value contained in the box.
Definition: list.h:249
const Val * const_pointer
Types for STL compliance.
Definition: list.h:2039
ListBucket< Val > & operator=(const ListBucket< Val > &src)
Copy operator.
Definition: list_tpl.h:76
Safe const iterators for Lists.
Definition: list.h:2030
Bucket for a chained list.
Definition: list.h:105
const Val & const_reference
Types for STL compliance.
Definition: list.h:2037
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
~ListBucket()
Class destructor.
Definition: list_tpl.h:88
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
void swap(RefPtr< Val > &ptr1, RefPtr< Val > &ptr2)
Swap the contents of two RefPtr.
Definition: refPtr_tpl.h:260
BucketAllocator __alloc_bucket
The allocator for the buckets.
Definition: list.h:1314
const Val * const_pointer
Types for STL compliance.
Definition: list.h:1517
typename std::allocator< const gum::Potential< GUM_SCALAR > * > ::template rebind< ListBucket< const gum::Potential< GUM_SCALAR > * > >::other BucketAllocator
Type of the allocator for ListBuckets.
Definition: list.h:392
Val value_type
Types for STL compliance.
Definition: list.h:2035
std::bidirectional_iterator_tag iterator_category
Types for STL compliance.
Definition: list.h:1512