RADLib
RADical C++ application framework
RADData::RADList< T, Alloc > Class Template Reference

Stable-node doubly linked list for cases where node stability matters. More...

#include <RADDataStructures.h>

Classes

class  const_iterator
 Const forward iterator. More...
 
class  iterator
 Mutable bidirectional iterator. More...
 

Public Member Functions

 RADList ()=default
 Creates an empty list. More...
 
 RADList (std::initializer_list< T > values)
 Creates a list from initializer-list values. More...
 
 RADList (const RADList &other)
 Copies another list. More...
 
RADListoperator= (const RADList &other)
 Replaces this list with a copy of other. More...
 
 RADList (RADList &&other) noexcept
 Moves another list by taking its node chain. More...
 
RADListoperator= (RADList &&other) noexcept
 Replaces this list by taking other's node chain. More...
 
 ~RADList ()
 Destroys all nodes. More...
 
iterator begin () noexcept
 Returns iterator to first node. More...
 
iterator end () noexcept
 Returns end iterator. More...
 
const_iterator begin () const noexcept
 Returns const iterator to first node. More...
 
const_iterator end () const noexcept
 Returns const end iterator. More...
 
bool empty () const noexcept
 Returns true when no nodes are present. More...
 
size_t size () const noexcept
 Returns number of nodes. More...
 
T & front () noexcept
 Returns first element. More...
 
const T & front () const noexcept
 Returns first element. More...
 
T & back () noexcept
 Returns last element. More...
 
const T & back () const noexcept
 Returns last element. More...
 
template<typename... Args>
T & emplace_back (Args &&... args)
 Constructs an element at the back and returns it. More...
 
template<typename... Args>
T & emplace_front (Args &&... args)
 Constructs an element at the front and returns it. More...
 
void push_back (const T &value)
 Appends a copy at the back. More...
 
void push_back (T &&value)
 Appends a moved value at the back. More...
 
void push_front (const T &value)
 Prepends a copy at the front. More...
 
void push_front (T &&value)
 Prepends a moved value at the front. More...
 
void pop_front ()
 Removes the first node. More...
 
void pop_back ()
 Removes the last node. More...
 
iterator erase (iterator it)
 Erases the node at it and returns the following iterator. More...
 
void clear () noexcept
 Removes all nodes. More...
 

Detailed Description

template<typename T, typename Alloc = std::allocator<T>>
class RADData::RADList< T, Alloc >

Stable-node doubly linked list for cases where node stability matters.

Constructor & Destructor Documentation

◆ RADList() [1/4]

template<typename T , typename Alloc = std::allocator<T>>
RADData::RADList< T, Alloc >::RADList ( )
default

Creates an empty list.

◆ RADList() [2/4]

template<typename T , typename Alloc = std::allocator<T>>
RADData::RADList< T, Alloc >::RADList ( std::initializer_list< T >  values)
inline

Creates a list from initializer-list values.

◆ RADList() [3/4]

template<typename T , typename Alloc = std::allocator<T>>
RADData::RADList< T, Alloc >::RADList ( const RADList< T, Alloc > &  other)
inline

Copies another list.

◆ RADList() [4/4]

template<typename T , typename Alloc = std::allocator<T>>
RADData::RADList< T, Alloc >::RADList ( RADList< T, Alloc > &&  other)
inlinenoexcept

Moves another list by taking its node chain.

◆ ~RADList()

template<typename T , typename Alloc = std::allocator<T>>
RADData::RADList< T, Alloc >::~RADList ( )
inline

Destroys all nodes.

Member Function Documentation

◆ back() [1/2]

template<typename T , typename Alloc = std::allocator<T>>
const T& RADData::RADList< T, Alloc >::back ( ) const
inlinenoexcept

Returns last element.

◆ back() [2/2]

template<typename T , typename Alloc = std::allocator<T>>
T& RADData::RADList< T, Alloc >::back ( )
inlinenoexcept

Returns last element.

◆ begin() [1/2]

template<typename T , typename Alloc = std::allocator<T>>
const_iterator RADData::RADList< T, Alloc >::begin ( ) const
inlinenoexcept

Returns const iterator to first node.

◆ begin() [2/2]

template<typename T , typename Alloc = std::allocator<T>>
iterator RADData::RADList< T, Alloc >::begin ( )
inlinenoexcept

Returns iterator to first node.

◆ clear()

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADList< T, Alloc >::clear ( )
inlinenoexcept

Removes all nodes.

◆ emplace_back()

template<typename T , typename Alloc = std::allocator<T>>
template<typename... Args>
T& RADData::RADList< T, Alloc >::emplace_back ( Args &&...  args)
inline

Constructs an element at the back and returns it.

◆ emplace_front()

template<typename T , typename Alloc = std::allocator<T>>
template<typename... Args>
T& RADData::RADList< T, Alloc >::emplace_front ( Args &&...  args)
inline

Constructs an element at the front and returns it.

◆ empty()

template<typename T , typename Alloc = std::allocator<T>>
bool RADData::RADList< T, Alloc >::empty ( ) const
inlinenoexcept

Returns true when no nodes are present.

◆ end() [1/2]

template<typename T , typename Alloc = std::allocator<T>>
const_iterator RADData::RADList< T, Alloc >::end ( ) const
inlinenoexcept

Returns const end iterator.

◆ end() [2/2]

template<typename T , typename Alloc = std::allocator<T>>
iterator RADData::RADList< T, Alloc >::end ( )
inlinenoexcept

Returns end iterator.

◆ erase()

template<typename T , typename Alloc = std::allocator<T>>
iterator RADData::RADList< T, Alloc >::erase ( iterator  it)
inline

Erases the node at it and returns the following iterator.

◆ front() [1/2]

template<typename T , typename Alloc = std::allocator<T>>
const T& RADData::RADList< T, Alloc >::front ( ) const
inlinenoexcept

Returns first element.

◆ front() [2/2]

template<typename T , typename Alloc = std::allocator<T>>
T& RADData::RADList< T, Alloc >::front ( )
inlinenoexcept

Returns first element.

◆ operator=() [1/2]

template<typename T , typename Alloc = std::allocator<T>>
RADList& RADData::RADList< T, Alloc >::operator= ( const RADList< T, Alloc > &  other)
inline

Replaces this list with a copy of other.

◆ operator=() [2/2]

template<typename T , typename Alloc = std::allocator<T>>
RADList& RADData::RADList< T, Alloc >::operator= ( RADList< T, Alloc > &&  other)
inlinenoexcept

Replaces this list by taking other's node chain.

◆ pop_back()

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADList< T, Alloc >::pop_back ( )
inline

Removes the last node.

◆ pop_front()

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADList< T, Alloc >::pop_front ( )
inline

Removes the first node.

◆ push_back() [1/2]

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADList< T, Alloc >::push_back ( const T &  value)
inline

Appends a copy at the back.

◆ push_back() [2/2]

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADList< T, Alloc >::push_back ( T &&  value)
inline

Appends a moved value at the back.

◆ push_front() [1/2]

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADList< T, Alloc >::push_front ( const T &  value)
inline

Prepends a copy at the front.

◆ push_front() [2/2]

template<typename T , typename Alloc = std::allocator<T>>
void RADData::RADList< T, Alloc >::push_front ( T &&  value)
inline

Prepends a moved value at the front.

◆ size()

template<typename T , typename Alloc = std::allocator<T>>
size_t RADData::RADList< T, Alloc >::size ( ) const
inlinenoexcept

Returns number of nodes.


The documentation for this class was generated from the following file: