mn::container::basic_list< T, TAllocator, TDeleter > Class Template Reference

#include <mn_list.hpp>

+ Inheritance diagram for mn::container::basic_list< T, TAllocator, TDeleter >:
+ Collaboration diagram for mn::container::basic_list< T, TAllocator, TDeleter >:

Public Types

using self_type = basic_list< T, TAllocator, TDeleter >
 
using value_type = T
 
using allocator_type = TAllocator
 
using size_type = mn::size_t
 
using node_type = basic_node< T >
 
using deleter = TDeleter
 
using iterator = list_node_iterator< node_type *, const value_type *, const value_type & >
 
using const_iterator = list_node_iterator< const node_type *, const value_type *, const value_type & >
 

Public Member Functions

 basic_list (const allocator_type &allocator=allocator_type())
 Construct a new basic list object. More...
 
template<class InputIterator >
 basic_list (InputIterator first, InputIterator last, const allocator_type &allocator=allocator_type())
 Construct a new basic list object. More...
 
 basic_list (const basic_list &rhs)
 Construct a new basic list object. More...
 
 ~basic_list ()
 Destroy the basic list object. More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
const T & front () const
 
T & front ()
 
const T & back () const
 
T & back ()
 
void push_front (const T &value)
 
void pop_front ()
 
void push_back (const T &value)
 
void pop_back ()
 
iterator insert (iterator pos, const T &value)
 
iterator erase (iterator it)
 
iterator erase (iterator first, iterator last)
 
template<class InputIterator >
void assign (InputIterator first, InputIterator last)
 
bool empty () const
 
void clear ()
 
size_type size () const
 
allocator_typeget_allocator () noexcept
 
deleter_type & get_deleter () noexcept
 
void set_allocator (const allocator_type &allocator)
 
basic_listoperator= (const basic_list &rhs)
 

Static Public Attributes

static const size_type NodeSize = sizeof(node_type)
 

Private Member Functions

node_typeconstruct_node (const T &value)
 
void destruct_node (node_type *n)
 

Private Attributes

allocator_type m_allocator
 
deleter m_deleter
 
node_type m_root
 

Member Typedef Documentation

◆ allocator_type

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
using mn::container::basic_list< T, TAllocator, TDeleter >::allocator_type = TAllocator

◆ const_iterator

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
using mn::container::basic_list< T, TAllocator, TDeleter >::const_iterator = list_node_iterator<const node_type*, const value_type*, const value_type&>

◆ deleter

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
using mn::container::basic_list< T, TAllocator, TDeleter >::deleter = TDeleter

◆ iterator

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
using mn::container::basic_list< T, TAllocator, TDeleter >::iterator = list_node_iterator<node_type*, const value_type*, const value_type&>

◆ node_type

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
using mn::container::basic_list< T, TAllocator, TDeleter >::node_type = basic_node<T>

◆ self_type

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
using mn::container::basic_list< T, TAllocator, TDeleter >::self_type = basic_list<T, TAllocator, TDeleter>

◆ size_type

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
using mn::container::basic_list< T, TAllocator, TDeleter >::size_type = mn::size_t

◆ value_type

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
using mn::container::basic_list< T, TAllocator, TDeleter >::value_type = T

Constructor & Destructor Documentation

◆ basic_list() [1/3]

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
mn::container::basic_list< T, TAllocator, TDeleter >::basic_list ( const allocator_type allocator = allocator_type())
inlineexplicit

Construct a new basic list object.

◆ basic_list() [2/3]

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
template<class InputIterator >
mn::container::basic_list< T, TAllocator, TDeleter >::basic_list ( InputIterator  first,
InputIterator  last,
const allocator_type allocator = allocator_type() 
)
inline

Construct a new basic list object.

◆ basic_list() [3/3]

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
mn::container::basic_list< T, TAllocator, TDeleter >::basic_list ( const basic_list< T, TAllocator, TDeleter > &  rhs)
inline

Construct a new basic list object.

◆ ~basic_list()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
mn::container::basic_list< T, TAllocator, TDeleter >::~basic_list ( )
inline

