L4Re Operating System Framework – Interface and Usage Documentation
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 80 of file hlist.

Member Function Documentation

◆ erase()

template<typename T , typename POLICY = Bits::Basic_list_policy< T, H_list_item>>
static Iterator cxx::H_list< T, POLICY >::erase ( Iterator const &  e)
inlinestatic

Remove the element at the given iterator position.

Parameters
eIterator 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 247 of file hlist.

Referenced by L4::Ipc_svr::Timeout_queue::handle_expired_timeouts().

+ Here is the caller graph for this function:

◆ 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
eNew Element to be inserted
predIterator 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 144 of file hlist.

References cxx::Bits::Basic_list< POLICY >::_f, cxx::Bits::Basic_list< POLICY >::end(), and cxx::H_list< T, POLICY >::iter().

+ Here is the call graph for this function:

◆ insert_after()

template<typename T , typename POLICY = Bits::Basic_list_policy< T, H_list_item>>
static Iterator cxx::H_list< T, POLICY >::insert_after ( T *  e,
Iterator const &  pred 
)
inlinestatic

Insert an element after the iterator position.

Parameters
eNew element to be inserted.
predIterator 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 171 of file hlist.

References cxx::H_list< T, POLICY >::iter().

+ Here is the call graph for this function:

◆ insert_before()

template<typename T , typename POLICY = Bits::Basic_list_policy< T, H_list_item>>
static void cxx::H_list< T, POLICY >::insert_before ( T *  e,
Iterator const &  succ 
)
inlinestatic

Insert an element before the iterator position.

Parameters
eNew element to be inserted.
succIterator pointing to the element before which the element will be inserted. Must not be end().

Definition at line 191 of file hlist.

Referenced by L4::Ipc_svr::Timeout_queue::add().

+ Here is the caller graph for this function:

◆ iter()

template<typename T , typename POLICY = Bits::Basic_list_policy< T, H_list_item>>
static Iterator cxx::H_list< T, POLICY >::iter ( T *  c)
inlinestatic

Return an iterator for an arbitrary list element.

Parameters
cList element to start the iteration.
Returns
A mutable forward iterator.
Precondition
The element must be in a list.

Definition at line 104 of file hlist.

Referenced by cxx::H_list< T, POLICY >::insert(), and cxx::H_list< T, POLICY >::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 127 of file hlist.

References cxx::Bits::Basic_list< POLICY >::front(), and cxx::H_list< T, POLICY >::remove().

+ Here is the call graph for this function:

◆ remove()

template<typename T , typename POLICY = Bits::Basic_list_policy< T, H_list_item>>
static void cxx::H_list< T, POLICY >::remove ( T *  e)
inlinestatic

Remove the given element from its list.

Parameters
eElement to be removed. Must be in a list.

Definition at line 231 of file hlist.

Referenced by cxx::Base_slab< Obj_size, Slab_size, Max_free, Alloc >::alloc(), cxx::Base_slab< Obj_size, Slab_size, Max_free, Alloc >::free(), cxx::H_list< T, POLICY >::pop_front(), and L4::Ipc_svr::Timeout_queue::remove().

+ Here is the caller graph for this function:

◆ replace()

template<typename T , typename POLICY = Bits::Basic_list_policy< T, H_list_item>>
static void cxx::H_list< T, POLICY >::replace ( T *  p,
T *  e 
)
inlinestatic

Replace an element in a list with a new element.

Parameters
pElement in list to be replaced.
eReplacement 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 215 of file hlist.


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