31#ifndef ETL_LIST_INCLUDED
32#define ETL_LIST_INCLUDED
47#include "static_assert.h"
72 list_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
73 :
exception(reason_, file_name_, line_number_)
86 list_full(string_type file_name_, numeric_type line_number_)
87 :
list_exception(ETL_ERROR_TEXT(
"list:full", ETL_LIST_FILE_ID
"A"), file_name_, line_number_)
100 list_empty(string_type file_name_, numeric_type line_number_)
101 :
list_exception(ETL_ERROR_TEXT(
"list:empty", ETL_LIST_FILE_ID
"B"), file_name_, line_number_)
114 list_iterator(string_type file_name_, numeric_type line_number_)
115 :
list_exception(ETL_ERROR_TEXT(
"list:iterator", ETL_LIST_FILE_ID
"C"), file_name_, line_number_)
128 list_unsorted(string_type file_name_, numeric_type line_number_)
129 :
list_exception(ETL_ERROR_TEXT(
"list:unsorted", ETL_LIST_FILE_ID
"D"), file_name_, line_number_)
142 list_no_pool(string_type file_name_, numeric_type line_number_)
143 :
list_exception(ETL_ERROR_TEXT(
"list:no pool", ETL_LIST_FILE_ID
"E"), file_name_, line_number_)
167 : previous(ETL_NULLPTR),
179 swap(previous, next);
208 node_t* p_temp = p_node->previous;
209 p_node->previous = p_node->next;
210 p_node->next = p_temp;
211 p_node = p_node->previous;
215 node_t* p_temp = p_node->previous;
216 p_node->previous = p_node->next;
217 p_node->next = p_temp;
251 p_node = p_node->next;
337 join(*position.previous, node);
338 join(node, position);
347 right.previous = &left;
400 ETL_DECLARE_DEBUG_COUNT
407 template <
typename T>
412 typedef T value_type;
414 typedef const T* const_pointer;
415 typedef T& reference;
416 typedef const T& const_reference;
418 typedef T&& rvalue_reference;
452 static data_node_t& data_cast(node_t& node)
454 return reinterpret_cast<data_node_t&
>(node);
460 static const data_node_t* data_cast(
const node_t* p_node)
462 return reinterpret_cast<const data_node_t*
>(p_node);
468 static const data_node_t& data_cast(
const node_t& node)
470 return reinterpret_cast<const data_node_t&
>(node);
486 : p_node(ETL_NULLPTR)
496 : p_node(other.p_node)
502 p_node = p_node->next;
509 p_node = p_node->next;
515 p_node = p_node->previous;
522 p_node = p_node->previous;
528 p_node = other.p_node;
532 reference operator *()
const
534 return ilist::data_cast(p_node)->value;
539 return &(ilist::data_cast(p_node)->value);
542 pointer operator ->()
const
544 return &(ilist::data_cast(p_node)->value);
549 return lhs.p_node == rhs.p_node;
554 return !(lhs == rhs);
572 : p_node(ETL_NULLPTR)
587 : p_node(other.p_node)
592 : p_node(other.p_node)
598 p_node = p_node->next;
605 p_node = p_node->next;
611 p_node = p_node->previous;
618 p_node = p_node->previous;
624 p_node = other.p_node;
628 const_reference operator *()
const
630 return ilist::data_cast(p_node)->value;
635 return &(ilist::data_cast(p_node)->value);
638 const_pointer operator ->()
const
640 return &(ilist::data_cast(p_node)->value);
645 return lhs.p_node == rhs.p_node;
650 return !(lhs == rhs);
658 typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
660 typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
661 typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
732 return reverse_iterator(
get_head());
738 const_reverse_iterator
rend()
const
740 return const_reverse_iterator(
get_head());
754 const_reverse_iterator
crend()
const
756 return const_reverse_iterator(
get_head());
796 template <
typename TIterator>
799#if ETL_IS_DEBUG_BUILD
800 difference_type d = etl::distance(first, last);
807 while (first != last)
821#if ETL_IS_DEBUG_BUILD
841#if defined(ETL_CHECK_PUSH_POP)
853#if defined(ETL_CHECK_PUSH_POP)
860#if ETL_USING_CPP11 && ETL_NOT_USING_STLPORT
864 template <
typename ... Args>
867#if defined(ETL_CHECK_PUSH_POP)
872 data_node_t* p_data_node = allocate_data_node();
873 ::new (&(p_data_node->value)) T(
etl::forward<Args>(args)...);
874 ETL_INCREMENT_DEBUG_COUNT
882 template <
typename T1>
885#if defined(ETL_CHECK_PUSH_POP)
891 ::new (&(p_data_node->value)) T(value1);
892 ETL_INCREMENT_DEBUG_COUNT
900 template <
typename T1,
typename T2>
903#if defined(ETL_CHECK_PUSH_POP)
909 ::new (&(p_data_node->value)) T(value1, value2);
910 ETL_INCREMENT_DEBUG_COUNT
918 template <
typename T1,
typename T2,
typename T3>
919 reference
emplace_front(
const T1& value1,
const T2& value2,
const T3& value3)
921#if defined(ETL_CHECK_PUSH_POP)
927 ::new (&(p_data_node->value)) T(value1, value2, value3);
928 ETL_INCREMENT_DEBUG_COUNT
936 template <
typename T1,
typename T2,
typename T3,
typename T4>
937 reference
emplace_front(
const T1& value1,
const T2& value2,
const T3& value3,
const T4& value4)
939#if defined(ETL_CHECK_PUSH_POP)
945 ::new (&(p_data_node->value)) T(value1, value2, value3, value4);
946 ETL_INCREMENT_DEBUG_COUNT
957#if defined(ETL_CHECK_PUSH_POP)
969#if defined(ETL_CHECK_PUSH_POP)
981#if defined(ETL_CHECK_PUSH_POP)
991#if ETL_USING_CPP11 && ETL_NOT_USING_STLPORT
992 template <
typename ... Args>
995#if defined(ETL_CHECK_PUSH_POP)
1000 data_node_t* p_data_node = allocate_data_node();
1001 ::new (&(p_data_node->value)) T(
etl::forward<Args>(args)...);
1002 ETL_INCREMENT_DEBUG_COUNT
1007 template <
typename T1>
1010#if defined(ETL_CHECK_PUSH_POP)
1016 ::new (&(p_data_node->value)) T(value1);
1017 ETL_INCREMENT_DEBUG_COUNT
1022 template <
typename T1,
typename T2>
1023 reference
emplace_back(
const T1& value1,
const T2& value2)
1025#if defined(ETL_CHECK_PUSH_POP)
1030 data_node_t* p_data_node = allocate_data_node();
1031 ::new (&(p_data_node->value)) T(value1, value2);
1032 ETL_INCREMENT_DEBUG_COUNT
1037 template <typename T1, typename T2, typename T3>
1038 reference
emplace_back(const T1& value1, const T2& value2, const T3& value3)
1040#if defined(ETL_CHECK_PUSH_POP)
1045 data_node_t* p_data_node = allocate_data_node();
1046 ::new (&(p_data_node->value)) T(value1, value2, value3);
1047 ETL_INCREMENT_DEBUG_COUNT
1052 template <typename T1, typename T2, typename T3, typename T4>
1053 reference
emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4)
1055#if defined(ETL_CHECK_PUSH_POP)
1060 data_node_t* p_data_node = allocate_data_node();
1061 ::new (&(p_data_node->value)) T(value1, value2, value3, value4);
1062 ETL_INCREMENT_DEBUG_COUNT
1073#if defined(ETL_CHECK_PUSH_POP)
1087 data_node_t& data_node = allocate_data_node(value);
1088 insert_node(*to_iterator(position).p_node, data_node);
1101 data_node_t& data_node = allocate_data_node(etl::move(value));
1102 insert_node(*to_iterator(position).p_node, data_node);
1111#if ETL_USING_CPP11 && ETL_NOT_USING_STLPORT
1112 template <
typename ... Args>
1113 iterator
emplace(const_iterator position, Args && ... args)
1118 data_node_t* p_data_node = allocate_data_node();
1119 ::new (&(p_data_node->value)) T(
etl::forward<Args>(args)...);
1120 ETL_INCREMENT_DEBUG_COUNT
1121 insert_node(*to_iterator(position).p_node, *p_data_node);
1123 return iterator(*p_data_node);
1126 template <
typename T1>
1133 ::new (&(p_data_node->value)) T(value1);
1134 ETL_INCREMENT_DEBUG_COUNT
1140 template <
typename T1,
typename T2>
1141 iterator emplace(const_iterator position,
const T1& value1,
const T2& value2)
1146 data_node_t* p_data_node = allocate_data_node();
1147 ::new (&(p_data_node->value)) T(value1, value2);
1148 ETL_INCREMENT_DEBUG_COUNT
1154 template <typename T1, typename T2, typename T3>
1155 iterator emplace(const_iterator position, const T1& value1, const T2& value2, const T3& value3)
1160 data_node_t* p_data_node = allocate_data_node();
1161 ::new (&(p_data_node->value)) T(value1, value2, value3);
1162 ETL_INCREMENT_DEBUG_COUNT
1168 template <typename T1, typename T2, typename T3, typename T4>
1169 iterator emplace(const_iterator position, const T1& value1, const T2& value2, const T3& value3, const T4& value4)
1174 data_node_t* p_data_node = allocate_data_node();
1175 ::new (&(p_data_node->value)) T(value1, value2, value3, value4);
1176 ETL_INCREMENT_DEBUG_COUNT
1188 for (
size_t i = 0UL; i < n; ++i)
1193 insert_node(*to_iterator(position).p_node, allocate_data_node(value));
1200 template <
typename TIterator>
1203 while (first != last)
1208 insert_node(*to_iterator(position).p_node, allocate_data_node(*first));
1218 iterator position_ = to_iterator(position);
1221 remove_node(*position_.p_node->previous);
1230 iterator first_ = to_iterator(first);
1231 iterator last_ = to_iterator(last);
1233 node_t* p_first = first_.p_node;
1234 node_t* p_last = last_.p_node;
1238 join(*(p_first->previous), *p_last);
1241 while (p_first != p_last)
1243 p_next = p_first->next;
1244 destroy_data_node(
static_cast<data_node_t&
>(*p_first));
1272 else if (n <
size())
1275 etl::advance(i_start, -difference_type(
size() - n));
1279 else if (n >
size())
1296 void remove(const_reference value)
1300 while (iValue !=
end())
1302 if (value == *iValue)
1304 iValue =
erase(iValue);
1316 template <
typename TPredicate>
1321 while (iValue !=
end())
1323 if (predicate(*iValue))
1325 iValue =
erase(iValue);
1347 template <
typename TIsEqual>
1359 while (i_item !=
end())
1361 if (isEqual(*i_previous, *i_item))
1363 i_item =
erase(i_item);
1367 i_previous = i_item;
1394 while (itr != other.end())
1396 to =
insert(to, etl::move(*itr));
1400 other.erase(other.begin(), other.end());
1437 insert(to, etl::move(*from));
1451 move(to, first, last);
1457 other.
erase(first, last);
1470 move(to, first, last);
1475 ilist::iterator itr = first;
1478 to =
insert(to, etl::move(*itr));
1483 other.erase(first, last);
1499 template <
typename TCompare>
1502 if ((
this != &other) && !other.
empty())
1504#if ETL_IS_DEBUG_BUILD
1515 while ((this_begin != this_end) && (other_begin != other_end))
1518 while ((this_begin != this_end) && !(
compare(*other_begin, *this_begin)))
1524 if (this_begin != this_end)
1526 while ((other_begin != other_end) && (
compare(*other_begin, *this_begin)))
1528 insert(this_begin, *other_begin);
1535 if ((this_begin == this_end) && (other_begin != other_end))
1537 insert(this_end, other_begin, other_end);
1556 template <
typename TCompare>
1561#if ETL_IS_DEBUG_BUILD
1566 ilist::iterator other_begin = other.begin();
1567 ilist::iterator other_end = other.end();
1569 ilist::iterator this_begin =
begin();
1570 ilist::iterator this_end =
end();
1572 while ((this_begin != this_end) && (other_begin != other_end))
1575 while ((this_begin != this_end) && !(compare(*other_begin, *this_begin)))
1581 if (this_begin != this_end)
1583 while ((other_begin != other_end) && (compare(*other_begin, *this_begin)))
1585 insert(this_begin, etl::move(*other_begin));
1592 if ((this_begin == this_end) && (other_begin != other_end))
1594 while (other_begin != other_end)
1596 insert(this_end, etl::move(*other_begin));
1640 template <
typename TCompare>
1649 int number_of_merges;
1664 number_of_merges = 0;
1666 while (i_left !=
end())
1673 for (
int i = 0; i < list_size; ++i)
1678 if (i_right ==
end())
1685 right_size = list_size;
1688 while (left_size > 0 || (right_size > 0 && i_right !=
end()))
1697 else if (right_size == 0 || i_right ==
end())
1703 else if (!
compare(*i_right, *i_left))
1718 if (i_head ==
end())
1720 join(*i_head.p_node, *i_node.p_node);
1726 join(*i_tail.p_node, *i_node.p_node);
1738 if (number_of_merges <= 1)
1772 while (itr != rhs.end())
1799 :
list_base(node_pool, max_size_, pool_is_shared_)
1816 ETL_RESET_DEBUG_COUNT;
1823 while (p_first != p_last)
1825 destroy_data_node(
static_cast<data_node_t&
>(*p_first));
1826 p_first = p_first->next;
1839 void move_container(
ilist&& rhs)
1854 ETL_SET_DEBUG_COUNT(ETL_OBJECT_GET_DEBUG_COUNT(rhs));
1857 ETL_OBJECT_RESET_DEBUG_COUNT(rhs);
1858 rhs.join(rhs.terminal_node, rhs.terminal_node);
1866 while (first != last)
1887 void move(iterator to, iterator from)
1894 node_t& from_node = *from.p_node;
1895 node_t& to_node = *to.p_node;
1898 join(*from_node.previous, *from_node.next);
1901 join(*to_node.previous, from_node);
1902 join(from_node, to_node);
1909 void move(iterator to, iterator first, iterator last)
1911 if ((first == to) || (last == to))
1916#if ETL_IS_DEBUG_BUILD
1918 for (const_iterator item = first; item != last; ++item)
1920 ETL_ASSERT(item != to, ETL_ERROR(list_iterator));
1924 node_t& first_node = *first.p_node;
1925 node_t& last_node = *last.p_node;
1926 node_t& to_node = *to.p_node;
1927 node_t& final_node = *last_node.previous;
1930 join(*first_node.previous, last_node);
1933 join(*to_node.previous, first_node);
1934 join(final_node, to_node);
1940 void remove_node(node_t& node)
1943 join(*node.previous, *node.next);
1946 destroy_data_node(
static_cast<data_node_t&
>(node));
1952 data_node_t& allocate_data_node(const_reference value)
1956 data_node_t* p_data_node = allocate_data_node();
1957 ::new (&(p_data_node->value)) T(value);
1958 ETL_INCREMENT_DEBUG_COUNT
1960 return *p_data_node;
1967 data_node_t& allocate_data_node(rvalue_reference value)
1971 data_node_t* p_data_node = allocate_data_node();
1972 ::new (&(p_data_node->value)) T(
etl::move(value));
1973 ETL_INCREMENT_DEBUG_COUNT
1975 return *p_data_node;
1982 data_node_t* allocate_data_node()
1984 data_node_t* (
etl::ipool::*func)() = &etl::ipool::allocate<data_node_t>;
1991 void destroy_data_node(data_node_t& node)
1996 ETL_DECREMENT_DEBUG_COUNT
2002#if defined(ETL_POLYMORPHIC_LIST) || defined(ETL_POLYMORPHIC_CONTAINERS)
2019 iterator to_iterator(const_iterator itr)
const
2021 return iterator(*(
const_cast<node_t*
>(itr.p_node)));
2028 template <
typename T, const
size_t MAX_SIZE_>
2033 ETL_STATIC_ASSERT((MAX_SIZE_ > 0U),
"Zero capacity etl::list is not valid");
2035 static ETL_CONSTANT
size_t MAX_SIZE = MAX_SIZE_;
2039 typedef T value_type;
2041 typedef const T* const_pointer;
2042 typedef T& reference;
2043 typedef const T& const_reference;
2045 typedef T&& rvalue_reference;
2071 this->
assign(initial_size, T());
2077 list(
size_t initial_size,
const T& value)
2080 this->
assign(initial_size, value);
2107 while (itr != other.end())
2121 template <
typename TIterator>
2125 this->
assign(first, last);
2128#if ETL_HAS_INITIALIZER_LIST
2132 list(std::initializer_list<T> init)
2135 this->
assign(init.begin(), init.end());
2158 this->move_container(etl::move(rhs));
2170 template <
typename T, const
size_t MAX_SIZE_>
2171 ETL_CONSTANT
size_t list<T, MAX_SIZE_>::MAX_SIZE;
2176#if ETL_USING_CPP17 && ETL_HAS_INITIALIZER_LIST
2177 template <
typename... T>
2178 list(T...) -> list<
typename etl::common_type_t<T...>,
2185#if ETL_USING_CPP11 && ETL_HAS_INITIALIZER_LIST
2186 template <
typename... T>
2187 constexpr auto make_list(T... t) ->
etl::list<
typename etl::common_type_t<T...>,
sizeof...(T)>
2189 return { { etl::forward<T>(t)... } };
2196 template <
typename T>
2201 typedef T value_type;
2203 typedef const T* const_pointer;
2204 typedef T& reference;
2205 typedef const T& const_reference;
2240 this->
assign(initial_size, T());
2249 this->
assign(initial_size, value);
2283 this->move_container(etl::move(other));
2289 list_ext(list_ext&& other,
etl::ipool& node_pool)
2292 this->move_container(etl::move(other));
2299 template <
typename TIterator>
2303 this->
assign(first, last);
2306#if ETL_HAS_INITIALIZER_LIST
2313 this->
assign(init.begin(), init.end());
2336 this->move_container(etl::move(rhs));
2371 template <
typename T>
2383 template <
typename T>
2386 return !(lhs == rhs);
2396 template <
typename T>
2399 return etl::lexicographical_compare(lhs.
begin(), lhs.
end(), rhs.
begin(), rhs.
end());
2409 template <
typename T>
2422 template <
typename T>
2425 return !(lhs > rhs);
2435 template <
typename T>
2438 return !(lhs < rhs);
const_iterator
Definition: list.h:566
iterator.
Definition: list.h:479
Template deduction guides.
Definition: list.h:2198
list_ext(const list_ext &other, etl::ipool &node_pool)
Copy constructor. Explicit pool.
Definition: list.h:2267
list_ext(size_t initial_size, etl::ipool &node_pool)
Construct from size.
Definition: list.h:2237
void set_pool(etl::ipool &pool)
Set the pool instance.
Definition: list.h:2345
list_ext(size_t initial_size, const T &value, etl::ipool &node_pool)
Construct from size and value.
Definition: list.h:2246
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:2300
list_ext()
Default constructor.
Definition: list.h:2213
etl::ipool & get_pool() const
Get the pool instance.
Definition: list.h:2359
list_ext(etl::ipool &node_pool)
Default constructor.
Definition: list.h:2221
~list_ext()
Destructor.
Definition: list.h:2229
list_ext(const list_ext &other)
Copy constructor. Implicit pool.
Definition: list.h:2255
A templated list implementation that uses a fixed size buffer.
Definition: list.h:2030
~list()
Destructor.
Definition: list.h:2060
list(const list &other)
Copy constructor.
Definition: list.h:2086
list(size_t initial_size, const T &value)
Construct from size and value.
Definition: list.h:2077
list(TIterator first, TIterator last, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
Construct from range.
Definition: list.h:2122
list(size_t initial_size)
Construct from size.
Definition: list.h:2068
list()
Default constructor.
Definition: list.h:2052
ETL_NODISCARD ETL_CONSTEXPR14 bool is_sorted(TIterator begin, TIterator end)
Definition: algorithm.h:1441
ETL_CONSTEXPR14 TIterator remove(TIterator first, TIterator last, const T &value)
Definition: algorithm.h:1934
#define ETL_ASSERT(b, e)
Definition: error_handler.h:316
ETL_CONSTEXPR exception(string_type reason_, string_type, numeric_type line_)
Constructor.
Definition: exception.h:69
Definition: exception.h:47
ilist(etl::ipool &node_pool, size_t max_size_, bool pool_is_shared_)
Constructor.
Definition: list.h:1798
const_reverse_iterator rend() const
Gets the reverse end of the list.
Definition: list.h:738
void clear()
Clears the list.
Definition: list.h:1288
const_iterator cbegin() const
Gets the beginning of the list.
Definition: list.h:698
iterator end()
Gets the end of the list.
Definition: list.h:682
void push_back(const T &value)
Pushes a value to the back of the list.
Definition: list.h:967
ilist(bool pool_is_shared_)
Constructor.
Definition: list.h:1790
reference back()
Gets a reference to the last element.
Definition: list.h:778
size_t size_type
The type used for determining the size of list.
Definition: list.h:156
void reverse()
Reverses the list.
Definition: list.h:197
const_reverse_iterator crend() const
Gets the reverse end of the list.
Definition: list.h:754
iterator emplace(const_iterator position, const T1 &value1)
Emplaces a value to the list at the specified position.
Definition: list.h:1127
reference emplace_front(const T1 &value1)
Emplaces a value to the front of the list.
Definition: list.h:883
void splice(iterator to, ilist &other, iterator from)
Splices an element from another list to this.
Definition: list.h:1408
size_type size() const
Gets the size of the list.
Definition: list.h:239
void sort(TCompare compare)
Definition: list.h:1641
size_type available() const
Definition: list.h:283
void splice(iterator to, ilist &other, iterator first, iterator last)
Splices a range of elements from another list to this.
Definition: list.h:1446
void join(node_t &left, node_t &right)
Join two nodes.
Definition: list.h:344
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:1186
void unique(TIsEqual isEqual)
Definition: list.h:1348
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:1201
const_reverse_iterator rbegin() const
Gets the reverse beginning of the list.
Definition: list.h:722
list_base(bool pool_is_shared_)
The constructor that is called from derived classes.
Definition: list.h:353
etl::ipool * p_node_pool
The pool of data nodes used in the list.
Definition: list.h:396
size_type max_size() const
Gets the maximum possible size of the list.
Definition: list.h:223
void resize(size_t n)
Resizes the list.
Definition: list.h:1254
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:364
bool full() const
Checks to see if the list is full.
Definition: list.h:273
reverse_iterator rend()
Gets the reverse end of the list.
Definition: list.h:730
reverse_iterator rbegin()
Gets the reverse beginning of the list.
Definition: list.h:714
ilist & operator=(const ilist &rhs)
Assignment operator.
Definition: list.h:1751
iterator insert(const_iterator position, const_reference value)
Inserts a value to the list at the specified position.
Definition: list.h:1083
size_type MAX_SIZE
The maximum size of the list.
Definition: list.h:398
node_t terminal_node
The node that acts as the list start and end.
Definition: list.h:397
void push_front(const T &value)
Pushes a value to the front of the list.
Definition: list.h:839
void initialise()
Initialise the list.
Definition: list.h:1806
reference emplace_back(const T1 &value1)
Emplaces a value to the back of the list.
Definition: list.h:1008
bool pool_is_shared
If true then the pool is shared between lists.
Definition: list.h:399
void splice(iterator to, ilist &other)
Splices from another list to this.
Definition: list.h:1376
const_iterator end() const
Gets the end of the list.
Definition: list.h:690
reference front()
Gets a reference to the first element.
Definition: list.h:762
void pop_front()
Removes a value from the front of the list.
Definition: list.h:955
const_iterator begin() const
Gets the beginning of the list.
Definition: list.h:674
void merge(ilist &other)
Merge another list into this one. Both lists should be sorted.
Definition: list.h:1491
bool is_trivial_list() const
Is the list a trivial length?
Definition: list.h:294
void assign(size_t n, const T &value)
Assigns 'n' copies of a value to the list.
Definition: list.h:819
iterator erase(const_iterator first, const_iterator last)
Erases a range of elements.
Definition: list.h:1228
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:937
void set_node_pool(etl::ipool &node_pool_)
Set the node pool instance.
Definition: list.h:375
reference emplace_front(const T1 &value1, const T2 &value2, const T3 &value3)
Emplaces a value to the front of the list.
Definition: list.h:919
void merge(ilist &other, TCompare compare)
Merge another list into this one. Both lists should be sorted.
Definition: list.h:1500
void resize(size_t n, const_reference value)
Resizes the list.
Definition: list.h:1262
size_type capacity() const
Gets the maximum possible size of the list.
Definition: list.h:231
bool empty() const
Checks to see if the list is empty.
Definition: list.h:265
etl::ipool * get_node_pool()
Get the node pool instance.
Definition: list.h:384
iterator begin()
Gets the beginning of the list.
Definition: list.h:666
void sort()
Definition: list.h:1610
const_reference back() const
Gets a reference to the last element.
Definition: list.h:786
void unique()
Definition: list.h:1338
const_reference front() const
Gets a const reference to the first element.
Definition: list.h:770
node_t & get_head()
Get the head node.
Definition: list.h:302
const node_t & get_head() const
Get the head node.
Definition: list.h:310
void insert_node(node_t &position, node_t &node)
Insert a node before 'position'.
Definition: list.h:334
const node_t & get_tail() const
Get the tail node.
Definition: list.h:326
const_iterator cend() const
Gets the end of the list.
Definition: list.h:706
const_reverse_iterator crbegin() const
Gets the reverse beginning of the list.
Definition: list.h:746
~list_base()
Destructor.
Definition: list.h:392
void remove_if(TPredicate predicate)
Removes according to a predicate.
Definition: list.h:1317
void assign(TIterator first, TIterator last, typename etl::enable_if<!etl::is_integral< TIterator >::value, int >::type=0)
Definition: list.h:797
node_t & get_tail()
Get the tail node.
Definition: list.h:318
iterator erase(const_iterator position)
Erases the value at the specified position.
Definition: list.h:1216
bool has_shared_pool() const
true if the list has a shared pool.
Definition: list.h:189
void pop_back()
Removes a value from the back of the list.
Definition: list.h:1071
reference emplace_front(const T1 &value1, const T2 &value2)
Emplaces a value to the front of the list.
Definition: list.h:901
size_t size() const
Returns the number of allocated items in the pool.
Definition: ipool.h:293
void release_all()
Release all objects in the pool.
Definition: ipool.h:248
bool full() const
Definition: ipool.h:311
size_t max_size() const
Returns the maximum number of items in the pool.
Definition: ipool.h:269
void release(const void *const p_object)
Definition: ipool.h:239
size_t available() const
Returns the number of free items in the pool.
Definition: ipool.h:285
enable_if
Definition: type_traits_generator.h:1191
is_integral
Definition: type_traits_generator.h:1001
bitset_ext
Definition: absolute.h:38
bool operator>(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:684
etl::byte operator&(etl::byte lhs, etl::byte rhs)
And.
Definition: byte.h:273
bool operator>=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:696
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:645
bool operator==(const etl::ilist< T > &lhs, const etl::ilist< T > &rhs)
Definition: list.h:2372
void swap(etl::array< T, SIZE > &lhs, etl::array< T, SIZE > &rhs)
Template deduction guides.
Definition: array.h:621
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:633
bool operator!=(const etl::ilist< T > &lhs, const etl::ilist< T > &rhs)
Definition: list.h:2384
bool operator<(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:657
bool operator<=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:672
Definition: functional.h:238
The data node element in the list.
Definition: list.h:430
Definition: type_traits_generator.h:2055
iterator
Definition: iterator.h:399
Definition: functional.h:134
The node element in the list.
Definition: list.h:162
void reverse()
Reverses the previous & next pointers.
Definition: list.h:175
node_t()
Constructor.
Definition: list.h:166
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