Stefan Scholz / ETL
Embed: (wiki syntax)

« Back to documentation index

iforward_list< T > Class Template Reference

A templated base for all etl::forward_list types. More...

#include <forward_list.h>

Inherits etl::forward_list_base.

Inherited by forward_list< T, MAX_SIZE_ >.

Data Structures

class  const_iterator
 const_iterator More...
struct  data_node_t
 The data node element in the forward_list. More...
class  iterator
 iterator. More...

Public Types

typedef size_t size_type
 The type used for determining the size of forward_list.

Public Member Functions

iterator begin ()
 Gets the beginning of the forward_list.
const_iterator begin () const
 Gets the beginning of the forward_list.
iterator before_begin ()
 Gets before the beginning of the forward_list.
const_iterator before_begin () const
 Gets before the beginning of the forward_list.
const_iterator cbegin () const
 Gets the beginning of the forward_list.
iterator end ()
 Gets the end of the forward_list.
const_iterator end () const
 Gets the end of the forward_list.
const_iterator cend () const
 Gets the end of the forward_list.
void clear ()
 Clears the forward_list.
reference front ()
 Gets a reference to the first element.
const_reference front () const
 Gets a const reference to the first element.
template<typename TIterator >
void assign (TIterator first, TIterator last)
 Assigns a range of values to the forward_list.
void assign (size_t n, parameter_t value)
 Assigns 'n' copies of a value to the forward_list.
void push_front ()
 Adds a node to the front of the forward_list so a new value can be assigned to front().
void push_front (parameter_t value)
 Pushes a value to the front of the forward_list.
template<typename T1 >
void emplace_front (const T1 &value1)
 Emplaces a value to the front of the list..
template<typename T1 , typename T2 >
void emplace_front (const T1 &value1, const T2 &value2)
 Emplaces a value to the front of the list..
template<typename T1 , typename T2 , typename T3 >
void emplace_front (const T1 &value1, const T2 &value2, const T3 &value3)
 Emplaces a value to the front of the list..
