C++ wrapper for the native Eina inline list. More...
Public Types | |
typedef _base_type::allocator_type | allocator_type |
Type for the allocator. More... | |
typedef allocator_type::value_type | value_type |
The type of each element. More... | |
typedef allocator_type::reference | reference |
Type for a reference to an element. More... | |
typedef allocator_type::const_reference | const_reference |
Type for a constant reference to an element. More... | |
typedef _inlist_iterator< T const > | const_iterator |
Type for constant iterator for this kind of container. More... | |
typedef _inlist_iterator< T > | iterator |
Type for iterator for this kind of container. More... | |
typedef allocator_type::pointer | pointer |
Type for a pointer to an element. More... | |
typedef allocator_type::const_pointer | const_pointer |
Type for a constant pointer for an element. More... | |
typedef std::size_t | size_type |
Type for size information. More... | |
typedef std::ptrdiff_t | difference_type |
Type to represent the distance between two iterators. More... | |
typedef _base_type::native_handle_type | native_handle_type |
The native handle type. More... | |
typedef std::reverse_iterator< iterator > | reverse_iterator |
Type for reverse iterator for this kind of container. More... | |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
Type for constant reverse iterator for this kind of container. More... | |
Public Member Functions | |
inlist () | |
Default constructor. More... | |
inlist (native_handle_type list) | |
Construct an inlist from a native object. More... | |
inlist (size_type n, value_type const &t) | |
Construct an inline list object with n copies of t . More... | |
template<typename InputIterator > | |
inlist (InputIterator i, InputIterator const &j, allocator_type const &alloc=allocator_type(), typename eina::enable_if<!eina::is_integral< InputIterator >::value >::type *=0) | |
Create a inline list coping the elements from the given range. More... | |
inlist (inlist< T, Allocator >const &other) | |
Copy constructor. More... | |
inlist< T, Allocator > & | operator= (inlist< T, Allocator >const &other) |
Replace current content with the content of another inline list. More... | |
size_type | size () const |
Get the current size of the inline list. More... | |
bool | empty () const |
Check if the inline list is empty. More... | |
allocator_type | get_allocator () const |
Get the allocator used in this inline list. | |
void | push_back (T const &value) |
Add a copy of the given element at the end of the inline list. More... | |
void | push_front (T const &value) |
Add a copy of the given element at the beginning of the inline list. More... | |
void | pop_back () |
Remove the last element of the inline list. | |
void | pop_front () |
Remove the first element of the inline list. | |
iterator | insert (iterator i, value_type const &t) |
Insert a new element at the given position. More... | |
iterator | insert (iterator i, size_t n, value_type const &t) |
Insert n copies of t at the given position. More... | |
template<typename InputIterator > | |
iterator | insert (iterator p, InputIterator i, InputIterator j, typename eina::enable_if<!eina::is_integral< InputIterator >::value >::type *=0) |
Insert the elements between the given range at the given position. More... | |
iterator | erase (iterator q) |
Remove the element at the given position. More... | |
iterator | erase (iterator i, iterator j) |
Remove the elements between the given range. More... | |
template<typename InputIterator > | |
void | assign (InputIterator i, InputIterator j, typename eina::enable_if<!eina::is_integral< InputIterator >::value >::type *=0) |
Replace the content of the inline list by the elements in the given range. More... | |
void | assign (size_type n, value_type const &t) |
Replace the content of the inline list by n copies t . More... | |
value_type & | back () |
Get a reference to the last element. More... | |
value_type const & | back () const |
Get a constant reference to the last element. More... | |
value_type & | front () |
Get a reference to the first element. More... | |
value_type const & | front () const |
Get a constant reference to the first element. More... | |
const_iterator | begin () const |
Get a constant iterator pointing to the first element of the inline list. More... | |
const_iterator | end () const |
Get a constant iterator to the position following the last element of the inline list. More... | |
iterator | begin () |
Get an iterator pointing to the first element of the inline list. More... | |
iterator | end () |
Get an iterator to the position following the last element of the inline list. More... | |
const_reverse_iterator | rbegin () const |
Get a constant reverse iterator pointing to the reverse begin of the inline list. More... | |
const_reverse_iterator | rend () const |
Get a constant reverse iterator pointing to the reverse end of the inline list. More... | |
reverse_iterator | rbegin () |
Get a reverse iterator pointing to the reverse begin of the inline list. More... | |
reverse_iterator | rend () |
Get a reverse iterator pointing to the reverse end of the inline list. More... | |
const_iterator | cbegin () const |
Get a constant iterator pointing to the first element of the inline list. More... | |
const_iterator | cend () const |
Get a constant iterator to the position following the last element of the inline list. More... | |
const_reverse_iterator | crbegin () const |
Get a constant reverse iterator pointing to the reverse begin of the inline list. More... | |
const_reverse_iterator | crend () const |
Get a constant reverse iterator pointing to the reverse end of the inline list. More... | |
void | swap (inlist< T, Allocator > &other) |
Swap content between two inline lists. More... | |
size_type | max_size () const |
Get the maximum number of elements a inline list can hold. More... | |
Eina_Inlist * | native_handle () |
Get the handle for the wrapped Eina_Inlist. More... | |
Eina_Inlist const * | native_handle () const |
Get the handle for the wrapped Eina_Inlist. More... | |
eina::accessor< T const > | accessor () const |
Get a constant eina::accessor for the list. More... | |
eina::accessor< T > | accessor () |
Get a eina::accessor for the list. More... | |
void | clear () |
Deallocate all nodes of the list. | |
Additional Inherited Members | |
![]() | |
typedef Allocator::template rebind< _inlist_node< T > >::other | node_allocator_type |
Type for the allocator of the node. More... | |
typedef Allocator | allocator_type |
Type for the allocator. More... | |
typedef _inlist_node< T > | node_type |
Type for the list node. More... | |
typedef Eina_Inlist * | native_handle_type |
Native type. More... | |
![]() | |
_inlist_common_base (Allocator allocator) | |
Creates a list with the given allocator. More... | |
_inlist_common_base (native_handle_type inlist) | |
Wraps the native object. More... | |
_inlist_common_base () | |
Creates an empty inline list. | |
~_inlist_common_base () | |
Destructor. More... | |
void | clear () |
Deallocate all nodes of the list. | |
node_allocator_type & | get_node_allocator () |
Get the allocator used by the list. | |
![]() | |
_inlist_impl | _impl |
C++ wrapper for the native Eina inline list.
It provides an OOP interface to the Eina_Inlist
functions, and automatically take care of allocating and deallocating resources using the RAII programming idiom.
It also provides additional member functions to facilitate the access to the list content, much like a STL list.
typedef _base_type::allocator_type efl::eina::inlist< T, Allocator >::allocator_type |
Type for the allocator.
typedef allocator_type::value_type efl::eina::inlist< T, Allocator >::value_type |
The type of each element.
typedef allocator_type::reference efl::eina::inlist< T, Allocator >::reference |
Type for a reference to an element.
typedef allocator_type::const_reference efl::eina::inlist< T, Allocator >::const_reference |
Type for a constant reference to an element.
typedef _inlist_iterator<T const> efl::eina::inlist< T, Allocator >::const_iterator |
Type for constant iterator for this kind of container.
typedef _inlist_iterator<T> efl::eina::inlist< T, Allocator >::iterator |
Type for iterator for this kind of container.
typedef allocator_type::pointer efl::eina::inlist< T, Allocator >::pointer |
Type for a pointer to an element.
typedef allocator_type::const_pointer efl::eina::inlist< T, Allocator >::const_pointer |
Type for a constant pointer for an element.
typedef std::size_t efl::eina::inlist< T, Allocator >::size_type |
Type for size information.
typedef std::ptrdiff_t efl::eina::inlist< T, Allocator >::difference_type |
Type to represent the distance between two iterators.
typedef _base_type::native_handle_type efl::eina::inlist< T, Allocator >::native_handle_type |
The native handle type.
typedef std::reverse_iterator<iterator> efl::eina::inlist< T, Allocator >::reverse_iterator |
Type for reverse iterator for this kind of container.
typedef std::reverse_iterator<const_iterator> efl::eina::inlist< T, Allocator >::const_reverse_iterator |
Type for constant reverse iterator for this kind of container.
|
inline |
Default constructor.
Creates an empty inline list.
|
inline |
Construct an inlist from a native object.
list | The native object. |
|
inline |
Construct an inline list object with n
copies of t
.
n | Number of elements. |
t | Value to be copied to each element. |
This constructor creates an inline list with n
elements, each one as a copy of t
.
References efl::eina::inlist< T, Allocator >::push_back().
|
inline |
Create a inline list coping the elements from the given range.
i | Iterator to the initial position. The element pointed by this iterator will be copied. |
j | Iterator to the final position. The element pointed by this iterator will NOT be copied. |
This constructor creates a inline list with copies of the elements between i
and j
in the same order.
j
) is not copied. References efl::eina::inlist< T, Allocator >::push_back().
|
inline |
Copy constructor.
Creates a copy of the given inline list.
other | Another inline list of the same type. |
This constructor creates an inline list containing a copy of each element inside other
in the same order.
References efl::eina::inlist< T, Allocator >::begin(), efl::eina::inlist< T, Allocator >::end(), and efl::eina::inlist< T, Allocator >::insert().
|
inline |
Replace current content with the content of another inline list.
other | Another inline list of the same type. |
This assignment operator replaces the content of the list by a copy of the content of other
. The list size is adjusted accordingly and the newly copied elements keep their original order.
References efl::eina::inlist< T, Allocator >::begin(), efl::eina::_inlist_common_base< T, Allocator >::clear(), efl::eina::inlist< T, Allocator >::end(), and efl::eina::inlist< T, Allocator >::insert().
|
inline |
Get the current size of the inline list.
This member function returns the current number of elements inside the inline list.
References efl::eina::inlist< T, Allocator >::native_handle().
Referenced by efl::eina::operator==().
|
inline |
Check if the inline list is empty.
true
if the inline list is empty, false
otherwise.This member function returns true
if the inline list does not contain any elements, otherwise it returns false
.
References efl::eina::inlist< T, Allocator >::native_handle().
|
inline |
Add a copy of the given element at the end of the inline list.
value | Element to be added at the end of the inline list. |
This member function allocates a new element at the end of the inline list, the content of value
is copied to the new element.
References eina_inlist_append(), and efl::eina::_inlist_common_base< T, Allocator >::get_node_allocator().
Referenced by efl::eina::inlist< T, Allocator >::inlist().
|
inline |
Add a copy of the given element at the beginning of the inline list.
value | Element to be added at the beginning of the inline list. |
This member function allocates a new element at the beginning of the inline list, the content of value
is copied to the new element.
References eina_inlist_prepend(), and efl::eina::_inlist_common_base< T, Allocator >::get_node_allocator().
|
inline |
Insert a new element at the given position.
i | Iterator pointing to the position where the new element will be inserted. |
t | Value to be copied to the new element. |
This member function inserts a copy of the element t
at the position i
. The new element comes right before the element originally pointed by i
.
At the end, a valid iterator pointing to the element just inserted is returned.
References efl::eina::_inlist_common_base< T, Allocator >::get_node_allocator().
Referenced by efl::eina::inlist< T, Allocator >::assign(), efl::eina::inlist< T, Allocator >::inlist(), efl::eina::inlist< T, Allocator >::insert(), and efl::eina::inlist< T, Allocator >::operator=().
|
inline |
Insert n
copies of t
at the given position.
i | Iterator pointing to the position where the new elements will be inserted. |
n | Number of elements to be inserted. |
t | Value to be copied to each new inserted element. |
This member function inserts n
new elements at position i
in the inline list, each one as a copy of t
. The new elements come right before the element originally pointed by i
.
At the end, a valid iterator pointing to the first element inserted is returned.
References efl::eina::inlist< T, Allocator >::insert().
|
inline |
Insert the elements between the given range at the given position.
p | Iterator pointing to the position where the new elements will be inserted. |
i | Iterator to the initial position. The element pointed by this iterator will be copied. |
j | Iterator to the final position. The element pointed by this iterator will NOT be copied. |
This member function inserts a copy of the elements between i
and j
at the position p
. The new elements come right before the element originally pointed by p
. Note that the element pointed by j
is not copied.
References efl::eina::inlist< T, Allocator >::insert().
|
inline |
Remove the element at the given position.
q | Iterator pointing to the element to be removed. |
This member function removes the element pointed by the iterator q
, reducing the list size by one. At the end, a valid iterator pointing to the element right after the removed one is returned.
Referenced by efl::eina::inlist< T, Allocator >::erase().
|
inline |
Remove the elements between the given range.
i | Iterator pointing to the starting position to be removed. |
j | Iterator pointing to the ending position to be removed. The element pointed by this iterator is not removed. |
j
).This member function removes the elements between the iterators i
and j
, including the element pointed by i
but not the element pointed by .
References efl::eina::inlist< T, Allocator >::end(), and efl::eina::inlist< T, Allocator >::erase().
|
inline |
Replace the content of the inline list by the elements in the given range.
i | Iterator pointing to the beginning of the elements to be copied. |
j | Iterator pointing to the end of the elements to be copied. Note that the element pointed by j will NOT be copied. |
This member function replaces the current elements by copies of the elements between the iterators i
and j
, including the element pointed by i
but not the one pointed by j
. The size of the list is adjusted accordingly and the newly copied elements remain in their original order.
References efl::eina::_inlist_common_base< T, Allocator >::clear(), efl::eina::inlist< T, Allocator >::end(), and efl::eina::inlist< T, Allocator >::insert().
|
inline |
Replace the content of the inline list by n
copies t
.
n | Number of elements. |
t | Value to be copied to each element. |
References efl::eina::_inlist_common_base< T, Allocator >::clear(), efl::eina::inlist< T, Allocator >::end(), and efl::eina::inlist< T, Allocator >::insert().
|
inline |
Get a reference to the last element.
References efl::eina::inlist< T, Allocator >::native_handle().
|
inline |
Get a constant reference to the last element.
Version of back() for const-qualified inline list objects. Returns a constant reference instead.
References efl::eina::inlist< T, Allocator >::native_handle().
|
inline |
Get a reference to the first element.
References efl::eina::inlist< T, Allocator >::native_handle().
|
inline |
Get a constant reference to the first element.
Version of front() for const-qualified inline list objects. Returns a constant reference instead.
References efl::eina::inlist< T, Allocator >::native_handle().
|
inline |
Get a constant iterator pointing to the first element of the inline list.
Version of begin() for const-qualified inline list objects. Returns a constant iterator instead.
References efl::eina::inlist< T, Allocator >::native_handle().
Referenced by efl::eina::inlist< T, Allocator >::cbegin(), efl::eina::inlist< T, Allocator >::inlist(), efl::eina::inlist< T, Allocator >::operator=(), efl::eina::operator==(), and efl::eina::inlist< T, Allocator >::rend().
|
inline |
Get a constant iterator to the position following the last element of the inline list.
Version of end() for const-qualified inline list objects. Returns a constant iterator instead.
References efl::eina::inlist< T, Allocator >::native_handle().
Referenced by efl::eina::inlist< T, Allocator >::assign(), efl::eina::inlist< T, Allocator >::cend(), efl::eina::inlist< T, Allocator >::erase(), efl::eina::inlist< T, Allocator >::inlist(), efl::eina::inlist< T, Allocator >::operator=(), efl::eina::operator==(), and efl::eina::inlist< T, Allocator >::rbegin().
|
inline |
Get an iterator pointing to the first element of the inline list.
This member function returns an iterator pointing to the first element of the inline list. If the list is empty the returned iterator is the same as the one returned by end().
References efl::eina::inlist< T, Allocator >::native_handle().
|
inline |
Get an iterator to the position following the last element of the inline list.
This member function returns an iterator to the position following the last element in the inline list. If the list is empty the returned iterator is the same as the one returned by begin().
References efl::eina::inlist< T, Allocator >::native_handle().
|
inline |
Get a constant reverse iterator pointing to the reverse begin of the inline list.
Version of rbegin() for const-qualified inline list objects. Returns a constant reverse iterator instead.
References efl::eina::inlist< T, Allocator >::end().
Referenced by efl::eina::inlist< T, Allocator >::crbegin().
|
inline |
Get a constant reverse iterator pointing to the reverse end of the inline list.
Version of rend() for const-qualified inline list objects. Returns a constant reverse iterator instead.
References efl::eina::inlist< T, Allocator >::begin().
Referenced by efl::eina::inlist< T, Allocator >::crend().
|
inline |
Get a reverse iterator pointing to the reverse begin of the inline list.
This member function returns a reverse iterator pointing to the last element of the inline list. If the list is empty the returned reverse iterator is the same as the one returned by rend().
References efl::eina::inlist< T, Allocator >::end().
|
inline |
Get a reverse iterator pointing to the reverse end of the inline list.
This member function returns a reverse iterator pointing to the position before the first element of the inline list. If the list is empty the returned iterator is the same as the one returned by rbegin().
References efl::eina::inlist< T, Allocator >::begin().
|
inline |
Get a constant iterator pointing to the first element of the inline list.
This member function works like begin() const but is granted to return a constant iterator even for lists that are not const-qualified.
References efl::eina::inlist< T, Allocator >::begin().
|
inline |
Get a constant iterator to the position following the last element of the inline list.
This member function works like end() const but is granted to return a constant iterator even for lists that are not const-qualified.
References efl::eina::inlist< T, Allocator >::end().
|
inline |
Get a constant reverse iterator pointing to the reverse begin of the inline list.
This member function works like rbegin() const but is granted to return a constant reverse iterator even for lists that are not const-qualified.
References efl::eina::inlist< T, Allocator >::rbegin().
|
inline |
Get a constant reverse iterator pointing to the reverse end of the inline list.
This member function works like rend() const but is granted to return a constant reverse iterator even for lists that are not const-qualified.
References efl::eina::inlist< T, Allocator >::rend().
|
inline |
Swap content between two inline lists.
other | Other inline list of the same type. |
References efl::eina::swap().
Referenced by efl::eina::swap().
|
inline |
Get the maximum number of elements a inline list can hold.
|
inline |
Get the handle for the wrapped Eina_Inlist.
This member function returns the native Eina_Inlist handle that is wrapped inside this object.
Referenced by efl::eina::inlist< T, Allocator >::back(), efl::eina::inlist< T, Allocator >::begin(), efl::eina::inlist< T, Allocator >::empty(), efl::eina::inlist< T, Allocator >::end(), efl::eina::inlist< T, Allocator >::front(), and efl::eina::inlist< T, Allocator >::size().
|
inline |
Get the handle for the wrapped Eina_Inlist.
This member function returns the native Eina_Inlist handle that is wrapped inside this object.
|
inline |
Get a constant eina::accessor for the list.
eina::accessor
to the list.Version of accessor() to const-qualified inline lists. Returns a const-qualified eina::accessor
instead.
References eina_inlist_accessor_new().
|
inline |
Get a eina::accessor for the list.
eina::accessor
to the list. References eina_inlist_accessor_new().