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

# ACE_Unbounded_Set Class Template Reference

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

`#include <Unbounded_Set.h>`

Inheritance diagram for ACE_Unbounded_Set:

[legend]
Collaboration diagram for ACE_Unbounded_Set:

[legend]
List of all members.

## Public Types
typedef ACE_Unbounded_Set_Iterator< T > | ITERATOR
typedef ACE_Unbounded_Set_Iterator< T > | iterator
typedef ACE_Unbounded_Set_Const_Iterator< T > | CONST_ITERATOR
typedef ACE_Unbounded_Set_Const_Iterator< T > | const_iterator
## Public Methods
| ACE_Unbounded_Set (ACE_Allocator *alloc=0)
| Constructor. Use user specified allocation strategy if specified. More...
| ACE_Unbounded_Set (const ACE_Unbounded_Set< T > &)
| Copy constructor. More...
void | operator= (const ACE_Unbounded_Set< T > &)
| Assignment operator. More...
| ~ACE_Unbounded_Set (void)
| Destructor. More...
int | is_empty (void) const
| Returns 1 if the container is empty, otherwise returns 0. More...
int | is_full (void) const
| Returns 1 if the container is full, otherwise returns 0. More...
int | insert (const T &new_item)
int | insert_tail (const T &item)
| Insert <item> at the tail of the set (doesn't check for duplicates). More...
int | remove (const T &item)
int | find (const T &item) const
| Finds if <item> occurs in the set. Returns 0 if find succeeds, else -1. More...
size_t | size (void) const
| Size of the set. More...
void | dump (void) const
| Dump the state of an object. More...
void | reset (void)
| Reset the <ACE_Unbounded_Set> to be empty. More...
ACE_Unbounded_Set_Iterator< T > | begin (void)
ACE_Unbounded_Set_Iterator< T > | end (void)
## Public Attributes
| ACE_ALLOC_HOOK_DECLARE
| Declare the dynamic allocation hooks. More...
## Private Methods
void | delete_nodes (void)
| Delete all the nodes in the Set. More...
void | copy_nodes (const ACE_Unbounded_Set< T > &)
| Copy nodes into this set. More...
## Private Attributes
ACE_Node< T > * | head_
| Head of the linked list of Nodes. More...
size_t | cur_size_
| Current size of the set. More...
ACE_Allocator * | allocator_
| Allocation strategy of the set. More...
## Friends
class | ACE_Unbounded_Set_Iterator< T >
class | ACE_Unbounded_Set_Const_Iterator< T >

## Detailed Description

### template<class T>
class ACE_Unbounded_Set< 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_Set_Const_Iterator<T> ACE_Unbounded_Set::const_iterator

template<class T>
typedef ACE_Unbounded_Set_Const_Iterator<T> ACE_Unbounded_Set::CONST_ITERATOR

template<class T>
typedef ACE_Unbounded_Set_Iterator<T> ACE_Unbounded_Set::iterator

template<class T>
typedef ACE_Unbounded_Set_Iterator<T> ACE_Unbounded_Set::ITERATOR

## Constructor & Destructor Documentation

template<class T>
ACE_Unbounded_Set< T >::ACE_Unbounded_Set | ( | ACE_Allocator * | alloc = 0 | ) |

| Constructor. Use user specified allocation strategy if specified.

template<class T>
ACE_Unbounded_Set< T >::ACE_Unbounded_Set | ( | const ACE_Unbounded_Set< T > & | us | ) |

| Copy constructor.

template<class T>
ACE_Unbounded_Set< T >::~ACE_Unbounded_Set | ( | void |  | ) |

| Destructor.

## Member Function Documentation

template<class T>
ACE_Unbounded_Set_Iterator< T > ACE_Unbounded_Set< T >::begin | ( | void |  | ) |

template<class T>
void ACE_Unbounded_Set< T >::copy_nodes | ( | const ACE_Unbounded_Set< T > & | us | ) | `[private]`

| Copy nodes into this set.

template<class T>
void ACE_Unbounded_Set< T >::delete_nodes | ( | void |  | ) | `[private]`

| Delete all the nodes in the Set.

template<class T>
void ACE_Unbounded_Set< T >::dump | ( | void |  | ) | const

| Dump the state of an object.

template<class T>
ACE_Unbounded_Set_Iterator< T > ACE_Unbounded_Set< T >::end | ( | void |  | ) |

template<class T>
int ACE_Unbounded_Set< T >::find | ( | const T & | item | ) | const

| Finds if <item> occurs in the set. Returns 0 if find succeeds, else -1.

template<class T>
int ACE_Unbounded_Set< T >::insert | ( | const T & | 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< T >::insert_tail | ( | const T & | item | ) |

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

template<class T>
ACE_INLINE int ACE_Unbounded_Set< T >::is_empty | ( | void |  | ) | const

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

template<class T>
ACE_INLINE int ACE_Unbounded_Set< T >::is_full | ( | void |  | ) | const

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

template<class T>
void ACE_Unbounded_Set< T >::operator= | ( | const ACE_Unbounded_Set< T > & | us | ) |

| Assignment operator.

template<class T>
int ACE_Unbounded_Set< 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_Set< T >::reset | ( | void |  | ) |

| Reset the <ACE_Unbounded_Set> to be empty.

template<class T>
size_t ACE_Unbounded_Set< T >::size | ( | void |  | ) | const

| Size of the set.

## Friends And Related Function Documentation

template<class T>
friend class ACE_Unbounded_Set_Const_Iterator< T >`[friend]`

template<class T>
friend class ACE_Unbounded_Set_Iterator< T >`[friend]`

## Member Data Documentation

template<class T>
ACE_Unbounded_Set::ACE_ALLOC_HOOK_DECLARE

| Declare the dynamic allocation hooks.

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

| Allocation strategy of the set.

template<class T>
size_t ACE_Unbounded_Set::cur_size_`[private]`

| Current size of the set.

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

| Head of the linked list of Nodes.

The documentation for this class was generated from the following files:

- Unbounded_Set.h
- Unbounded_Set.cpp
- Unbounded_Set.inl