template<typename T1 , typename T2 , typename T3 , typename T4 >
void emplace_front (const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 Emplaces a value to the front of the list..
void pop_front ()
 Removes a value from the front of the forward_list.
void resize (size_t n)
 Resizes the forward_list.
void resize (size_t n, T value)
 Resizes the forward_list.
iterator insert_after (iterator position, parameter_t value)
 Inserts a value to the forward_list after the specified position.
template<typename T1 >
iterator emplace_after (iterator position, const T1 &value1)
 Emplaces a value to the forward_list after the specified position.
template<typename T1 , typename T2 >
iterator emplace_after (iterator position, const T1 &value1, const T2 &value2)
 Emplaces a value to the forward_list after the specified position.
template<typename T1 , typename T2 , typename T3 >
iterator emplace_after (iterator position, const T1 &value1, const T2 &value2, const T3 &value3)
 Emplaces a value to the forward_list after the specified position.
template<typename T1 , typename T2 , typename T3 , typename T4 >
iterator emplace_after (iterator position, const T1 &value1, const T2 &value2, const T3 &value3, const T4 &value4)
 Emplaces a value to the forward_list after the specified position.
void insert_after (iterator position, size_t n, parameter_t value)
 Inserts 'n' copies of a value to the forward_list after the specified position.
template<typename TIterator >
void insert_after (iterator position, TIterator first, TIterator last)
 Inserts a range of values to the forward_list after the specified position.
iterator erase_after (iterator position)
 Erases the value at the specified position.
iterator erase_after (iterator first, iterator last)
 Erases a range of elements.
void move_after (const_iterator from_before, const_iterator to_before)
 Erases the value at the specified position.
void move_after (const_iterator first_before, const_iterator last, const_iterator to_before)
 Moves a range from one position to another within the list.
void unique ()
 Removes all but the first element from every consecutive group of equal elements in the container.
template<typename TIsEqual >
void unique (TIsEqual isEqual)
 Removes all but the one element from every consecutive group of equal elements in the container.
void sort ()
 Sort using in-place merge sort algorithm.
template<typename TCompare >
void sort (TCompare compare)
 Sort using in-place merge sort algorithm.
template<typename TPredicate >
void remove_if (TPredicate predicate)
 Removes according to a predicate.
iforward_listoperator= (const iforward_list &rhs)
 Assignment operator.
size_type size () const
 Gets the size of the forward_list.
size_type max_size () const
 Gets the maximum possible size of the forward_list.
bool empty () const
 Checks to see if the forward_list is empty.
bool full () const
 Checks to see if the forward_list is full.
size_t available () const
 Returns the remaining capacity.
void reverse ()
 Reverses the forward_list.

Protected Member Functions

 iforward_list (etl::ipool &node_pool, size_t max_size_)
 Constructor.
void initialise ()
 Initialise the forward_list.
node_tget_head ()
 Get the head node.
const node_tget_head () const
 Get the head node.
void insert_node_after (node_t &position, node_t &node)
 Insert a node.
bool is_trivial_list () const
 Is the forward_list a trivial length?
void join (node_t *left, node_t *right)
 Join two nodes.

Protected Attributes

node_t start_node
 The node that acts as the forward_list start.
etl::ipool * p_node_pool
 The pool of data nodes used in the list.
const size_type MAX_SIZE
 The maximum size of the forward_list.
etl::debug_count construct_count
 Internal debugging.

Detailed Description

template<typename T>
class etl::iforward_list< T >

A templated base for all etl::forward_list types.

Definition at line 278 of file forward_list.h.


Member Typedef Documentation

typedef size_t size_type

The type used for determining the size of forward_list.

Reimplemented from forward_list_base.

Reimplemented in forward_list< T, MAX_SIZE_ >.

Definition at line 287 of file forward_list.h.


Constructor & Destructor Documentation

iforward_list ( etl::ipool &  node_pool,
size_t  max_size_ 
) [protected]

Constructor.

Definition at line 1217 of file forward_list.h.


Member Function Documentation

void assign ( TIterator  first,
TIterator  last 
)

Assigns a range of values to the forward_list.

If asserts or exceptions are enabled throws etl::forward_list_full if the forward_list does not have enough free space. If ETL_THROW_EXCEPTIONS & ETL_DEBUG are defined throws forward_list_iterator if the iterators are reversed.

Definition at line 574 of file forward_list.h.

void assign ( size_t  n,
parameter_t  value 
)

Assigns 'n' copies of a value to the forward_list.

Definition at line 600 of file forward_list.h.

size_t available (  ) const [inherited]

Returns the remaining capacity.

Returns:
The remaining capacity.

Definition at line 181 of file forward_list.h.

const_iterator before_begin (  ) const

Gets before the beginning of the forward_list.

Definition at line 507 of file forward_list.h.

iterator before_begin (  )

Gets before the beginning of the forward_list.

Definition at line 499 of file forward_list.h.

const_iterator begin (  ) const

Gets the beginning of the forward_list.

Definition at line 491 of file forward_list.h.

iterator begin (  )

Gets the beginning of the forward_list.

Definition at line 483 of file forward_list.h.

const_iterator cbegin (  ) const

Gets the beginning of the forward_list.

Definition at line 515 of file forward_list.h.

const_iterator cend (  ) const

Gets the end of the forward_list.

Definition at line 539 of file forward_list.h.

void clear (  )

Clears the forward_list.

Definition at line 547 of file forward_list.h.

iterator emplace_after ( iterator  position,
const T1 &  value1 
)

Emplaces a value to the forward_list after the specified position.

Definition at line 772 of file forward_list.h.

iterator emplace_after ( iterator  position,
const T1 &  value1,
const T2 &  value2 
)

Emplaces a value to the forward_list after the specified position.

Definition at line 788 of file forward_list.h.

iterator emplace_after ( iterator  position,
const T1 &  value1,
const T2 &  value2,
const T3 &  value3 
)

Emplaces a value to the forward_list after the specified position.

Definition at line 804 of file forward_list.h.

iterator emplace_after ( iterator  position,
const T1 &  value1,
const T2 &  value2,
const T3 &  value3,
const T4 &  value4 
)

Emplaces a value to the forward_list after the specified position.

Definition at line 820 of file forward_list.h.

void emplace_front ( const T1 &  value1 )

Emplaces a value to the front of the list..

Definition at line 643 of file forward_list.h.

void emplace_front ( const T1 &  value1,
const T2 &  value2 
)

Emplaces a value to the front of the list..

Definition at line 658 of file forward_list.h.

void emplace_front ( const T1 &  value1,
const T2 &  value2,
const T3 &  value3 
)

Emplaces a value to the front of the list..

Definition at line 673 of file forward_list.h.

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 at line 688 of file forward_list.h.

bool empty (  ) const [inherited]

Checks to see if the forward_list is empty.

Definition at line 164 of file forward_list.h.

iterator end (  )

Gets the end of the forward_list.

Definition at line 523 of file forward_list.h.

const_iterator end (  ) const

Gets the end of the forward_list.

Definition at line 531 of file forward_list.h.

iterator erase_after ( iterator  position )

Erases the value at the specified position.

Definition at line 870 of file forward_list.h.

iterator erase_after ( iterator  first,
iterator  last 
)

Erases a range of elements.

Definition at line 889 of file forward_list.h.

reference front (  )

Gets a reference to the first element.

Definition at line 555 of file forward_list.h.

const_reference front (  ) const

Gets a const reference to the first element.

Definition at line 563 of file forward_list.h.

bool full (  ) const [inherited]

Checks to see if the forward_list is full.

Definition at line 172 of file forward_list.h.

node_t& get_head (  ) [protected, inherited]

Get the head node.

Definition at line 228 of file forward_list.h.

const node_t& get_head (  ) const [protected, inherited]

Get the head node.

Definition at line 236 of file forward_list.h.

void initialise (  ) [protected]

Initialise the forward_list.

Definition at line 1225 of file forward_list.h.

iterator insert_after ( iterator  position,
parameter_t  value 
)

Inserts a value to the forward_list after the specified position.

Definition at line 758 of file forward_list.h.

void insert_after ( iterator  position,
size_t  n,
parameter_t  value 
)

Inserts 'n' copies of a value to the forward_list after the specified position.

Definition at line 835 of file forward_list.h.

void insert_after ( iterator  position,
TIterator  first,
TIterator  last 
)

Inserts a range of values to the forward_list after the specified position.

Definition at line 851 of file forward_list.h.

void insert_node_after ( node_t position,
node_t node 
) [protected, inherited]

Insert a node.

Definition at line 244 of file forward_list.h.

bool is_trivial_list (  ) const [protected, inherited]

Is the forward_list a trivial length?

Definition at line 254 of file forward_list.h.

void join ( node_t left,
node_t right 
) [protected, inherited]

Join two nodes.

Definition at line 262 of file forward_list.h.

size_type max_size (  ) const [inherited]

Gets the maximum possible size of the forward_list.

Definition at line 156 of file forward_list.h.

void move_after ( const_iterator  from_before,
const_iterator  to_before 
)

Erases the value at the specified position.

Definition at line 928 of file forward_list.h.

void move_after ( const_iterator  first_before,
const_iterator  last,
const_iterator  to_before 
)

Moves a range from one position to another within the list.

Moves a range at position 'first_before'/'last' to the position before 'to_before'.

Definition at line 952 of file forward_list.h.

iforward_list& operator= ( const iforward_list< T > &  rhs )

Assignment operator.

Definition at line 1202 of file forward_list.h.

void pop_front (  )

Removes a value from the front of the forward_list.

Definition at line 702 of file forward_list.h.

void push_front (  )

Adds a node to the front of the forward_list so a new value can be assigned to front().

Definition at line 621 of file forward_list.h.

void push_front ( parameter_t  value )

Pushes a value to the front of the forward_list.

Definition at line 629 of file forward_list.h.

void remove_if ( TPredicate  predicate )

Removes according to a predicate.

Definition at line 1180 of file forward_list.h.

void resize ( size_t  n,
value 
)

Resizes the forward_list.

If asserts or exceptions are enabled, will throw an etl::forward_list_full if n is larger than the maximum size.

Definition at line 723 of file forward_list.h.

void resize ( size_t  n )

Resizes the forward_list.

Definition at line 713 of file forward_list.h.

void reverse (  ) [inherited]

Reverses the forward_list.

Definition at line 189 of file forward_list.h.

size_type size (  ) const [inherited]

Gets the size of the forward_list.

Definition at line 148 of file forward_list.h.

void sort (  )

Sort using in-place merge sort algorithm.

Uses 'less-than operator as the predicate.

Definition at line 1032 of file forward_list.h.

void sort ( TCompare  compare )

Sort using in-place merge sort algorithm.

Uses a supplied predicate function or functor. This is not my algorithm. I got it off the web somewhere.

Definition at line 1043 of file forward_list.h.

void unique (  )

Removes all but the first element from every consecutive group of equal elements in the container.

Definition at line 991 of file forward_list.h.

void unique ( TIsEqual  isEqual )

Removes all but the one element from every consecutive group of equal elements in the container.

Definition at line 1001 of file forward_list.h.


Field Documentation

etl::debug_count construct_count [protected, inherited]

Internal debugging.

Definition at line 270 of file forward_list.h.

const size_type MAX_SIZE [protected, inherited]

The maximum size of the forward_list.

Reimplemented in forward_list< T, MAX_SIZE_ >.

Definition at line 269 of file forward_list.h.

etl::ipool* p_node_pool [protected, inherited]

The pool of data nodes used in the list.

Definition at line 268 of file forward_list.h.

node_t start_node [protected, inherited]

The node that acts as the forward_list start.

Definition at line 267 of file forward_list.h.