Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACE_Intrusive_List Class Template Reference

Implement an intrusive double linked list. More...

`#include <Intrusive_List.h>`

List of all members.

## Public Methods
| ACE_Intrusive_List (void)
| Constructor. Use user specified allocation strategy if specified.
| ~ACE_Intrusive_List (void)
| Destructor.
int | empty (void) const
| Returns 1 if the container is empty, otherwise returns 0.
void | push_front (T *node)
| Insert an element at the beginning of the list.
void | push_back (T *node)
| Insert an element at the end of the list.
T* | pop_front (void)
| Remove the element at the beginning of the list.
T* | pop_back (void)
| Remove the element at the end of the list.
T* | head (void) const
| Get the element at the head of the queue.
T* | tail (void) const
| Get the element at the tail of the queue.
void | remove (T *node)
| Remove a element from the list. More...
## Private Methods
void | remove_i (T *node)
| Remove a element from the list. More...
Disallow copying
| ACE_Intrusive_List (const ACE_Intrusive_List<T> &)
ACE_Intrusive_List<T>& | operator= (const ACE_Intrusive_List<T> &)
## Private Attributes
T* | head_
| Head and tail of the list.
T* | tail_

## Detailed Description

### template<class T> template class ACE_Intrusive_List

Implement an intrusive double linked list.

Intrusive lists assume that the elements they contain the pointers required to build the list. They are useful as light-weight containers and free-lists.

The template argument T must implement the following methods:

- T* T::next () const;
- void T::next (T *);
- T* T::prev () const;
- void T::prev (T* );

A simple way to satisfy the Intrusive_List requirements would be to implement a helper class:

class My_Object : public ACE_Intrusive_List_Node<My_Object> {
....
};

typedef ACE_Intrusive_List<My_Object> My_Object_List;

However, ACE is supported on platforms that would surely get confused using such templates.

Todo:
  The ACE_Message_Queue is an example of an intrusive list (or queue) but it is not implemented in terms of this class.

## Constructor & Destructor Documentation

template<classT>
ACE_Intrusive_List<T>::ACE_Intrusive_List<T> ( | void )`[inline]`

| Constructor. Use user specified allocation strategy if specified.

template<classT>
ACE_Intrusive_List<T>::~ACE_Intrusive_List<T> ( | void )

| Destructor.

template<classT>
ACE_Intrusive_List<T>::ACE_Intrusive_List<T> ( | const ACE_Intrusive_List< T >& )`[private]`

## Member Function Documentation

template<classT>
ACE_INLINE int ACE_Intrusive_List< T >::empty ( | void ) const

| Returns 1 if the container is empty, otherwise returns 0.

template<classT>
ACE_INLINE T * ACE_Intrusive_List< T >::head ( | void ) const

| Get the element at the head of the queue.

template<classT>
ACE_Intrusive_List< T >& ACE_Intrusive_List<T>::operator=<T> ( | const ACE_Intrusive_List< T >& )`[private]`

template<classT>
T * ACE_Intrusive_List<T>::pop_back ( | void )

| Remove the element at the end of the list.

template<classT>
T * ACE_Intrusive_List<T>::pop_front ( | void )

| Remove the element at the beginning of the list.

template<classT>
void ACE_Intrusive_List<T>::push_back ( | T * node )

| Insert an element at the end of the list.

template<classT>
void ACE_Intrusive_List<T>::push_front ( | T * node )

| Insert an element at the beginning of the list.

template<classT>
void ACE_Intrusive_List<T>::remove ( | T * node )

| Remove a element from the list. Verify that the element is still in the list before removing it.

template<classT>
void ACE_Intrusive_List<T>::remove_i ( | T * node )`[private]`

| Remove a element from the list. No attempts are performed to check if T* really belongs to the list. The effects of removing an invalid element are unspecified

template<classT>
ACE_INLINE T * ACE_Intrusive_List< T >::tail ( | void ) const

| Get the element at the tail of the queue.

## Member Data Documentation

template<classT>
T * ACE_Intrusive_List<T>::head_`[private]`

| Head and tail of the list.

template<classT>
T * ACE_Intrusive_List<T>::tail_`[private]`

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

- Intrusive_List.h
- Intrusive_List.cpp
- Intrusive_List.inl