|
| ACE_Intrusive_List ()=default |
|
| ~ACE_Intrusive_List ()=default |
| Destructor.
|
|
bool | is_empty () const |
| Returns true if the container is empty, otherwise returns false.
|
|
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 () |
| Remove the element at the beginning of the list.
|
|
T * | pop_back () |
| Remove the element at the end of the list.
|
|
T * | head () const |
| Get the element at the head of the queue.
|
|
T * | tail () const |
| Get the element at the tail of the queue.
|
|
void | remove (T *node) |
| Remove a element from the list.
|
|
void | swap (ACE_Intrusive_List< T > &rhs) |
| Swap two lists.
|
|
void | unsafe_remove (T *node) |
| Remove a element from the list without checking.
|
|
template<class T>
class ACE_Intrusive_List< T >
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.