Destroy the basic list object.

Member Function Documentation

◆ assign()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
template<class InputIterator >
void mn::container::basic_list< T, TAllocator, TDeleter >::assign ( InputIterator  first,
InputIterator  last 
)
inline

◆ back() [1/2]

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
T& mn::container::basic_list< T, TAllocator, TDeleter >::back ( )
inline

◆ back() [2/2]

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
const T& mn::container::basic_list< T, TAllocator, TDeleter >::back ( ) const
inline

◆ begin() [1/2]

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
iterator mn::container::basic_list< T, TAllocator, TDeleter >::begin ( )
inline

◆ begin() [2/2]

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
const_iterator mn::container::basic_list< T, TAllocator, TDeleter >::begin ( ) const
inline

◆ clear()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
void mn::container::basic_list< T, TAllocator, TDeleter >::clear ( )
inline

◆ construct_node()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
node_type* mn::container::basic_list< T, TAllocator, TDeleter >::construct_node ( const T &  value)
inlineprivate

◆ destruct_node()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
void mn::container::basic_list< T, TAllocator, TDeleter >::destruct_node ( node_type n)
inlineprivate

◆ empty()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
bool mn::container::basic_list< T, TAllocator, TDeleter >::empty ( ) const
inline

◆ end() [1/2]

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
iterator mn::container::basic_list< T, TAllocator, TDeleter >::end ( )
inline

◆ end() [2/2]

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
const_iterator mn::container::basic_list< T, TAllocator, TDeleter >::end ( ) const
inline

◆ erase() [1/2]

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
iterator mn::container::basic_list< T, TAllocator, TDeleter >::erase ( iterator  first,
iterator  last 
)
inline

◆ erase() [2/2]

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
iterator mn::container::basic_list< T, TAllocator, TDeleter >::erase ( iterator  it)
inline

◆ front() [1/2]

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
T& mn::container::basic_list< T, TAllocator, TDeleter >::front ( )
inline

◆ front() [2/2]

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
const T& mn::container::basic_list< T, TAllocator, TDeleter >::front ( ) const
inline

◆ get_allocator()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
allocator_type& mn::container::basic_list< T, TAllocator, TDeleter >::get_allocator ( )
inlinenoexcept

◆ get_deleter()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
deleter_type& mn::container::basic_list< T, TAllocator, TDeleter >::get_deleter ( )
inlinenoexcept

◆ insert()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
iterator mn::container::basic_list< T, TAllocator, TDeleter >::insert ( iterator  pos,
const T &  value 
)
inline

◆ operator=()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
basic_list& mn::container::basic_list< T, TAllocator, TDeleter >::operator= ( const basic_list< T, TAllocator, TDeleter > &  rhs)
inline

◆ pop_back()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
void mn::container::basic_list< T, TAllocator, TDeleter >::pop_back ( )
inline

◆ pop_front()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
void mn::container::basic_list< T, TAllocator, TDeleter >::pop_front ( )
inline

◆ push_back()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
void mn::container::basic_list< T, TAllocator, TDeleter >::push_back ( const T &  value)
inline

◆ push_front()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
void mn::container::basic_list< T, TAllocator, TDeleter >::push_front ( const T &  value)
inline

◆ set_allocator()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
void mn::container::basic_list< T, TAllocator, TDeleter >::set_allocator ( const allocator_type allocator)
inline

◆ size()

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
size_type mn::container::basic_list< T, TAllocator, TDeleter >::size ( ) const
inline

Member Data Documentation

◆ m_allocator

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
allocator_type mn::container::basic_list< T, TAllocator, TDeleter >::m_allocator
private

◆ m_deleter

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
deleter mn::container::basic_list< T, TAllocator, TDeleter >::m_deleter
private

◆ m_root

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
node_type mn::container::basic_list< T, TAllocator, TDeleter >::m_root
private

◆ NodeSize

template<typename T , class TAllocator = memory::default_allocator, class TDeleter = memory::default_delete<T,TAllocator>>
const size_type mn::container::basic_list< T, TAllocator, TDeleter >::NodeSize = sizeof(node_type)
static

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