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

# ACE_Unbounded_Queue Class Template Reference

A Queue of "infinite" length. More...

`#include <Unbounded_Queue.h>`

Inheritance diagram for ACE_Unbounded_Queue:

[legend]
Collaboration diagram for ACE_Unbounded_Queue:

[legend]
List of all members.

## Public Types
typedef ACE_Unbounded_Queue_Iterator< T > | ITERATOR
typedef ACE_Unbounded_Queue_Const_Iterator< T > | CONST_ITERATOR
## Public Methods
| ACE_Unbounded_Queue (ACE_Allocator *alloc=0)
| Initialize an empty queue using the strategy provided. More...
| ACE_Unbounded_Queue (const ACE_Unbounded_Queue< T > &)
| Initialize the queue to be a copy of the provided queue. More...
void | operator= (const ACE_Unbounded_Queue< T > &)
| Perform a deep copy of rhs. More...
| ~ACE_Unbounded_Queue (void)
| Clean up the memory for the queue. More...
int | is_empty (void) const
| Constant time check to see if the queue is empty. More...
int | is_full (void) const
| The queue cannot be full, so it always returns 0. More...
int | enqueue_tail (const T &new_item)
| Insert an item at the end of the queue. More...
int | enqueue_head (const T &new_item)
| Insert an item at the head of the queue. More...
int | dequeue_head (T &item)
| Remove an item from the head of the queue. More...
void | reset (void)
| Delete the queue nodes. More...
int | get (T *&item, size_t slot=0) const
| Find the item in the queue between 0 and the provided index of the queue. More...
int | set (const T &item, size_t slot)
| Set the <slot>th element in the set. More...
size_t | size (void) const
| Return the size of the queue. More...
void | dump (void) const
| Dump the state of an object. More...
ACE_Unbounded_Queue_Iterator< T > | begin (void)
ACE_Unbounded_Queue_Iterator< T > | end (void)
## Public Attributes
| ACE_ALLOC_HOOK_DECLARE
| Declare the dynamic allocation hooks. More...
## Protected Methods
void | delete_nodes (void)
| Delete all the nodes in the queue. More...
void | copy_nodes (const ACE_Unbounded_Queue< T > &)
| Copy nodes into this queue. More...
## Protected Attributes
ACE_Node< T > * | head_
| Pointer to the dummy node in the circular linked Queue. More...
size_t | cur_size_
| Current size of the queue. More...
ACE_Allocator * | allocator_
| Allocation Strategy of the queue. More...
## Friends
class | ACE_Unbounded_Queue_Iterator< T >
class | ACE_Unbounded_Queue_Const_Iterator< T >

## Detailed Description

### template<class T>
class ACE_Unbounded_Queue< T >

A Queue of "infinite" length.

This implementation of an unbounded queue uses a circular linked list with a dummy node.

Requirements and Performance Characteristics

- Internal Structure Circular linked list
- Duplicates allowed? Yes
- Random access allowed? No
- Search speed N/A
- Insert/replace speed N/A
- Iterator still valid after change to container? Yes
- Frees memory for removed elements? Yes
- Items inserted by Value
- Requirements for contained type
  1. Default constructor
  2. Copy constructor
  3. operator=

## Member Typedef Documentation

template<class T>
typedef ACE_Unbounded_Queue_Const_Iterator<T> ACE_Unbounded_Queue::CONST_ITERATOR

template<class T>
typedef ACE_Unbounded_Queue_Iterator<T> ACE_Unbounded_Queue::ITERATOR

## Constructor & Destructor Documentation

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

| Initialize an empty queue using the strategy provided.

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

| Initialize the queue to be a copy of the provided queue.

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

| Clean up the memory for the queue.

## Member Function Documentation

template<class T>
ACE_Unbounded_Queue_Iterator< T > ACE_Unbounded_Queue< T >::begin | ( | void |  | ) |

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

| Copy nodes into this queue.

template<class T>
void ACE_Unbounded_Queue< T >::delete_nodes | ( | void |  | ) | `[protected]`

| Delete all the nodes in the queue.

template<class T>
int ACE_Unbounded_Queue< T >::dequeue_head | ( | T & | item | ) |

| Remove an item from the head of the queue.

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

| Dump the state of an object.

template<class T>
ACE_Unbounded_Queue_Iterator< T > ACE_Unbounded_Queue< T >::end | ( | void |  | ) |

template<class T>
int ACE_Unbounded_Queue< T >::enqueue_head | ( | const T & | new_item | ) |

| Insert an item at the head of the queue.

template<class T>
int ACE_Unbounded_Queue< T >::enqueue_tail | ( | const T & | new_item | ) |

| Insert an item at the end of the queue.

template<class T>
int ACE_Unbounded_Queue< T >::get | ( | T *& | item,
|  | size_t | slot = 0
| ) | const

| Find the item in the queue between 0 and the provided index of the queue.

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

| Constant time check to see if the queue is empty.

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

| The queue cannot be full, so it always returns 0.

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

| Perform a deep copy of rhs.

template<class T>
void ACE_Unbounded_Queue< T >::reset | ( | void |  | ) |

| Delete the queue nodes.

template<class T>
int ACE_Unbounded_Queue< T >::set | ( | const T & | item,
|  | size_t | slot
| ) |

| Set the <slot>th element in the set. Will pad out the set with empty nodes if <slot> is beyond the range {0..<size> - 1}. Returns -1 on failure, 0 if <slot> isn't initially in range, and 0 otherwise.

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

| Return the size of the queue.

## Friends And Related Function Documentation

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

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

## Member Data Documentation

template<class T>
ACE_Unbounded_Queue::ACE_ALLOC_HOOK_DECLARE

| Declare the dynamic allocation hooks.

template<class T>
ACE_Allocator* ACE_Unbounded_Queue::allocator_`[protected]`

| Allocation Strategy of the queue.

template<class T>
size_t ACE_Unbounded_Queue::cur_size_`[protected]`

| Current size of the queue.

template<class T>
ACE_Node<T>* ACE_Unbounded_Queue::head_`[protected]`

| Pointer to the dummy node in the circular linked Queue.

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

- Unbounded_Queue.h
- Unbounded_Queue.cpp
- Unbounded_Queue.inl