L4Re - L4 Runtime Environment
cxx::List< D, Alloc > Class Template Reference

Doubly linked list, with internal allocation. More...

+ Collaboration diagram for cxx::List< D, Alloc >:

Data Structures

class  Iter
 Iterator. More...
 

Public Member Functions

void push_back (D const &d) throw ()
 Add element at the end of the list. More...
 
void push_front (D const &d) throw ()
 Add element at the beginning of the list. More...
 
void remove (Iter const &i) throw ()
 Remove element pointed to by the iterator. More...
 
unsigned long size () const throw ()
 Get the length of the list. More...
 
D const & operator[] (unsigned long idx) const throw ()
 Random access. More...
 
D & operator[] (unsigned long idx) throw ()
 Random access. More...
 
Iter items () throw ()
 Get iterator for the list elements. More...
 

Detailed Description

template<typename D, template< typename A > class Alloc = New_allocator>
class cxx::List< D, Alloc >

Doubly linked list, with internal allocation.

Container for items of type D, implemented by a doubly linked list. Alloc defines the allocator policy.

Definition at line 334 of file list.

Member Function Documentation

◆ items()

template<typename D , template< typename A > class Alloc = New_allocator>
Iter cxx::List< D, Alloc >::items ( )
throw (
)
inline

Get iterator for the list elements.

Definition at line 412 of file list.

◆ operator[]() [1/2]

template<typename D , template< typename A > class Alloc = New_allocator>
D const& cxx::List< D, Alloc >::operator[] ( unsigned long  idx) const
throw (
)
inline

Random access.

Complexity is O(n).

Definition at line 404 of file list.

◆ operator[]() [2/2]

template<typename D , template< typename A > class Alloc = New_allocator>
D& cxx::List< D, Alloc >::operator[] ( unsigned long  idx)
throw (
)
inline

Random access.

Complexity is O(n).

Definition at line 408 of file list.

◆ push_back()

template<typename D , template< typename A > class Alloc = New_allocator>
void cxx::List< D, Alloc >::push_back ( D const &  d)
throw (
)
inline

Add element at the end of the list.

Definition at line 379 of file list.

◆ push_front()

template<typename D , template< typename A > class Alloc = New_allocator>
void cxx::List< D, Alloc >::push_front ( D const &  d)
throw (
)
inline

Add element at the beginning of the list.

Definition at line 388 of file list.

◆ remove()

template<typename D , template< typename A > class Alloc = New_allocator>
void cxx::List< D, Alloc >::remove ( Iter const &  i)
throw (
)
inline

Remove element pointed to by the iterator.

Definition at line 397 of file list.

◆ size()

template<typename D , template< typename A > class Alloc = New_allocator>
unsigned long cxx::List< D, Alloc >::size ( ) const
throw (
)
inline

Get the length of the list.

Definition at line 401 of file list.


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