Loading...
Searching...
No Matches
cxx::H_list< T, POLICY > Class Template Reference

General double-linked list of unspecified cxx::H_list_item elements. More...

`#include <hlist>`

Inheritance diagram for cxx::H_list< T, POLICY >:
Collaboration diagram for cxx::H_list< T, POLICY >:

## Public Member Functions

void | add (T *e)
| Add element to the front of the list.
void | push_front (T *e)
| Add element to the front of the list.
T * | pop_front ()
| Remove and return the head element of the list.
Iterator | insert (T *e, Iterator const &pred)
| Insert an element at the iterator position.
Public Member Functions inherited from cxx::Bits::Basic_list< POLICY >
bool | empty () const
| Check if the list is empty.
Value_type | front () const
| Return the first element in the list.
void | clear ()
| Remove all elements from the list.
Iterator | begin ()
| Return an iterator to the beginning of the list.
Const_iterator | begin () const
| Return a const iterator to the beginning of the list.
Const_iterator | end () const
| Return a const iterator to the end of the list.
Iterator | end ()
| Return an iterator to the end of the list.

## Static Public Member Functions

static Iterator | iter (T *c)
| Return an iterator for an arbitrary list element.
static bool | in_list (T const *e)
| Check if the given element is currently part of a list.
static Iterator | insert_after (T *e, Iterator const &pred)
| Insert an element after the iterator position.
static void | insert_before (T *e, Iterator const &succ)
| Insert an element before the iterator position.
static void | replace (T *p, T *e)
| Replace an element in a list with a new element.
static void | remove (T *e)
| Remove the given element from its list.
static Iterator | erase (Iterator const &e)
| Remove the element at the given iterator position.
Static Public Member Functions inherited from cxx::Bits::Basic_list< POLICY >
static Const_iterator | iter (Const_value_type c)
| Return a const iterator that begins at the given element.

## Additional Inherited Members

Protected Attributes inherited from cxx::Bits::Basic_list< POLICY >
POLICY::Head_type | _f
| Pointer to front of the list.

## Detailed Description

template<typename T, typename POLICY = Bits::Basic_list_policy< T, H_list_item>>
class cxx::H_list< T, POLICY >

General double-linked list of unspecified cxx::H_list_item elements.

Most of the time, you want to use H_list_t.

Definition at line 69 of file hlist.

## Member Function Documentation

## erase()

template<typename T, typename POLICY = Bits::Basic_list_policy< T, H_list_item>>

Iterator cxx::H_list< T, POLICY >::erase | ( | Iterator const & | e | ) |

inlinestatic

Remove the element at the given iterator position.

Parameters

  e | Iterator pointing to the element to be removed. Must not point to end().

Returns
  New iterator pointing to the element after the removed one.

Note
  The hlist implementation guarantees that the original iterator is still valid after the element has been removed. In fact, the iterator returned is the same as the one supplied in the e parameter.

Definition at line 236 of file hlist.

## insert()

template<typename T, typename POLICY = Bits::Basic_list_policy< T, H_list_item>>

Iterator cxx::H_list< T, POLICY >::insert | ( | T * | e,
|  | Iterator const & | pred )

inline

Insert an element at the iterator position.

Parameters

  e | New Element to be inserted
  pred | Iterator pointing to the element after which the element will be inserted. If end() is given, the element will be inserted at the beginning of the queue.

Returns
  Iterator pointing to the newly inserted element.

Definition at line 133 of file hlist.

## insert_after()

template<typename T, typename POLICY = Bits::Basic_list_policy< T, H_list_item>>

Iterator cxx::H_list< T, POLICY >::insert_after | ( | T * | e,
|  | Iterator const & | pred )

inlinestatic

Insert an element after the iterator position.

Parameters

  e | New element to be inserted.
  pred | Iterator pointing to the element after which the element will be inserted. Must not be end().

Returns
  Iterator pointing to the newly inserted element.

Precondition
  The list must not be empty.

Definition at line 160 of file hlist.

## insert_before()

template<typename T, typename POLICY = Bits::Basic_list_policy< T, H_list_item>>

void cxx::H_list< T, POLICY >::insert_before | ( | T * | e,
|  | Iterator const & | succ )

inlinestatic

Insert an element before the iterator position.

Parameters

  e | New element to be inserted.
  succ | Iterator pointing to the element before which the element will be inserted. Must not be end().

Definition at line 180 of file hlist.

## iter()

template<typename T, typename POLICY = Bits::Basic_list_policy< T, H_list_item>>

Iterator cxx::H_list< T, POLICY >::iter | ( | T * | c | ) |

inlinestatic

Return an iterator for an arbitrary list element.

Parameters

  c | List element to start the iteration.

Returns
  A mutable forward iterator.

Precondition
  The element must be in a list.

Definition at line 93 of file hlist.

Referenced by cxx::H_list< Timeout >::insert(), and cxx::H_list< Timeout >::insert_after().

Here is the caller graph for this function:

## pop_front()

template<typename T, typename POLICY = Bits::Basic_list_policy< T, H_list_item>>

T * cxx::H_list< T, POLICY >::pop_front | ( |  | ) |

inline

Remove and return the head element of the list.

Precondition
  The list must not be empty or the behaviour will be undefined.

Definition at line 116 of file hlist.

## remove()

template<typename T, typename POLICY = Bits::Basic_list_policy< T, H_list_item>>

void cxx::H_list< T, POLICY >::remove | ( | T * | e | ) |

inlinestatic

Remove the given element from its list.

Parameters

  e | Element to be removed. Must be in a list.

Definition at line 220 of file hlist.

Referenced by cxx::H_list< Timeout >::pop_front().

Here is the caller graph for this function:

## replace()

template<typename T, typename POLICY = Bits::Basic_list_policy< T, H_list_item>>

void cxx::H_list< T, POLICY >::replace | ( | T * | p,
|  | T * | e )

inlinestatic

Replace an element in a list with a new element.

Parameters

  p | Element in list to be replaced.
  e | Replacement element, must not yet be in a list.

Precondition
  p and e must not be NULL.

After the operation the p element is no longer in the list and may be reused.

Definition at line 204 of file hlist.

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

- l4/cxx/hlist