#include <Intrusive_List.h>
Collaboration diagram for ACE_Intrusive_List:

Public Methods | |
| ACE_Intrusive_List (void) | |
| Constructor. Use user specified allocation strategy if specified. More... | |
| ~ACE_Intrusive_List (void) | |
| Destructor. More... | |
| int | empty (void) const |
| Returns 1 if the container is empty, otherwise returns 0. More... | |
| void | push_front (T *node) |
| Insert an element at the beginning of the list. More... | |
| void | push_back (T *node) |
| Insert an element at the end of the list. More... | |
| T * | pop_front (void) |
| Remove the element at the beginning of the list. More... | |
| T * | pop_back (void) |
| Remove the element at the end of the list. More... | |
| T * | head (void) const |
| Get the element at the head of the queue. More... | |
| T * | tail (void) const |
| Get the element at the tail of the queue. More... | |
| 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 of the list. More... | |
| T * | tail_ |
| Tail of the list. More... | |
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:
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.
Definition at line 56 of file Intrusive_List.h.
|
||||||||||
|
Constructor. Use user specified allocation strategy if specified.
Definition at line 19 of file Intrusive_List.cpp.
|
|
||||||||||
|
Destructor.
Definition at line 26 of file Intrusive_List.cpp.
00027 {
00028 }
|
|
||||||||||
|
|
|
||||||||||
|
Returns 1 if the container is empty, otherwise returns 0.
Definition at line 4 of file Intrusive_List.inl. References head_.
00005 {
00006 return this->head_ == 0;
00007 }
|
|
||||||||||
|
Get the element at the head of the queue.
Definition at line 10 of file Intrusive_List.inl. References head_.
00011 {
00012 return this->head_;
00013 }
|
|
||||||||||
|
|
|
||||||||||
|
Remove the element at the end of the list.
Definition at line 77 of file Intrusive_List.cpp. References remove_i, and tail_.
|
|
||||||||||
|
Remove the element at the beginning of the list.
Definition at line 67 of file Intrusive_List.cpp. References head_, and remove_i.
|
|
||||||||||
|
Insert an element at the end of the list.
Definition at line 31 of file Intrusive_List.cpp.
|
|
||||||||||
|
Insert an element at the beginning of the list.
Definition at line 49 of file Intrusive_List.cpp.
|
|
||||||||||
|
Remove a element from the list. Verify that the element is still in the list before removing it. Definition at line 87 of file Intrusive_List.cpp. References head_, and remove_i.
|
|
||||||||||
|
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 Definition at line 100 of file Intrusive_List.cpp. Referenced by pop_back, pop_front, and remove.
00101 {
00102 if (node->prev () != 0)
00103 node->prev ()->next (node->next ());
00104 else
00105 this->head_ = node->next ();
00106
00107 if (node->next () != 0)
00108 node->next ()->prev (node->prev ());
00109 else
00110 this->tail_ = node->prev ();
00111
00112 node->next (0);
00113 node->prev (0);
00114 }
|
|
||||||||||
|
Get the element at the tail of the queue.
Definition at line 16 of file Intrusive_List.inl. References tail_.
00017 {
00018 return this->tail_;
00019 }
|
|
|||||
|
Head of the list.
Definition at line 114 of file Intrusive_List.h. Referenced by empty, head, pop_front, push_back, push_front, remove, and remove_i. |
|
|||||
|
Tail of the list.
Definition at line 117 of file Intrusive_List.h. Referenced by pop_back, push_back, push_front, remove_i, and tail. |
1.2.14 written by Dimitri van Heesch,
© 1997-2002