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

ACE_DLList Class Template Reference

A double-linked list container class. More...

#include <Containers_T.h>

Inheritance diagram for ACE_DLList:

Inheritance graph
[legend]
Collaboration diagram for ACE_DLList:

Collaboration graph
[legend]
List of all members.

Public Methods

void operator= (const ACE_DLList< T > &l)
 Delegates to ACE_Double_Linked_List. More...

T * insert_tail (T *new_item)
 Delegates to ACE_Double_Linked_List. More...

T * insert_head (T *new_item)
 Delegates to ACE_Double_Linked_List. More...

T * delete_head (void)
 Delegates to ACE_Double_Linked_List. More...

T * delete_tail (void)
 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 *alloc=0)
 Delegates to ACE_Double_Linked_List. More...

 ACE_DLList (const ACE_DLList< T > &l)
 Delegates to ACE_Double_Linked_List. More...

 ~ACE_DLList (void)
 Deletes the list starting from the head. More...


Friends

class ACE_DLList_Node
class ACE_Double_Linked_List_Iterator< T >
class ACE_DLList_Iterator< T >
class ACE_DLList_Reverse_Iterator< T >

Detailed Description

template<class T>
class ACE_DLList< T >

A double-linked list container class.

This implementation uses ACE_Double_Linked_List to perform the logic behind this container class. It delegates all of its calls to ACE_Double_Linked_List.

Definition at line 1023 of file Containers_T.h.


Constructor & Destructor Documentation

template<class T>
ACE_INLINE ACE_DLList< T >::ACE_DLList ACE_Allocator   alloc = 0
 

Delegates to ACE_Double_Linked_List.

Definition at line 351 of file Containers_T.i.

00352   : ACE_DLList_Base (alloc)
00353 {
00354 }

template<class T>
ACE_INLINE ACE_DLList< T >::ACE_DLList const ACE_DLList< T > &    l
 

Delegates to ACE_Double_Linked_List.

Definition at line 357 of file Containers_T.i.

00358   : ACE_DLList_Base ((ACE_DLList<T> &) l)
00359 {
00360 }

template<class T>
ACE_INLINE ACE_DLList< T >::~ACE_DLList void   
 

Deletes the list starting from the head.

Definition at line 363 of file Containers_T.i.

References delete_head.

00364 {
00365   while (this->delete_head ()) ;
00366 }


Member Function Documentation

template<class T>
T * ACE_DLList< T >::delete_head void   
 

Delegates to ACE_Double_Linked_List.

Reimplemented from ACE_Double_Linked_List< ACE_DLList_Node >.

Definition at line 1834 of file Containers_T.cpp.

References ACE_DES_FREE, ACE_Double_Linked_List< ACE_DLList_Node >::delete_head, and ACE_DLList_Node::item_.

Referenced by ~ACE_DLList.

01835 {
01836   ACE_DLList_Node *temp1 = ACE_DLList_Base::delete_head ();
01837   T *temp2 = (T *) (temp1 ? temp1->item_ : 0);
01838   ACE_DES_FREE (temp1,
01839                 this->allocator_->free,
01840                 ACE_DLList_Node);
01841 
01842   return temp2;
01843 }

template<class T>
T * ACE_DLList< T >::delete_tail void   
 

Delegates to ACE_Double_Linked_List.

Reimplemented from ACE_Double_Linked_List< ACE_DLList_Node >.

Definition at line 1846 of file Containers_T.cpp.

References ACE_DES_FREE, ACE_Double_Linked_List< ACE_DLList_Node >::delete_tail, and ACE_DLList_Node::item_.

01847 {
01848   ACE_DLList_Node *temp1 = ACE_DLList_Base::delete_tail ();
01849   T *temp2 = (T *) (temp1 ? temp1->item_ : 0);
01850   ACE_DES_FREE (temp1,
01851                 this->allocator_->free,
01852                 ACE_DLList_Node);
01853   return temp2;
01854 }

template<class T>
ACE_INLINE void ACE_DLList< T >::dump void    const
 

Delegates to ACE_Double_Linked_List.

Reimplemented from ACE_Double_Linked_List< ACE_DLList_Node >.

Definition at line 335 of file Containers_T.i.

