31 #ifndef ETL_LIST_INCLUDED
32 #define ETL_LIST_INCLUDED
50 #include "static_assert.h"
53 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && ETL_USING_STL
54 #include <initializer_list>
78 list_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
79 :
exception(reason_, file_name_, line_number_)
92 list_full(string_type file_name_, numeric_type line_number_)
93 :
list_exception(ETL_ERROR_TEXT(
"list:full", ETL_FILE
"A"), file_name_, line_number_)
106 list_empty(string_type file_name_, numeric_type line_number_)
107 :
list_exception(ETL_ERROR_TEXT(
"list:empty", ETL_FILE
"B"), file_name_, line_number_)
120 list_iterator(string_type file_name_, numeric_type line_number_)
121 :
list_exception(ETL_ERROR_TEXT(
"list:iterator", ETL_FILE
"C"), file_name_, line_number_)
134 list_unsorted(string_type file_name_, numeric_type line_number_)
135 :
list_exception(ETL_ERROR_TEXT(
"list:unsorted", ETL_FILE
"D"), file_name_, line_number_)
148 list_no_pool(string_type file_name_, numeric_type line_number_)
149 :
list_exception(ETL_ERROR_TEXT(
"list:no pool", ETL_FILE
"E"), file_name_, line_number_)
173 : previous(ETL_NULLPTR),
185 swap(previous, next);
214 node_t* p_temp = p_node->previous;
215 p_node->previous = p_node->next;
216 p_node->next = p_temp;
217 p_node = p_node->previous;
221 node_t* p_temp = p_node->previous;
222 p_node->previous = p_node->next;
223 p_node->next = p_temp;
257 p_node = p_node->next;
343 join(*position.previous, node);
344 join(node, position);
353 right.previous = &left;
406 ETL_DECLARE_DEBUG_COUNT
413 template <
typename T>
418 typedef T value_type;
420 typedef const T* const_pointer;
421 typedef T& reference;
422 typedef const T& const_reference;
423 #if ETL_CPP11_SUPPORTED
424 typedef T&& rvalue_reference;
458 static data_node_t& data_cast(node_t& node)
460 return reinterpret_cast<data_node_t&
>(node);
466 static const data_node_t* data_cast(
const node_t* p_node)
468 return reinterpret_cast<const data_node_t*
>(p_node);
474 static const data_node_t& data_cast(
const node_t& node)
476 return reinterpret_cast<const data_node_t&
>(node);
492 : p_node(ETL_NULLPTR)
502 : p_node(other.p_node)
508 p_node = p_node->next;
515 p_node = p_node->next;
521 p_node = p_node->previous;
528 p_node = p_node->previous;
534 p_node = other.p_node;
538 reference operator *()
540 return ilist::data_cast(p_node)->value;
543 const_reference operator *()
const
545 return ilist::data_cast(p_node)->value;
550 return &(ilist::data_cast(p_node)->value);
555 return &(ilist::data_cast(p_node)->value);
558 pointer operator ->()
560 return &(ilist::data_cast(p_node)->value);
563 const_pointer operator ->()
const
565 return &(ilist::data_cast(p_node)->value);
570 return lhs.p_node == rhs.p_node;
575 return !(lhs == rhs);
593 : p_node(ETL_NULLPTR)
608 : p_node(other.p_node)
613 : p_node(other.p_node)
619 p_node = p_node->next;
626 p_node = p_node->next;
632 p_node = p_node->previous;
639 p_node = p_node->previous;
645 p_node = other.p_node;
649 const_reference operator *()
const
651 return ilist::data_cast(p_node)->value;
656 return &(ilist::data_cast(p_node)->value);
659 const_pointer operator ->()
const
661 return &(ilist::data_cast(p_node)->value);
666 return lhs.p_node == rhs.p_node;
671 return !(lhs == rhs);
679 typedef typename etl::iterator_traits<iterator>::difference_type difference_type;
681 typedef ETL_OR_STD::reverse_iterator<iterator> reverse_iterator;
682 typedef ETL_OR_STD::reverse_iterator<const_iterator> const_reverse_iterator;
753 return reverse_iterator(
get_head());
759 const_reverse_iterator
rend()
const
761 return const_reverse_iterator(
get_head());
775 const_reverse_iterator
crend()
const
777 return const_reverse_iterator(
get_head());
817 template <
typename TIterator>
818 void assign(TIterator first, TIterator last)
820 #if defined(ETL_DEBUG)
821 difference_type d = etl::distance(first, last);
828 while (first != last)
842 #if defined(ETL_DEBUG)
862 #if defined(ETL_CHECK_PUSH_POP)
868 #if ETL_CPP11_SUPPORTED
874 #if defined(ETL_CHECK_PUSH_POP)
881 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT
885 template <
typename ... Args>
888 #if defined(ETL_CHECK_PUSH_POP)
893 data_node_t* p_data_node = create_data_node();
894 ::new (&(p_data_node->value)) T(
etl::forward<Args>(args)...);
895 ETL_INCREMENT_DEBUG_COUNT
902 template <
typename T1>
905 #if defined(ETL_CHECK_PUSH_POP)
911 ::new (&(p_data_node->value)) T(value1);
912 ETL_INCREMENT_DEBUG_COUNT
919 template <
typename T1,
typename T2>
922 #if defined(ETL_CHECK_PUSH_POP)
928 ::new (&(p_data_node->value)) T(value1, value2);
929 ETL_INCREMENT_DEBUG_COUNT
936 template <
typename T1,
typename T2,
typename T3>
939 #if defined(ETL_CHECK_PUSH_POP)
945 ::new (&(p_data_node->value)) T(value1, value2, value3);
946 ETL_INCREMENT_DEBUG_COUNT
953 template <
typename T1,
typename T2,
typename T3,
typename T4>
954 void emplace_front(
const T1& value1,
const T2& value2,
const T3& value3,
const T4& value4)
956 #if defined(ETL_CHECK_PUSH_POP)
962 ::new (&(p_data_node->value)) T(value1, value2, value3, value4);
963 ETL_INCREMENT_DEBUG_COUNT
973 #if defined(ETL_CHECK_PUSH_POP)
985 #if defined(ETL_CHECK_PUSH_POP)
991 #if ETL_CPP11_SUPPORTED
997 #if defined(ETL_CHECK_PUSH_POP)
1007 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT
1008 template <
typename ... Args>
1011 #if defined(ETL_CHECK_PUSH_POP)
1016 data_node_t* p_data_node = create_data_node();
1017 ::new (&(p_data_node->value)) T(
etl::forward<Args>(args)...);
1018 ETL_INCREMENT_DEBUG_COUNT
1022 template <
typename T1>
1025 #if defined(ETL_CHECK_PUSH_POP)
1031 ::new (&(p_data_node->value)) T(value1);
1032 ETL_INCREMENT_DEBUG_COUNT
1036 template <
typename T1,
typename T2>
1039 #if defined(ETL_CHECK_PUSH_POP)
1044 data_node_t* p_data_node = create_data_node();
1045 ::new (&(p_data_node->value)) T(value1, value2);
1046 ETL_INCREMENT_DEBUG_COUNT
1050 template <typename T1, typename T2, typename T3>
1051 void emplace_back(const T1& value1, const T2& value2, const T3& value3)
1053 #if defined(ETL_CHECK_PUSH_POP)
1058 data_node_t* p_data_node = create_data_node();
1059 ::new (&(p_data_node->value)) T(value1, value2, value3);
1060 ETL_INCREMENT_DEBUG_COUNT
1064 template <typename T1, typename T2, typename T3, typename T4>
1065 void emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4)
1067 #if defined(ETL_CHECK_PUSH_POP)
1072 data_node_t* p_data_node = create_data_node();
1073 ::new (&(p_data_node->value)) T(value1, value2, value3, value4);
1074 ETL_INCREMENT_DEBUG_COUNT
1084 #if defined(ETL_CHECK_PUSH_POP)
1098 data_node_t& data_node = allocate_data_node(value);
1104 #if ETL_CPP11_SUPPORTED
1112 data_node_t& data_node = allocate_data_node(etl::move(value));
1122 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT
1123 template <
typename ... Args>
1124 iterator
emplace(iterator position, Args && ... args)
1129 data_node_t* p_data_node = create_data_node();
1130 ::new (&(p_data_node->value)) T(
etl::forward<Args>(args)...);
1131 ETL_INCREMENT_DEBUG_COUNT
1134 return iterator(*p_data_node);
1137 template <
typename T1>
1144 ::new (&(p_data_node->value)) T(value1);
1145 ETL_INCREMENT_DEBUG_COUNT
1151 template <
typename T1,
typename T2>
1157 data_node_t* p_data_node = create_data_node();
1158 ::new (&(p_data_node->value)) T(value1, value2);
1159 ETL_INCREMENT_DEBUG_COUNT
1165 template <typename T1, typename T2, typename T3>
1171 data_node_t* p_data_node = create_data_node();
1172 ::new (&(p_data_node->value)) T(value1, value2, value3);
1173 ETL_INCREMENT_DEBUG_COUNT
1179 template <typename T1, typename T2, typename T3, typename T4>
1185 data_node_t* p_data_node = create_data_node();
1186 ::new (&(p_data_node->value)) T(value1, value2, value3, value4);
1187 ETL_INCREMENT_DEBUG_COUNT
1199 for (
size_t i = 0; i < n; ++i)
1204 insert_node(*position.p_node, allocate_data_node(value));
1211 template <
typename TIterator>
1214 while (first != last)
1219 insert_node(*position.p_node, allocate_data_node(*first++));
1229 remove_node(*position.p_node->previous);
1238 node_t* p_first = first.p_node;
1239 node_t* p_last = last.p_node;
1243 join(*(p_first->previous), *p_last);
1246 while (p_first != p_last)
1248 p_next = p_first->next;
1249 destroy_data_node(
static_cast<data_node_t&
>(*p_first));
1277 else if (n <
size())
1280 etl::advance(i_start, -difference_type(
size() - n));
1284 else if (n >
size())
1301 void remove(const_reference value)
1305 while (iValue !=
end())
1307 if (value == *iValue)
1309 iValue =
erase(iValue);
1321 template <
typename TPredicate>
1326 while (iValue !=
end())
1328 if (predicate(*iValue))
1330 iValue =
erase(iValue);
1352 template <
typename TIsEqual>
1364 while (i_item !=
end())
1366 if (isEqual(*i_previous, *i_item))
1368 i_item =
erase(i_item);
1372 i_previous = i_item;
1390 #if ETL_CPP11_SUPPORTED
1399 while (itr != other.end())
1401 to =
insert(to, etl::move(*itr++));
1404 other.erase(other.begin(), other.end());
1427 #if ETL_CPP11_SUPPORTED
1441 insert(to, etl::move(*from));
1455 move(to, first, last);
1461 other.
erase(first, last);
1465 #if ETL_CPP11_SUPPORTED
1474 move(to, first, last);
1479 ilist::iterator itr = first;
1482 to =
insert(to, etl::move(*itr++));
1486 other.erase(first, last);
1502 template <
typename TCompare>
1505 if ((
this != &other) && !other.
empty())
1507 #if defined(ETL_DEBUG)
1518 while ((this_begin != this_end) && (other_begin != other_end))
1521 while ((this_begin != this_end) && !(
compare(*other_begin, *this_begin)))
1527 if (this_begin != this_end)
1529 while ((other_begin != other_end) && (
compare(*other_begin, *this_begin)))
1531 insert(this_begin, *other_begin);
1538 if ((this_begin == this_end) && (other_begin != other_end))
1540 insert(this_end, other_begin, other_end);
1547 #if ETL_CPP11_SUPPORTED
1559 template <
typename TCompare>
1564 #if defined(ETL_DEBUG)
1569 ilist::iterator other_begin = other.begin();
1570 ilist::iterator other_end = other.end();
1572 ilist::iterator this_begin =
begin();
1573 ilist::iterator this_end =
end();
1575 while ((this_begin != this_end) && (other_begin != other_end))
1578 while ((this_begin != this_end) && !(compare(*other_begin, *this_begin)))
1584 if (this_begin != this_end)
1586 while ((other_begin != other_end) && (compare(*other_begin, *this_begin)))
1588 insert(this_begin, etl::move(*other_begin));
1595 if ((this_begin == this_end) && (other_begin != other_end))
1597 while (other_begin != other_end)
1599 insert(this_end, etl::move(*other_begin++));
1642 template <
typename TCompare>
1651 int number_of_merges;
1666 number_of_merges = 0;
1668 while (i_left !=
end())
1675 for (
int i = 0; i < list_size; ++i)
1680 if (i_right ==
end())
1687 right_size = list_size;
1690 while (left_size > 0 || (right_size > 0 && i_right !=
end()))
1699 else if (right_size == 0 || i_right ==
end())
1705 else if (!
compare(*i_right, *i_left))
1720 if (i_head ==
end())
1722 join(*i_head.p_node, *i_node.p_node);
1728 join(*i_tail.p_node, *i_node.p_node);
1740 if (number_of_merges <= 1)
1763 #if ETL_CPP11_SUPPORTED
1774 while (itr != rhs.end())
1801 :
list_base(node_pool, max_size_, pool_is_shared_)
1818 ETL_RESET_DEBUG_COUNT;
1825 while (p_first != p_last)
1827 destroy_data_node(
static_cast<data_node_t&
>(*p_first));
1828 p_first = p_first->next;
1837 #if ETL_CPP11_SUPPORTED
1841 void move_container(
ilist&& rhs)
1852 node_t* p_rhs_node = &rhs.get_head();
1859 node_t* p_node = p_rhs_node;
1860 p_rhs_node = p_rhs_node->next;
1863 ETL_INCREMENT_DEBUG_COUNT;
1865 }
while (p_rhs_node != &rhs.terminal_node);
1867 ETL_OBJECT_RESET_DEBUG_COUNT(rhs);
1868 rhs.join(rhs.terminal_node, rhs.terminal_node);
1876 while (first != last)
1896 void move(iterator to, iterator from)
1903 node_t& from_node = *from.p_node;
1904 node_t& to_node = *to.p_node;
1907 join(*from_node.previous, *from_node.next);
1910 join(*to_node.previous, from_node);
1911 join(from_node, to_node);
1918 void move(iterator to, iterator first, iterator last)
1920 if ((first == to) || (last == to))
1925 #if defined(ETL_DEBUG)
1927 for (const_iterator item = first; item != last; ++item)
1929 ETL_ASSERT(item != to, ETL_ERROR(list_iterator));
1933 node_t& first_node = *first.p_node;
1934 node_t& last_node = *last.p_node;
1935 node_t& to_node = *to.p_node;
1936 node_t& final_node = *last_node.previous;
1939 join(*first_node.previous, last_node);
1942 join(*to_node.previous, first_node);
1943 join(final_node, to_node);
1949 void remove_node(node_t& node)
1952 join(*node.previous, *node.next);
1955 destroy_data_node(
static_cast<data_node_t&
>(node));
1961 data_node_t& allocate_data_node(const_reference value)
1965 data_node_t* p_data_node = create_data_node();
1966 ::new (&(p_data_node->value)) T(value);
1967 ETL_INCREMENT_DEBUG_COUNT
1969 return *p_data_node;
1972 #if ETL_CPP11_SUPPORTED
1976 data_node_t& allocate_data_node(rvalue_reference value)
1980 data_node_t* p_data_node = create_data_node();
1981 ::new (&(p_data_node->value)) T(
etl::move(value));
1982 ETL_INCREMENT_DEBUG_COUNT
1984 return *p_data_node;
1991 data_node_t* create_data_node()
1993 data_node_t* (
etl::ipool::*func)() = &etl::ipool::allocate<data_node_t>;
2000 void destroy_data_node(data_node_t& node)
2005 ETL_DECREMENT_DEBUG_COUNT
2011 #if defined(ETL_POLYMORPHIC_LIST) || defined(ETL_POLYMORPHIC_CONTAINERS)
2027 template <
typename T, const
size_t MAX_SIZE_>
2032 ETL_STATIC_ASSERT((MAX_SIZE_ > 0U),
"Zero capacity etl::list is not valid");
2034 static const size_t MAX_SIZE = MAX_SIZE_;
2038 typedef T value_type;
2040 typedef const T* const_pointer;
2041 typedef T& reference;
2042 typedef const T& const_reference;
2043 #if ETL_CPP11_SUPPORTED
2044 typedef T&& rvalue_reference;
2070 this->
assign(initial_size, T());
2076 list(
size_t initial_size,
const T& value)
2079 this->
assign(initial_size, value);
2094 #if ETL_CPP11_SUPPORTED
2106 while (itr != other.end())
2120 template <
typename TIterator>
2121 list(TIterator first, TIterator last)
2124 this->
assign(first, last);
2127 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && ETL_USING_STL
2131 list(std::initializer_list<T> init)
2134 this->
assign(init.begin(), init.end());
2151 #if ETL_CPP11_SUPPORTED
2157 this->move_container(etl::move(rhs));
2172 #if ETL_CPP17_SUPPORTED && ETL_NOT_USING_STLPORT && ETL_USING_STL
2173 template <
typename T,
typename... Ts>
2175 ->list<etl::enable_if_t<(etl::is_same_v<T, Ts> && ...), T>, 1U +
sizeof...(Ts)>;
2181 template <
typename T>
2186 typedef T value_type;
2188 typedef const T* const_pointer;
2189 typedef T& reference;
2190 typedef const T& const_reference;
2225 this->
assign(initial_size, T());
2234 this->
assign(initial_size, value);
2261 #if ETL_CPP11_SUPPORTED
2268 this->move_container(etl::move(other));
2274 list_ext(list_ext&& other,
etl::ipool& node_pool)
2277 this->move_container(etl::move(other));
2284 template <
typename TIterator>
2288 this->
assign(first, last);
2291 #if ETL_CPP11_SUPPORTED && ETL_NOT_USING_STLPORT && ETL_USING_STL
2298 this->
assign(init.begin(), init.end());
2315 #if ETL_CPP11_SUPPORTED
2321 this->move_container(etl::move(rhs));
2356 template <
typename T>
2368 template <
typename T>
2371 return !(lhs == rhs);
2381 template <
typename T>
2384 return etl::lexicographical_compare(lhs.
begin(), lhs.
end(), rhs.
begin(), rhs.
end());
2394 template <
typename T>
2407 template <
typename T>
2410 return !(lhs > rhs);
2420 template <
typename T>
2423 return !(lhs < rhs);
const_iterator
Definition: list.h:587
iterator.
Definition: list.h:485
Template deduction guides.
Definition: list.h:2183
list_ext(const list_ext &other, etl::ipool &node_pool)
Copy constructor. Explicit pool.
Definition: list.h:2252
list_ext(size_t initial_size, etl::ipool &node_pool)
Construct from size.
Definition: list.h:2222
list_ext(TIterator first, TIterator last, etl::ipool &node_pool)
Construct from range.
Definition: list.h:2285
void set_pool(etl::ipool &pool)
Set the pool instance.
Definition: list.h:2330
list_ext(size_t initial_size, const T &value, etl::ipool &node_pool)
Construct from size and value.
Definition: list.h:2231
list_ext()
Default constructor.
Definition: list.h:2198
etl::ipool & get_pool() const
Get the pool instance.
Definition: list.h:2344
list_ext(etl::ipool &node_pool)
Default constructor.
Definition: list.h:2206
~list_ext()
Destructor.
Definition: list.h:2214
list_ext(const list_ext &other)
Copy constructor. Implicit pool.
Definition: list.h:2240
A templated list implementation that uses a fixed size buffer.
Definition: list.h:2029
~list()
Destructor.
Definition: list.h:2059
list(const list &other)
Copy constructor.
Definition: list.h:2085
list(TIterator first, TIterator last)
Construct from range.
Definition: list.h:2121
list(size_t initial_size, const T &value)
Construct from size and value.
Definition: list.h:2076
list(size_t initial_size)
Construct from size.
Definition: list.h:2067
list()
Default constructor.
Definition: list.h:2051
ETL_NODISCARD bool is_sorted(TIterator begin, TIterator end)
Definition: algorithm.h:1923
bitset< MAXN > operator&(const bitset< MAXN > &lhs, const bitset< MAXN > &rhs)
Definition: bitset.h:1157
#define ETL_ASSERT(b, e)
Definition: error_handler.h:290
exception(string_type reason_, string_type file_, numeric_type line_)
Constructor.
Definition: exception.h:67
Definition: exception.h:47
ilist(etl::ipool &node_pool, size_t max_size_, bool pool_is_shared_)
Constructor.
Definition: list.h:1800
const_reverse_iterator rend() const
Gets the reverse end of the list.
Definition: list.h:759
void clear()
Clears the list.
Definition: list.h:1293
const_iterator cbegin() const
Gets the beginning of the list.
Definition: list.h:719
iterator end()
Gets the end of the list.
Definition: list.h:703
void push_back(const T &value)
Pushes a value to the back of the list.
Definition: list.h:983
void emplace_front(const T1 &value1, const T2 &value2)
Emplaces a value to the front of the list.
Definition: list.h:920
ilist(bool pool_is_shared_)
Constructor.
Definition: list.h:1792
reference back()
Gets a reference to the last element.
Definition: list.h:799
size_t size_type
The type used for determining the size of list.
Definition: list.h:162
void reverse()
Reverses the list.
Definition: list.h:203
const_reverse_iterator crend() const
Gets the reverse end of the list.
Definition: list.h:775
void insert(iterator position, size_t n, const_reference value)
Inserts 'n' copies of a value to the list at the specified position.
Definition: list.h:1197
iterator emplace(iterator position, const T1 &value1)
Emplaces a value to the list at the specified position.
Definition: list.h:1138
void splice(iterator to, ilist &other, iterator from)
Splices an element from another list to this.
Definition: list.h:1412
size_type size() const
Gets the size of the list.
Definition: list.h:245
void sort(TCompare compare)
Definition: list.h:1643
size_type available() const
Definition: list.h:289
void splice(iterator to, ilist &other, iterator first, iterator last)
Splices a range of elements from another list to this.
Definition: list.h:1450
void join(node_t &left, node_t &right)
Join two nodes.
Definition: list.h:350
void unique(TIsEqual isEqual)
Definition: list.h:1353
void assign(TIterator first, TIterator last)
Definition: list.h:818
const_reverse_iterator rbegin() const
Gets the reverse beginning of the list.
Definition: list.h:743
list_base(bool pool_is_shared_)
The constructor that is called from derived classes.
Definition: list.h:359
etl::ipool * p_node_pool
The pool of data nodes used in the list.
Definition: list.h:402
size_type max_size() const
Gets the maximum possible size of the list.
Definition: list.h:229
const node_t & get_head() const
Get the head node.
Definition: list.h:316
void resize(size_t n)
Resizes the list.
Definition: list.h:1259
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:370
bool full() const
Checks to see if the list is full.
Definition: list.h:279
reverse_iterator rend()
Gets the reverse end of the list.
Definition: list.h:751
reverse_iterator rbegin()
Gets the reverse beginning of the list.
Definition: list.h:735
iterator insert(iterator position, const_reference value)
Inserts a value to the list at the specified position.
Definition: list.h:1094
size_type MAX_SIZE
The maximum size of the list.
Definition: list.h:404
node_t terminal_node
The node that acts as the list start and end.
Definition: list.h:403
void push_front(const T &value)
Pushes a value to the front of the list.
Definition: list.h:860
void initialise()
Initialise the list.
Definition: list.h:1808
bool pool_is_shared
If true then the pool is shared between lists.
Definition: list.h:405
void emplace_back(const T1 &value1)
Emplaces a value to the back of the list.
Definition: list.h:1023
void 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:954
node_t & get_head()
Get the head node.
Definition: list.h:308
void splice(iterator to, ilist &other)
Splices from another list to this.
Definition: list.h:1381
const_iterator end() const
Gets the end of the list.
Definition: list.h:711
void emplace_front(const T1 &value1, const T2 &value2, const T3 &value3)
Emplaces a value to the front of the list.
Definition: list.h:937
etl::ipool * get_node_pool()
Get the node pool instance.
Definition: list.h:390
reference front()
Gets a reference to the first element.
Definition: list.h:783
void pop_front()
Removes a value from the front of the list.
Definition: list.h:971
const_iterator begin() const
Gets the beginning of the list.
Definition: list.h:695
void merge(ilist &other)
Merge another list into this one. Both lists should be sorted.
Definition: list.h:1494
bool is_trivial_list() const
Is the list a trivial length?
Definition: list.h:300
node_t & get_tail()
Get the tail node.
Definition: list.h:324
void assign(size_t n, const T &value)
Assigns 'n' copies of a value to the list.
Definition: list.h:840
void set_node_pool(etl::ipool &node_pool_)
Set the node pool instance.
Definition: list.h:381
iterator erase(iterator position)
Erases the value at the specified position.
Definition: list.h:1226
void emplace_front(const T1 &value1)
Emplaces a value to the front of the list.
Definition: list.h:903
void merge(ilist &other, TCompare compare)
Merge another list into this one. Both lists should be sorted.
Definition: list.h:1503
void resize(size_t n, const_reference value)
Resizes the list.
Definition: list.h:1267
size_type capacity() const
Gets the maximum possible size of the list.
Definition: list.h:237
ilist & operator=(const ilist &rhs)
Assignment operator.
Definition: list.h:1753
bool empty() const
Checks to see if the list is empty.
Definition: list.h:271
iterator begin()
Gets the beginning of the list.
Definition: list.h:687
iterator erase(iterator first, iterator last)
Erases a range of elements.
Definition: list.h:1236
void sort()
Definition: list.h:1612
const_reference back() const
Gets a reference to the last element.
Definition: list.h:807
void unique()
Definition: list.h:1343
const_reference front() const
Gets a const reference to the first element.
Definition: list.h:791
void insert(iterator position, TIterator first, TIterator last)
Inserts a range of values to the list at the specified position.
Definition: list.h:1212
void insert_node(node_t &position, node_t &node)
Insert a node before 'position'.
Definition: list.h:340
const_iterator cend() const
Gets the end of the list.
Definition: list.h:727
const_reverse_iterator crbegin() const
Gets the reverse beginning of the list.
Definition: list.h:767
const node_t & get_tail() const
Get the tail node.
Definition: list.h:332
~list_base()
Destructor.
Definition: list.h:398
void remove_if(TPredicate predicate)
Removes according to a predicate.
Definition: list.h:1322
bool has_shared_pool() const
true if the list has a shared pool.
Definition: list.h:195
void pop_back()
Removes a value from the back of the list.
Definition: list.h:1082
size_t size() const
Returns the number of allocated items in the pool.
Definition: pool.h:309
void release_all()
Release all objects in the pool.
Definition: pool.h:264
bool full() const
Definition: pool.h:327
size_t max_size() const
Returns the maximum number of items in the pool.
Definition: pool.h:285
void release(const void *const p_object)
Definition: pool.h:255
size_t available() const
Returns the number of free items in the pool.
Definition: pool.h:301
is_trivially_destructible
Definition: type_traits_generator.h:1171
Definition: absolute.h:37
bool operator>(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:633
bool operator>=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:645
bool operator!=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:594
bool operator==(const etl::ilist< T > &lhs, const etl::ilist< T > &rhs)
Definition: list.h:2357
void swap(etl::array< T, SIZE > &lhs, etl::array< T, SIZE > &rhs)
Template deduction guides.
Definition: array.h:570
bool operator==(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:582
bool operator!=(const etl::ilist< T > &lhs, const etl::ilist< T > &rhs)
Definition: list.h:2369
bool operator<(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:606
bool operator<=(const etl::array< T, SIZE > &lhs, const etl::array< T, SIZE > &rhs)
Definition: array.h:621
Definition: functional.h:136
The data node element in the list.
Definition: list.h:436
iterator
Definition: iterator.h:422
Definition: functional.h:112
The node element in the list.
Definition: list.h:168
void reverse()
Reverses the previous & next pointers.
Definition: list.h:181
node_t()
Constructor.
Definition: list.h:172
etl::conditional< etl::is_fundamental< T >::value||etl::is_pointer< T >::value, T, const T & >::type type
By default fundamental and pointer types are passed by value.
Definition: parameter_type.h:48