31#ifndef ETL_LIST_INCLUDED
32#define ETL_LIST_INCLUDED
46#include "static_assert.h"
71 list_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
72 :
exception(reason_, file_name_, line_number_)
81 class list_full :
public list_exception
85 list_full(string_type file_name_, numeric_type line_number_)
86 : list_exception(ETL_ERROR_TEXT(
"list:full", ETL_LIST_FILE_ID
"A"), file_name_, line_number_)
95 class list_empty :
public list_exception
99 list_empty(string_type file_name_, numeric_type line_number_)
100 : list_exception(ETL_ERROR_TEXT(
"list:empty", ETL_LIST_FILE_ID
"B"), file_name_, line_number_)
109 class list_iterator :
public list_exception
113 list_iterator(string_type file_name_, numeric_type line_number_)
114 : list_exception(ETL_ERROR_TEXT(
"list:iterator", ETL_LIST_FILE_ID
"C"), file_name_, line_number_)
123 class list_unsorted :
public list_exception
127 list_unsorted(string_type file_name_, numeric_type line_number_)
128 : list_exception(ETL_ERROR_TEXT(
"list:unsorted", ETL_LIST_FILE_ID
"D"), file_name_, line_number_)
137 class list_no_pool :
public list_exception
141 list_no_pool(string_type file_name_, numeric_type line_number_)
142 : list_exception(ETL_ERROR_TEXT(
"list:no pool", ETL_LIST_FILE_ID
"E"), file_name_, line_number_)
166 : previous(ETL_NULLPTR),
176 using ETL_OR_STD::swap;
178 swap(previous, next);
207 node_t* p_temp = p_node->previous;
208 p_node->previous = p_node->next;
209 p_node->next = p_temp;
210 p_node = p_node->previous;
214 node_t* p_temp = p_node->previous;
215 p_node->previous = p_node->next;
216 p_node->next = p_temp;
250 p_node = p_node->next;
336 join(*position.previous, node);
337 join(node, position);
346 right.previous = &left;
406 template <
typename T>
411 typedef T value_type;
413 typedef const T* const_pointer;
414 typedef T& reference;
415 typedef const T& const_reference;
417 typedef T&& rvalue_reference;
419 typedef size_t size_type;
430 explicit data_node_t(
const T& value_)
459 static const data_node_t* data_cast(
const node_t* p_node)
461 return reinterpret_cast<const data_node_t*
>(p_node);
477 class iterator :
public etl::iterator<ETL_OR_STD::bidirectional_iterator_tag, T>
482 friend class const_iterator;
485 : p_node(ETL_NULLPTR)
494 iterator(
const iterator& other)
495 : p_node(other.p_node)
499 iterator& operator ++()
501 p_node = p_node->next;
505 iterator operator ++(
int)
507 iterator temp(*
this);
508 p_node = p_node->next;
512 iterator& operator --()
514 p_node = p_node->previous;
518 iterator operator --(
int)
520 iterator temp(*
this);
521 p_node = p_node->previous;
525 iterator& operator =(
const iterator& other)
527 p_node = other.p_node;
531 reference operator *()
const
533 return ilist::data_cast(p_node)->value;
536 pointer operator &()
const
538 return &(ilist::data_cast(p_node)->value);
541 pointer operator ->()
const
543 return &(ilist::data_cast(p_node)->value);
546 friend bool operator == (
const iterator& lhs,
const iterator& rhs)
548 return lhs.p_node == rhs.p_node;
551 friend bool operator != (
const iterator& lhs,
const iterator& rhs)
553 return !(lhs == rhs);
564 class const_iterator :
public etl::iterator<ETL_OR_STD::bidirectional_iterator_tag, const T>
571 : p_node(ETL_NULLPTR)
575 const_iterator(
node_t& node)
580 const_iterator(
const node_t& node)
586 : p_node(other.p_node)
590 const_iterator(
const const_iterator& other)
591 : p_node(other.p_node)
595 const_iterator& operator ++()
597 p_node = p_node->next;
601 const_iterator operator ++(
int)
603 const_iterator temp(*
this);
604 p_node = p_node->next;
608 const_iterator& operator --()
610 p_node = p_node->previous;
614 const_iterator operator --(
int)
616 const_iterator temp(*
this);
617 p_node = p_node->previous;
621 const_iterator& operator =(
const const_iterator& other)
623 p_node = other.p_node;
627 const_reference operator *()
const
629 return ilist::data_cast(p_node)->value;
632 const_pointer operator &()
const
634 return &(ilist::data_cast(p_node)->value);
637 const_pointer operator ->()
const
639 return &(ilist::data_cast(p_node)->value);
642 friend bool operator == (
const const_iterator& lhs,
const const_iterator& rhs)
644 return lhs.p_node == rhs.p_node;
647 friend bool operator != (
const const_iterator& lhs,
const const_iterator& rhs)
649 return !(lhs == rhs);
657 typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
659 typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
660 typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
689 const_iterator
end()
const
731 return reverse_iterator(
get_head());
737 const_reverse_iterator
rend()
const
739 return const_reverse_iterator(
get_head());
753 const_reverse_iterator
crend()
const
755 return const_reverse_iterator(
get_head());
795 template <
typename TIterator>
798#if ETL_IS_DEBUG_BUILD
799 difference_type d = etl::distance(first, last);
806 while (first != last)
808 data_node_t& node = allocate_data_node(*first);
820#if ETL_IS_DEBUG_BUILD
829 data_node_t& node = allocate_data_node(value);
840 ETL_ASSERT_CHECK_PUSH_POP_OR_RETURN(!
full(), ETL_ERROR(
list_full));
851 ETL_ASSERT_CHECK_PUSH_POP_OR_RETURN(!
full(), ETL_ERROR(
list_full));
857#if ETL_USING_CPP11 && ETL_NOT_USING_STLPORT && !defined(ETL_LIST_FORCE_CPP03_IMPLEMENTATION)
861 template <
typename ... Args>
865 ETL_ASSERT_CHECK_PUSH_POP(!
full(), ETL_ERROR(list_full));
869 data_node_t* p_data_node = allocate_data_node();
870 ::new (&(p_data_node->value)) T(
etl::forward<Args>(args)...);
871 ETL_INCREMENT_DEBUG_COUNT;
885 data_node_t* p_data_node = allocate_data_node();
886 ::new (&(p_data_node->value)) T();
887 ETL_INCREMENT_DEBUG_COUNT;
895 template <
typename T1>
902 data_node_t* p_data_node = allocate_data_node();
903 ::new (&(p_data_node->value)) T(value1);
904 ETL_INCREMENT_DEBUG_COUNT;
912 template <
typename T1,
typename T2>
919 data_node_t* p_data_node = allocate_data_node();
920 ::new (&(p_data_node->value)) T(value1, value2);
921 ETL_INCREMENT_DEBUG_COUNT;
929 template <
typename T1,
typename T2,
typename T3>
930 reference
emplace_front(
const T1& value1,
const T2& value2,
const T3& value3)
936 data_node_t* p_data_node = allocate_data_node();
937 ::new (&(p_data_node->value)) T(value1, value2, value3);
938 ETL_INCREMENT_DEBUG_COUNT;
946 template <
typename T1,
typename T2,
typename T3,
typename T4>
947 reference
emplace_front(
const T1& value1,
const T2& value2,
const T3& value3,
const T4& value4)
953 data_node_t* p_data_node = allocate_data_node();
954 ::new (&(p_data_node->value)) T(value1, value2, value3, value4);
955 ETL_INCREMENT_DEBUG_COUNT;
977 ETL_ASSERT_CHECK_PUSH_POP_OR_RETURN(!
full(), ETL_ERROR(
list_full));
988 ETL_ASSERT_CHECK_PUSH_POP_OR_RETURN(!
full(), ETL_ERROR(
list_full));
997#if ETL_USING_CPP11 && ETL_NOT_USING_STLPORT
998 template <
typename ... Args>
1001 ETL_ASSERT_CHECK_PUSH_POP(!
full(), ETL_ERROR(list_full));
1005 data_node_t* p_data_node = allocate_data_node();
1006 ::new (&(p_data_node->value)) T(
etl::forward<Args>(args)...);
1007 ETL_INCREMENT_DEBUG_COUNT;
1018 data_node_t* p_data_node = allocate_data_node();
1019 ::new (&(p_data_node->value)) T();
1020 ETL_INCREMENT_DEBUG_COUNT;
1025 template <
typename T1>
1033 ::new (&(p_data_node->value)) T(value1);
1034 ETL_INCREMENT_DEBUG_COUNT;
1039 template <typename T1, typename T2>
1047 ::new (&(p_data_node->value)) T(value1, value2);
1048 ETL_INCREMENT_DEBUG_COUNT;
1053 template <typename T1, typename T2, typename T3>
1061 ::new (&(p_data_node->value)) T(value1, value2, value3);
1062 ETL_INCREMENT_DEBUG_COUNT;
1067 template <typename T1, typename T2, typename T3, typename T4>
1075 ::new (&(p_data_node->value)) T(value1, value2, value3, value4);
1076 ETL_INCREMENT_DEBUG_COUNT;
1096 iterator
insert(const_iterator position, const_reference value)
1100 data_node_t& data_node = allocate_data_node(value);
1101 insert_node(*to_iterator(position).p_node, data_node);
1103 return iterator(data_node);
1114 data_node_t& data_node = allocate_data_node(etl::move(value));
1115 insert_node(*to_iterator(position).p_node, data_node);
1124#if ETL_USING_CPP11 && ETL_NOT_USING_STLPORT && !defined(ETL_LIST_FORCE_CPP03_IMPLEMENTATION)
1125 template <
typename ... Args>
1126 iterator
emplace(const_iterator position, Args&& ... args)
1131 data_node_t* p_data_node = allocate_data_node();
1132 ::new (&(p_data_node->value)) T(
etl::forward<Args>(args)...);
1133 ETL_INCREMENT_DEBUG_COUNT;
1134 insert_node(*to_iterator(position).p_node, *p_data_node);
1136 return iterator(*p_data_node);
1144 data_node_t* p_data_node = allocate_data_node();
1145 ::new (&(p_data_node->value)) T();
1146 ETL_INCREMENT_DEBUG_COUNT;
1147 insert_node(*to_iterator(position).p_node, *p_data_node);
1149 return iterator(*p_data_node);
1152 template <
typename T1>
1159 ::new (&(p_data_node->value)) T(value1);
1160 ETL_INCREMENT_DEBUG_COUNT;
1161 insert_node(*to_iterator(position).p_node, *p_data_node);
1166 template <typename T1, typename T2>
1173 ::new (&(p_data_node->value)) T(value1, value2);
1174 ETL_INCREMENT_DEBUG_COUNT;
1175 insert_node(*to_iterator(position).p_node, *p_data_node);
1180 template <typename T1, typename T2, typename T3>
1187 ::new (&(p_data_node->value)) T(value1, value2, value3);
1188 ETL_INCREMENT_DEBUG_COUNT;
1189 insert_node(*to_iterator(position).p_node, *p_data_node);
1194 template <typename T1, typename T2, typename T3, typename T4>
1201 ::new (&(p_data_node->value)) T(value1, value2, value3, value4);
1202 ETL_INCREMENT_DEBUG_COUNT;
1203 insert_node(*to_iterator(position).p_node, *p_data_node);
1212 void insert(const_iterator position,
size_t n, const_reference value)
1214 for (
size_t i = 0UL; i < n; ++i)
1219 insert_node(*to_iterator(position).p_node, allocate_data_node(value));
1226 template <
typename TIterator>
1227 void insert(const_iterator position, TIterator first, TIterator last,
typename etl::enable_if<!etl::is_integral<TIterator>::value,
int>
::type = 0)
1229 while (first != last)
1234 insert_node(*to_iterator(position).p_node, allocate_data_node(*first));
1244 iterator position_ = to_iterator(position);
1247 remove_node(*position_.p_node->previous);
1254 iterator
erase(const_iterator first, const_iterator last)
1256 iterator first_ = to_iterator(first);
1257 iterator last_ = to_iterator(last);
1259 node_t* p_first = first_.p_node;
1260 node_t* p_last = last_.p_node;
1264 join(*(p_first->previous), *p_last);
1267 while (p_first != p_last)
1269 p_next = p_first->next;
1270 destroy_data_node(
static_cast<data_node_t&
>(*p_first));
1298 else if (n <
size())
1300 iterator i_start =
end();
1301 etl::advance(i_start, -difference_type(
size() - n));
1305 else if (n >
size())
1322 void remove(const_reference value)
1326 while (iValue !=
end())
1328 if (value == *iValue)
1330 iValue =
erase(iValue);
1342 template <
typename TPredicate>
1345 iterator iValue =
begin();
1347 while (iValue !=
end())
1349 if (predicate(*iValue))
1351 iValue =
erase(iValue);
1373 template <
typename TIsEqual>
1381 iterator i_item =
begin();
1383 iterator i_previous =
begin();
1385 while (i_item !=
end())
1387 if (isEqual(*i_previous, *i_item))
1389 i_item =
erase(i_item);
1393 i_previous = i_item;
1420 while (itr != other.end())
1422 to =
insert(to, etl::move(*itr));
1426 other.erase(other.begin(), other.end());
1463 insert(to, etl::move(*from));
1477 move(to, first, last);
1483 other.
erase(first, last);
1496 move(to, first, last);
1501 ilist::iterator itr = first;
1504 to =
insert(to, etl::move(*itr));
1509 other.erase(first, last);
1525 template <
typename TCompare>
1528 if ((
this != &other) && !other.
empty())
1530#if ETL_IS_DEBUG_BUILD
1541 while ((this_begin != this_end) && (other_begin != other_end))
1544 while ((this_begin != this_end) && !(
compare(*other_begin, *this_begin)))
1550 if (this_begin != this_end)
1552 while ((other_begin != other_end) && (
compare(*other_begin, *this_begin)))
1554 insert(this_begin, *other_begin);
1561 if ((this_begin == this_end) && (other_begin != other_end))
1563 insert(this_end, other_begin, other_end);
1582 template <
typename TCompare>
1587#if ETL_IS_DEBUG_BUILD
1592 ilist::iterator other_begin = other.begin();
1593 ilist::iterator other_end = other.end();
1595 ilist::iterator this_begin =
begin();
1596 ilist::iterator this_end =
end();
1598 while ((this_begin != this_end) && (other_begin != other_end))
1601 while ((this_begin != this_end) && !(compare(*other_begin, *this_begin)))
1607 if (this_begin != this_end)
1609 while ((other_begin != other_end) && (compare(*other_begin, *this_begin)))
1611 insert(this_begin, etl::move(*other_begin));
1618 if ((this_begin == this_end) && (other_begin != other_end))
1620 while (other_begin != other_end)
1622 insert(this_end, etl::move(*other_begin));
1666 template <
typename TCompare>
1675 int number_of_merges;
1690 number_of_merges = 0;
1692 while (i_left !=
end())
1699 for (
int i = 0; i < list_size; ++i)
1704 if (i_right ==
end())
1711 right_size = list_size;
1714 while (left_size > 0 || (right_size > 0 && i_right !=
end()))
1723 else if (right_size == 0 || i_right ==
end())
1729 else if (!
compare(*i_right, *i_left))
1744 if (i_head ==
end())
1746 join(*i_head.p_node, *i_node.p_node);
1752 join(*i_tail.p_node, *i_node.p_node);
1764 if (number_of_merges <= 1)
1798 while (itr != rhs.end())
1825 :
list_base(node_pool, max_size_, pool_is_shared_)
1842 ETL_RESET_DEBUG_COUNT;;
1849 while (p_first != p_last)
1851 destroy_data_node(
static_cast<data_node_t&
>(*p_first));
1852 p_first = p_first->next;
1865 void move_container(
ilist&& rhs)
1880 ETL_SET_DEBUG_COUNT(ETL_OBJECT_GET_DEBUG_COUNT(rhs));
1883 ETL_OBJECT_RESET_DEBUG_COUNT(rhs);
1884 rhs.join(rhs.terminal_node, rhs.terminal_node);
1892 while (first != last)
1920 node_t& from_node = *from.p_node;
1921 node_t& to_node = *to.p_node;
1924 join(*from_node.previous, *from_node.next);
1927 join(*to_node.previous, from_node);
1928 join(from_node, to_node);
1937 if ((first == to) || (last == to))
1942#if ETL_IS_DEBUG_BUILD
1946 ETL_ASSERT(item != to, ETL_ERROR(list_iterator));
1950 node_t& first_node = *first.p_node;
1951 node_t& last_node = *last.p_node;
1952 node_t& to_node = *to.p_node;
1953 node_t& final_node = *last_node.previous;
1956 join(*first_node.previous, last_node);
1959 join(*to_node.previous, first_node);
1960 join(final_node, to_node);
1966 void remove_node(
node_t& node)
1969 join(*node.previous, *node.next);
1972 destroy_data_node(
static_cast<data_node_t&
>(node));
1978 data_node_t& allocate_data_node(const_reference value)
1983 ::new (&(p_data_node->value)) T(value);
1984 ETL_INCREMENT_DEBUG_COUNT;
1986 return *p_data_node;
1993 data_node_t& allocate_data_node(rvalue_reference value)
1998 ::new (&(p_data_node->value)) T(etl::move(value));
1999 ETL_INCREMENT_DEBUG_COUNT;
2001 return *p_data_node;
2022 ETL_DECREMENT_DEBUG_COUNT;
2028#if defined(ETL_POLYMORPHIC_LIST) || defined(ETL_POLYMORPHIC_CONTAINERS)
2054 template <
typename T, const
size_t MAX_SIZE_>
2059 ETL_STATIC_ASSERT((MAX_SIZE_ > 0U),
"Zero capacity etl::list is not valid");
2061 static ETL_CONSTANT
size_t MAX_SIZE = MAX_SIZE_;
2065 typedef T value_type;
2067 typedef const T* const_pointer;
2068 typedef T& reference;
2069 typedef const T& const_reference;
2071 typedef T&& rvalue_reference;
2073 typedef size_t size_type;
2079 :
etl::
ilist<T>(node_pool, MAX_SIZE, false)
2095 :
etl::
ilist<T>(node_pool, MAX_SIZE, false)
2097 this->
assign(initial_size, T());
2103 list(
size_t initial_size,
const T& value)
2104 :
etl::
ilist<T>(node_pool, MAX_SIZE, false)
2106 this->
assign(initial_size, value);
2113 :
etl::
ilist<T>(node_pool, MAX_SIZE, false)
2126 :
etl::
ilist<T>(node_pool, MAX_SIZE, false)
2133 while (itr != other.end())
2135 this->push_back(etl::move(*itr));
2147 template <
typename TIterator>
2149 :
ilist<T>(node_pool, MAX_SIZE, false)
2151 this->
assign(first, last);
2154#if ETL_HAS_INITIALIZER_LIST
2158 list(std::initializer_list<T> init)
2159 :
ilist<T>(node_pool, MAX_SIZE, false)
2161 this->assign(init.begin(), init.end());
2184 this->move_container(etl::move(rhs));
2196 template <
typename T, const
size_t MAX_SIZE_>
2202#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST
2203 template <
typename... T>
2204 list(T...) -> list<
typename etl::common_type_t<T...>,
2211#if ETL_USING_CPP11 && ETL_HAS_INITIALIZER_LIST
2212 template <
typename... T>
2213 constexpr auto make_list(T... t) -> etl::list<
typename etl::common_type_t<T...>,
sizeof...(T)>
2215 return { etl::forward<T>(t)... };
2222 template <
typename T>
2227 typedef T value_type;
2229 typedef const T* const_pointer;
2230 typedef T& reference;
2231 typedef const T& const_reference;
2232 typedef size_t size_type;
2248 :
etl::
ilist<T>(node_pool, node_pool.max_size(), true)
2264 :
etl::
ilist<T>(node_pool, node_pool.max_size(), true)
2266 this->
assign(initial_size, T());
2273 :
etl::
ilist<T>(node_pool, node_pool.max_size(), true)
2275 this->
assign(initial_size, value);
2294 :
etl::
ilist<T>(node_pool, node_pool.max_size(), true)
2307 :
etl::
ilist<T>(*other.p_node_pool, other.p_node_pool->max_size(), true)
2309 this->move_container(etl::move(other));
2315 list_ext(list_ext&& other,
etl::ipool& node_pool)
2316 :
etl::ilist<T>(node_pool, node_pool.max_size(), true)
2318 this->move_container(etl::move(other));
2325 template <
typename TIterator>
2327 :
ilist<T>(node_pool, node_pool.max_size(), true)
2329 this->
assign(first, last);
2332#if ETL_HAS_INITIALIZER_LIST
2337 :
ilist<T>(node_pool, node_pool.max_size(), true)
2339 this->assign(init.begin(), init.end());
2362 this->move_container(etl::move(rhs));
2397 template <
typename T>
2409 template <
typename T>
2412 return !(lhs == rhs);
2422 template <
typename T>
2425 return etl::lexicographical_compare(lhs.
begin(), lhs.
end(), rhs.
begin(), rhs.
end());
2435 template <
typename T>
2448 template <
typename T>
2451 return !(lhs > rhs);
2461 template <
typename T>
2464 return !(lhs < rhs);
const_iterator
Definition list.h:565
iterator.
Definition list.h:478
Template deduction guides.
Definition list.h:2224
list_ext(const list_ext &other, etl::ipool &node_pool)
Copy constructor. Explicit pool.
Definition list.h:2293
list_ext(size_t initial_size, etl::ipool &node_pool)
Construct from size.
Definition list.h:2263
void set_pool(etl::ipool &pool)
Set the pool instance.
Definition list.h:2371
list_ext(size_t initial_size, const T &value, etl::ipool &node_pool)
Construct from size and value.
Definition list.h:2272
list_ext(TIterator first, TIterator last, etl::ipool &node_pool, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
Construct from range.
Definition list.h:2326
list_ext()
Default constructor.
Definition list.h:2239
etl::ipool & get_pool() const
Get the pool instance.
Definition list.h:2385
list_ext(etl::ipool &node_pool)
Default constructor.
Definition list.h:2247
~list_ext()
Destructor.
Definition list.h:2255
list_ext(const list_ext &other)
Copy constructor. Implicit pool.
Definition list.h:2281
A templated list implementation that uses a fixed size buffer.
Definition list.h:2056
~list()
Destructor.
Definition list.h:2086
list(const list &other)
Copy constructor.
Definition list.h:2112
list(size_t initial_size, const T &value)
Construct from size and value.
Definition list.h:2103
list(TIterator first, TIterator last, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
Construct from range.
Definition list.h:2148
list(size_t initial_size)
Construct from size.
Definition list.h:2094
list()
Default constructor.
Definition list.h:2078
ETL_CONSTEXPR14 bool operator==(const etl::expected< TValue, TError > &lhs, const etl::expected< TValue2, TError2 > &rhs)
Equivalence operators.
Definition expected.h:962
ETL_NODISCARD ETL_CONSTEXPR14 bool is_sorted(TIterator begin, TIterator end)
Definition algorithm.h:1709
ETL_CONSTEXPR14 TIterator remove(TIterator first, TIterator last, const T &value)
Definition algorithm.h:2300
#define ETL_ASSERT(b, e)
Definition error_handler.h:356
ETL_CONSTEXPR exception(string_type reason_, string_type, numeric_type line_)
Constructor.
Definition exception.h:69
ilist(etl::ipool &node_pool, size_t max_size_, bool pool_is_shared_)
Constructor.
Definition list.h:1824
const_reverse_iterator rend() const
Gets the reverse end of the list.
Definition list.h:737
void clear()
Clears the list.
Definition list.h:1314
const_iterator cbegin() const
Gets the beginning of the list.
Definition list.h:697
iterator end()
Gets the end of the list.
Definition list.h:681
void push_back(const T &value)
Pushes a value to the back of the list.
Definition list.h:975
iterator emplace(const_iterator position)
Emplaces a value to the list at the specified position.
Definition list.h:1139
ilist(bool pool_is_shared_)
Constructor.
Definition list.h:1816
reference back()
Gets a reference to the last element.
Definition list.h:777
size_t size_type
The type used for determining the size of list.
Definition list.h:155
void reverse()
Reverses the list.
Definition list.h:196
const_reverse_iterator crend() const
Gets the reverse end of the list.
Definition list.h:753
reference emplace_front(const T1 &value1)
Emplaces a value to the front of the list.
Definition list.h:896
void splice(iterator to, ilist &other, iterator from)
Splices an element from another list to this.
Definition list.h:1434
size_type size() const
Gets the size of the list.
Definition list.h:238
void sort(TCompare compare)
Definition list.h:1667
size_type available() const
Definition list.h:282
void splice(iterator to, ilist &other, iterator first, iterator last)
Splices a range of elements from another list to this.
Definition list.h:1472
void join(node_t &left, node_t &right)
Join two nodes.
Definition list.h:343
void insert(const_iterator position, size_t n, const_reference value)
Inserts 'n' copies of a value to the list at the specified position.
Definition list.h:1212
void unique(TIsEqual isEqual)
Definition list.h:1374
void insert(const_iterator position, TIterator first, TIterator last, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
Inserts a range of values to the list at the specified position.
Definition list.h:1227
const_reverse_iterator rbegin() const
Gets the reverse beginning of the list.
Definition list.h:721
list_base(bool pool_is_shared_)
The constructor that is called from derived classes.
Definition list.h:352
etl::ipool * p_node_pool
The pool of data nodes used in the list.
Definition list.h:395
size_type max_size() const
Gets the maximum possible size of the list.
Definition list.h:222
void resize(size_t n)
Resizes the list.
Definition list.h:1280
list_base(etl::ipool &node_pool_, size_type max_size_, bool pool_is_shared_)
The constructor that is called from derived classes.
Definition list.h:363
bool full() const
Checks to see if the list is full.
Definition list.h:272
reverse_iterator rend()
Gets the reverse end of the list.
Definition list.h:729
reverse_iterator rbegin()
Gets the reverse beginning of the list.
Definition list.h:713
reference emplace_front()
Emplaces a value to the front of the list.
Definition list.h:879
ilist & operator=(const ilist &rhs)
Assignment operator.
Definition list.h:1777
iterator insert(const_iterator position, const_reference value)
Inserts a value to the list at the specified position.
Definition list.h:1096
size_type MAX_SIZE
The maximum size of the list.
Definition list.h:397
node_t terminal_node
The node that acts as the list start and end.
Definition list.h:396
void push_front(const T &value)
Pushes a value to the front of the list.
Definition list.h:838
void initialise()
Initialise the list.
Definition list.h:1832
bool pool_is_shared
If true then the pool is shared between lists.
Definition list.h:398
void splice(iterator to, ilist &other)
Splices from another list to this.
Definition list.h:1402
const_iterator end() const
Gets the end of the list.
Definition list.h:689
ETL_DECLARE_DEBUG_COUNT
Internal debugging.
Definition list.h:399
reference front()
Gets a reference to the first element.
Definition list.h:761
void pop_front()
Removes a value from the front of the list.
Definition list.h:964
const_iterator begin() const
Gets the beginning of the list.
Definition list.h:673
void merge(ilist &other)
Merge another list into this one. Both lists should be sorted.
Definition list.h:1517
bool is_trivial_list() const
Is the list a trivial length?
Definition list.h:293
void assign(size_t n, const T &value)
Assigns 'n' copies of a value to the list.
Definition list.h:818
iterator erase(const_iterator first, const_iterator last)
Erases a range of elements.
Definition list.h:1254
reference emplace_front(const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
Emplaces a value to the front of the list.
Definition list.h:947
void set_node_pool(etl::ipool &node_pool_)
Set the node pool instance.
Definition list.h:374
reference emplace_front(const T1 &value1, const T2 &value2, const T3 &value3)
Emplaces a value to the front of the list.
Definition list.h:930
void merge(ilist &other, TCompare compare)
Merge another list into this one. Both lists should be sorted.
Definition list.h:1526
void resize(size_t n, const_reference value)
Resizes the list.
Definition list.h:1288
size_type capacity() const
Gets the maximum possible size of the list.
Definition list.h:230
reference emplace_back()
Emplaces a value to the back of the list.
Definition list.h:1012
bool empty() const
Checks to see if the list is empty.
Definition list.h:264
etl::ipool * get_node_pool()
Get the node pool instance.
Definition list.h:383
iterator begin()
Gets the beginning of the list.
Definition list.h:665
void sort()
Definition list.h:1636
const_reference back() const
Gets a reference to the last element.
Definition list.h:785
void unique()
Definition list.h:1364
const_reference front() const
Gets a const reference to the first element.
Definition list.h:769
node_t & get_head()
Get the head node.
Definition list.h:301
const node_t & get_head() const
Get the head node.
Definition list.h:309
void insert_node(node_t &position, node_t &node)
Insert a node before 'position'.
Definition list.h:333
const node_t & get_tail() const
Get the tail node.
Definition list.h:325
const_iterator cend() const
Gets the end of the list.
Definition list.h:705
const_reverse_iterator crbegin() const
Gets the reverse beginning of the list.
Definition list.h:745
~list_base()
Destructor.
Definition list.h:391
void remove_if(TPredicate predicate)
Removes according to a predicate.
Definition list.h:1343
void assign(TIterator first, TIterator last, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
Definition list.h:796
node_t & get_tail()
Get the tail node.
Definition list.h:317
iterator erase(const_iterator position)
Erases the value at the specified position.
Definition list.h:1242
bool has_shared_pool() const
true if the list has a shared pool.
Definition list.h:188
void pop_back()
Removes a value from the back of the list.
Definition list.h:1085
reference emplace_front(const T1 &value1, const T2 &value2)
Emplaces a value to the front of the list.
Definition list.h:913
T * allocate()
Definition ipool.h:316
enable_if
Definition type_traits_generator.h:1254
bitset_ext
Definition absolute.h:39
ETL_CONSTEXPR14 void swap(etl::typed_storage_ext< T > &lhs, etl::typed_storage_ext< T > &rhs) ETL_NOEXCEPT
Swap two etl::typed_storage_ext.
Definition alignment.h:838
bool operator>(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1190
bool operator>=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1202
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1151
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1139
bool operator<(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1163
bool operator<=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition array.h:1178
Definition functional.h:274
The data node element in the list.
Definition list.h:429
iterator
Definition iterator.h:399
Definition functional.h:170
The node element in the list.
Definition list.h:161
void reverse()
Reverses the previous & next pointers.
Definition list.h:174
node_t()
Constructor.
Definition list.h:165
etl::conditional< etl::is_fundamental< T >::value||etl::is_pointer< T >::value, T, constT & >::type type
By default fundamental and pointer types are passed by value.
Definition parameter_type.h:48