ACE
6.1.8
|
A double-linked list container class. More...
#include <Containers_T.h>
Public Member Functions | |
void | operator= (const ACE_DLList< T > &l) |
Delegates to ACE_Double_Linked_List. More... | |
int | get (T *&item, size_t slot=0) |
void | dump (void) const |
Delegates to ACE_Double_Linked_List. More... | |
int | remove (ACE_DLList_Node *n) |
Delegates to ACE_Double_Linked_List. More... | |
ACE_DLList (ACE_Allocator *the_allocator=0) | |
ACE_DLList (const ACE_DLList< T > &l) | |
Delegates to ACE_Double_Linked_List. More... | |
~ACE_DLList (void) | |
Queue-like insert and delete methods | |
T * | insert_tail (T *new_item) |
T * | insert_head (T *new_item) |
T * | delete_head (void) |
T * | delete_tail (void) |
![]() | |
ACE_Double_Linked_List (ACE_Allocator *the_allocator=0) | |
ACE_Double_Linked_List (const ACE_Double_Linked_List< ACE_DLList_Node > &) | |
Copy constructor. More... | |
void | operator= (const ACE_Double_Linked_List< ACE_DLList_Node > &) |
Assignment operator. More... | |
~ACE_Double_Linked_List (void) | |
Destructor. More... | |
int | is_empty (void) const |
Returns 1 if the container is empty, 0 otherwise. More... | |
int | is_full (void) const |
The list is unbounded, so this always returns 0. More... | |
ACE_DLList_Node * | insert_tail (ACE_DLList_Node *new_item) |
ACE_DLList_Node * | insert_head (ACE_DLList_Node *new_item) |
ACE_DLList_Node * | delete_head (void) |
Removes the head of the list and returns a pointer to that item. More... | |
ACE_DLList_Node * | delete_tail (void) |
Removes the tail of the list and returns a pointer to that item. More... | |
void | reset (void) |
Empty the list. More... | |
int | get (ACE_DLList_Node *&item, size_t slot=0) |
size_t | size (void) const |
The number of items in the queue. More... | |
void | dump (void) const |
Dump the state of an object. More... | |
int | remove (ACE_DLList_Node *n) |
Use DNode address directly. More... | |
Friends | |
class | ACE_DLList_Node |
class | ACE_Double_Linked_List_Iterator< T > |
class | ACE_DLList_Iterator< T > |
class | ACE_DLList_Reverse_Iterator< T > |
Additional Inherited Members | |
![]() | |
typedef ACE_Double_Linked_List_Iterator < ACE_DLList_Node > | ITERATOR |
typedef ACE_Double_Linked_List_Reverse_Iterator < ACE_DLList_Node > | REVERSE_ITERATOR |
![]() | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. More... | |
![]() | |
void | delete_nodes (void) |
Delete all the nodes in the list. More... | |
void | copy_nodes (const ACE_Double_Linked_List< ACE_DLList_Node > &rhs) |
Copy nodes from {rhs} into this list. More... | |
void | init_head (void) |
Setup header pointer. Called after we create the head node in ctor. More... | |
int | insert_element (ACE_DLList_Node *new_item, int before=0, ACE_DLList_Node *old_item=0) |
Constant time insert a new item into the list structure. More... | |
int | remove_element (ACE_DLList_Node *item) |
Constant time delete an item from the list structure. More... | |
![]() | |
ACE_DLList_Node * | head_ |
Head of the circular double-linked list. More... | |
size_t | size_ |
Size of this list. More... | |
ACE_Allocator * | allocator_ |
Allocation Strategy of the queue. More... | |
A double-linked list container class.
ACE_DLList is a simple, unbounded container implemented using a double-linked list. It is critical to remember that ACE_DLList inherits from ACE_Double_Linked_List, wrapping each T pointer in a ACE_DLList_Node object which satisfies the next/prev pointer requirements imposed by ACE_Double_Linked_List.
Each item inserted to an ACE_DLList is a pointer to a T object. The caller is responsible for lifetime of the T object. ACE_DLList takes no action on the T object; it is not copied on insertion and it is not deleted on removal from the ACE_DLList.
|
inline |
Constructor.
the_allocator | Allocator to use for allocating ACE_DLList_Node objects that wrap T objects for inclusion in the list. If 0, ACE_Allocator::instance() is used. |
|
inline |
Delegates to ACE_Double_Linked_List.
|
inline |
Deletes all ACE_DLList_Node objects in the list starting from the head. No T objects referred to by the deleted ACE_DLList_Node objects are modified or freed. If you desire all of the T objects in the list to be deleted as well, code such as this should be used prior to destroying the ACE_DLList:
T * ACE_DLList< T >::delete_head | ( | void | ) |
Removes the item at the head of the list and returns its pointer.
T * ACE_DLList< T >::delete_tail | ( | void | ) |
Removes the item at the tail of the list and returns its pointer.
|
inline |
Delegates to ACE_Double_Linked_List.
|
inline |
Provide random access to any item in the list.
item | Receives a pointer to the T object pointer held at the specified position in the list. |
slot | Position in the list to access. The first position is 0. |
0 | Success; T pointer returned in item. |
-1 | Error, most likely slot is outside the range of the list. |
T * ACE_DLList< T >::insert_head | ( | T * | new_item | ) |
Insert pointer for a new item at the head of the list.
T * ACE_DLList< T >::insert_tail | ( | T * | new_item | ) |
Insert pointer for a new item at the tail of the list.
|
inline |
Delegates to ACE_Double_Linked_List.
|
inline |
Delegates to ACE_Double_Linked_List.
|
friend |
|
friend |
|
friend |
|
friend |