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

ACE_Unbounded_Set_Ex< T > Class Template Reference

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

#include <Unbounded_Set_Ex.h>

Collaboration diagram for ACE_Unbounded_Set_Ex< T >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Unbounded_Set_Ex_Iterator<
T > 
ITERATOR
typedef ACE_Unbounded_Set_Ex_Iterator<
T > 
iterator
typedef ACE_Unbounded_Set_Ex_Const_Iterator<
T > 
CONST_ITERATOR
typedef ACE_Unbounded_Set_Ex_Const_Iterator<
T > 
const_iterator

Public Methods

 ACE_Unbounded_Set_Ex (ACE_Allocator *alloc=0)
 ACE_Unbounded_Set_Ex (const ACE_Unbounded_Set_Ex< T > &)
 Copy constructor.

void operator= (const ACE_Unbounded_Set_Ex< T > &)
 Assignment operator.

 ~ACE_Unbounded_Set_Ex (void)
 Destructor.

int is_empty (void) const
 Returns 1 if the container is empty, otherwise returns 0.

int is_full (void) const
 Returns 0.

int insert (const T &new_item)
 Linear insertion of an item.

int insert_tail (const T &item)
int remove (const T &item)
 Linear remove operation.

int find (const T &item) const
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_Set_Ex> to be empty.

ACE_Unbounded_Set_Ex_Iterator<
T > 
begin (void)
ACE_Unbounded_Set_Ex_Iterator<
T > 
end (void)
void iterator_add () const
 An Iterator has to register itself here.

void iterator_leave ()
 A non-const Iterator has to unregister itself here.

void const_iterator_leave () const
 A Const_Iterator has to unregister itself here.


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Private Methods

void delete_nodes (void)
 Delete all the nodes in the Set.

void copy_nodes (const ACE_Unbounded_Set_Ex< T > &)
 Copy nodes into this set.

void cleanup ()
 Really delete all nodes marked for deletion.


Private Attributes

ACE_Node< T > * head_
 Head of the linked list of Nodes.

size_t cur_size_
 Current size of the set.

ACE_Allocatorallocator_
 Allocation strategy of the set.

int number_of_iterators_
 Number of iterators working on this set.


Friends

class ACE_Unbounded_Set_Ex_Iterator< T >
class ACE_Unbounded_Set_Ex_Const_Iterator< T >

Detailed Description

template<class T>
class ACE_Unbounded_Set_Ex< 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.

Requirements and Performance Characteristics


Member Typedef Documentation

template<class T>
typedef ACE_Unbounded_Set_Ex_Const_Iterator<T> ACE_Unbounded_Set_Ex< T >::const_iterator
 

template<class T>
typedef ACE_Unbounded_Set_Ex_Const_Iterator<T> ACE_Unbounded_Set_Ex< T >::CONST_ITERATOR
 

template<class T>
typedef ACE_Unbounded_Set_Ex_Iterator<T> ACE_Unbounded_Set_Ex< T >::iterator
 

template<class T>
typedef ACE_Unbounded_Set_Ex_Iterator<T> ACE_Unbounded_Set_Ex< T >::ITERATOR
 


Constructor & Destructor Documentation

template<class T>
ACE_Unbounded_Set_Ex< T >::ACE_Unbounded_Set_Ex ACE_Allocator   alloc = 0
 

Initialize an empty set using the allocation strategy of the user if provided.

template<class T>
ACE_Unbounded_Set_Ex< T >::ACE_Unbounded_Set_Ex const ACE_Unbounded_Set_Ex< T > &   
 

Copy constructor.

Initialize this set to be an exact copy of the set provided.

template<class T>
ACE_Unbounded_Set_Ex< T >::~ACE_Unbounded_Set_Ex void   
 

Destructor.

Destroy the nodes of the set.


Member Function Documentation

template<class T>
ACE_Unbounded_Set_Ex_Iterator< T > ACE_Unbounded_Set_Ex< T >::begin void   
 

template<class T>
void ACE_Unbounded_Set_Ex< T >::cleanup   [private]
 

Really delete all nodes marked for deletion.

template<class T>
void ACE_Unbounded_Set_Ex< T >::const_iterator_leave  
 

A Const_Iterator has to unregister itself here.

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

Copy nodes into this set.

template<class T>
void ACE_Unbounded_Set_Ex< T >::delete_nodes void    [private]
 

Delete all the nodes in the Set.

template<class T>
void ACE_Unbounded_Set_Ex< T >::dump void    const
 

Dump the state of an object.

template<class T>
ACE_Unbounded_Set_Ex_Iterator< T > ACE_Unbounded_Set_Ex< T >::end void   
 

template<class T>
int ACE_Unbounded_Set_Ex< T >::find const T &    item const
 

Performs a linear find operation.

template<class T>
int ACE_Unbounded_Set_Ex< T >::insert const T &    new_item
 

Linear insertion of an 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_Set_Ex< T >::insert_tail const T &    item
 

Constant time insert at the end of the set.

template<class T>
ACE_INLINE int ACE_Unbounded_Set_Ex< T >::is_empty void    const
 

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

Constant time is_empty check.

template<class T>
ACE_INLINE int ACE_Unbounded_Set_Ex< T >::is_full void    const
 

Returns 0.

Always returns 0 since the set can never fill up.

template<class T>
void ACE_Unbounded_Set_Ex< T >::iterator_add  
 

An Iterator has to register itself here.

template<class T>
void ACE_Unbounded_Set_Ex< T >::iterator_leave  
 

A non-const Iterator has to unregister itself here.

template<class T>
void ACE_Unbounded_Set_Ex< T >::operator= const ACE_Unbounded_Set_Ex< T > &   
 

Assignment operator.

Perform a deep copy of the rhs into the lhs.

template<class T>
int ACE_Unbounded_Set_Ex< T >::remove const T &    item
 

Linear remove operation.

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_Set_Ex< T >::reset void   
 

Reset the <ACE_Unbounded_Set_Ex> to be empty.

Delete the nodes of the set.

template<class T>
size_t ACE_Unbounded_Set_Ex< T >::size void    const
 

Size of the set.

Access the size of the set.


Friends And Related Function Documentation

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

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


Member Data Documentation

template<class T>
ACE_Unbounded_Set_Ex< T >::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

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

Allocation strategy of the set.

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

Current size of the set.

template<class T>
ACE_Node<T>* ACE_Unbounded_Set_Ex< T >::head_ [private]
 

Head of the linked list of Nodes.

template<class T>
int ACE_Unbounded_Set_Ex< T >::number_of_iterators_ [private]
 

Number of iterators working on this set.


The documentation for this class was generated from the following files:
Generated on Fri Apr 2 16:55:21 2004 for ACE by doxygen1.2.18