References ACE_Double_Linked_List< ACE_DLList_Node >::dump.

00336 {
00337   ACE_DLList_Base::dump ();
00338 }

template<class T>
ACE_INLINE int ACE_DLList< T >::get T *&    item,
size_t    slot = 0
 

Delegates to <ACE_Double_Linked_List>, but where <ACE_Double_Linked_List> returns the node as the item, this get returns the contents of the node in item.

Definition at line 325 of file Containers_T.i.

References ACE_Double_Linked_List< ACE_DLList_Node >::get, and ACE_DLList_Node::item_.

00326 {
00327   ACE_DLList_Node *node;
00328   int result = ACE_DLList_Base::get (node, index);
00329   if (result != -1)
00330     item = (T *) node->item_;
00331   return result;
00332 }

template<class T>
T * ACE_DLList< T >::insert_head T *    new_item
 

Delegates to ACE_Double_Linked_List.

Definition at line 1822 of file Containers_T.cpp.

References ACE_DLList_Node, ACE_NEW_MALLOC_RETURN, ACE_Double_Linked_List< ACE_DLList_Node >::insert_head, and ACE_DLList_Node::item_.

01823 {
01824   ACE_DLList_Node *temp1;
01825   ACE_NEW_MALLOC_RETURN (temp1,
01826                          (ACE_DLList_Node *) this->allocator_->malloc (sizeof (ACE_DLList_Node)),
01827                          ACE_DLList_Node ((void *&)new_item), 0);
01828   ACE_DLList_Node *temp2 =
01829     ACE_DLList_Base::insert_head (temp1);
01830   return (T *) (temp2 ? temp2->item_ : 0);
01831 }

template<class T>
T * ACE_DLList< T >::insert_tail T *    new_item
 

Delegates to ACE_Double_Linked_List.

Definition at line 1809 of file Containers_T.cpp.

References ACE_DLList_Node, ACE_NEW_MALLOC_RETURN, ACE_Double_Linked_List< ACE_DLList_Node >::insert_tail, and ACE_DLList_Node::item_.

01810 {
01811   ACE_DLList_Node *temp1, *temp2;
01812   ACE_NEW_MALLOC_RETURN (temp1,
01813                          ACE_static_cast(ACE_DLList_Node *,
01814                                          this->allocator_->malloc (sizeof (ACE_DLList_Node))),
01815                          ACE_DLList_Node ((void *&)new_item),
01816                          0);
01817   temp2 = ACE_DLList_Base::insert_tail (temp1);
01818   return (T *) (temp2 ? temp2->item_ : 0);
01819 }

template<class T>
ACE_INLINE void ACE_DLList< T >::operator= const ACE_DLList< T > &    l
 

Delegates to ACE_Double_Linked_List.

Definition at line 319 of file Containers_T.i.

00320 {
00321   *(ACE_DLList_Base *) this = l;
00322 }

template<class T>
ACE_INLINE int ACE_DLList< T >::remove ACE_DLList_Node   n
 

Delegates to ACE_Double_Linked_List.

Reimplemented from ACE_Double_Linked_List< ACE_DLList_Node >.

Definition at line 341 of file Containers_T.i.

References ACE_DES_FREE, and ACE_Double_Linked_List< ACE_DLList_Node >::remove.

00342 {
00343   int result = ACE_DLList_Base::remove (n);
00344   ACE_DES_FREE (n,
00345                 this->allocator_->free,
00346                 ACE_DLList_Node);
00347   return result;
00348 }


Friends And Related Function Documentation

template<class T>
friend class ACE_DLList_Iterator< T > [friend]
 

Definition at line 1027 of file Containers_T.h.

template<class T>
friend class ACE_DLList_Node [friend]
 

Definition at line 1025 of file Containers_T.h.

Referenced by insert_head, and insert_tail.

template<class T>
friend class ACE_DLList_Reverse_Iterator< T > [friend]
 

Definition at line 1028 of file Containers_T.h.

template<class T>
friend class ACE_Double_Linked_List_Iterator< T > [friend]
 

Reimplemented from ACE_Double_Linked_List< ACE_DLList_Node >.

Definition at line 1026 of file Containers_T.h.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:47:19 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002