Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ACE_Unbounded_List< T > Class Template Reference

Implement a simple unordered set of <t> of unbounded size. More...

#include <Naming_Service_Container.h>

Collaboration diagram for ACE_Unbounded_List< T >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Unbounded_List_Iterator<
T > 
ITERATOR
typedef ACE_Unbounded_List_Iterator<
T > 
iterator

Public Member Functions

 ACE_Unbounded_List (ACE_Allocator *alloc=0)
 ACE_Unbounded_List (const ACE_Unbounded_List< T > &)
 Copy constructor.
void operator= (const ACE_Unbounded_List< T > &)
 Assignment operator.
 ~ACE_Unbounded_List (void)
 Destructor.
int is_empty (void) const
 Returns 1 if the container is empty, otherwise returns 0.
int is_full (void) const
 Returns 1 if the container is full, otherwise returns 0.
int insert (const T &new_item)
int remove (const T &item)
size_t size (void) const
 Size of the set.
void dump (void) const
 Dump the state of an object.
void reset (void)
 Reset the <ace_unbounded_list> to be empty.
ACE_Unbounded_List_Iterator<
T > 
begin (void)
ACE_Unbounded_List_Iterator<
T > 
end (void)

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.

Private Member Functions

int insert_tail (const T &item)
void delete_nodes (void)
 Delete all the nodes in the List.
void copy_nodes (const ACE_Unbounded_List< T > &)
 Copy nodes into this set.

Private Attributes

ACE_NS_Node< T > * head_
 Head of the linked list of NS_Nodes.
size_t cur_size_
 Current size of the set.
ACE_Allocatorallocator_
 Allocation strategy of the set.

Friends

class ACE_Unbounded_List_Iterator<T>

Detailed Description

template<class T>
class ACE_Unbounded_List< T >

Implement a simple unordered set of <t> of unbounded size.

This implementation of an unordered set uses a circular linked list with a dummy node. This implementation does not allow duplicates, but it maintains FIFO ordering of insertions.


Member Typedef Documentation

template<class T>
typedef ACE_Unbounded_List_Iterator<T> ACE_Unbounded_List< T >::iterator
 

template<class T>
typedef ACE_Unbounded_List_Iterator<T> ACE_Unbounded_List< T >::ITERATOR
 


Constructor & Destructor Documentation

template<class T>
ACE_Unbounded_List< T >::ACE_Unbounded_List ACE_Allocator alloc = 0  ) 
 

Constructor. Use user specified allocation strategy if specified.

template<class T>
ACE_Unbounded_List< T >::ACE_Unbounded_List const ACE_Unbounded_List< T > &   ) 
 

Copy constructor.

template<class T>
ACE_Unbounded_List< T >::~ACE_Unbounded_List void   ) 
 

Destructor.


Member Function Documentation

template<class T>
ACE_Unbounded_List_Iterator< T > ACE_Unbounded_List< T >::begin void   ) 
 

template<class T>
void ACE_Unbounded_List< T >::copy_nodes const ACE_Unbounded_List< T > &   )  [private]
 

Copy nodes into this set.

template<class T>
void ACE_Unbounded_List< T >::delete_nodes void   )  [private]
 

Delete all the nodes in the List.

template<class T>
void ACE_Unbounded_List< T >::dump void   )  const
 

Dump the state of an object.

template<class T>
ACE_Unbounded_List_Iterator< T > ACE_Unbounded_List< T >::end void   ) 
 

template<class T>
int ACE_Unbounded_List< T >::insert const T &  new_item  ) 
 

Insert <new_item> into the set (doesn't allow duplicates). Returns -1 if failures occur, 1 if item is already present, else 0.

template<class T>
int ACE_Unbounded_List< T >::insert_tail const T &  item  )  [private]
 

Insert <item> at the tail of the set (doesn't check for duplicates).

template<class T>
int ACE_Unbounded_List< T >::is_empty void   )  const
 

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

template<class T>
int ACE_Unbounded_List< T >::is_full void   )  const
 

Returns 1 if the container is full, otherwise returns 0.

template<class T>
void ACE_Unbounded_List< T >::operator= const ACE_Unbounded_List< T > &   ) 
 

Assignment operator.

template<class T>
int ACE_Unbounded_List< T >::remove const T &  item  ) 
 

Remove first occurrence of <item> from the set. Returns 0 if it removes the item, -1 if it can't find the item, and -1 if a failure occurs.

template<class T>
void ACE_Unbounded_List< T >::reset void   ) 
 

Reset the <ace_unbounded_list> to be empty.

template<class T>
size_t ACE_Unbounded_List< T >::size void   )  const
 

Size of the set.


Friends And Related Function Documentation

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


Member Data Documentation

template<class T>
ACE_Unbounded_List< T >::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

template<class T>
ACE_Allocator* ACE_Unbounded_List< T >::allocator_ [private]
 

Allocation strategy of the set.

template<class T>
size_t ACE_Unbounded_List< T >::cur_size_ [private]
 

Current size of the set.

template<class T>
ACE_NS_Node<T>* ACE_Unbounded_List< T >::head_ [private]
 

Head of the linked list of NS_Nodes.


The documentation for this class was generated from the following files:
Generated on Thu Jun 9 00:43:55 2005 for TAO_CosNaming by  doxygen 1.3.9.1