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>

Collaboration diagram for ACE_Unbounded_Queue:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Unbounded_Queue_Iterator<
T> 
ITERATOR

Public Methods

 ACE_Unbounded_Queue (ACE_Allocator *alloc = 0)
 construction. Use user specified allocation strategy if specified.

 ACE_Unbounded_Queue (const ACE_Unbounded_Queue<T> &)
 Copy constructor.

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

 ~ACE_Unbounded_Queue (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 enqueue_tail (const T &new_item)
 Adds <new_item> to the tail of the queue. Returns 0 on success, -1 on failure.

int enqueue_head (const T &new_item)
 Adds <new_item> to the head of the queue. Returns 0 on success, -1 on failure.

int dequeue_head (T &item)
 Removes and returns the first <item> on the queue. Returns 0 on success, -1 if the queue was empty.

void reset (void)
 Reset the to be empty and release all its dynamically allocated resources.

int get (T *&item, size_t slot = 0) const
 Get the <slot>th element in the set. Returns -1 if the element isn't in the range {0..<size> - 1}, else 0.

int set (const T &item, size_t slot)
size_t size (void) const
 The number of items in the queue.

void dump (void) const
 Dump the state of an object.

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.


Protected Methods

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

void copy_nodes (const ACE_Unbounded_Queue<T> &)
 Copy nodes into this queue.


Protected Attributes

ACE_Node<T>* head_
 Pointer to the dummy node in the circular linked Queue.

size_t cur_size_
 Current size of the queue.

ACE_Allocatorallocator_
 Allocation Strategy of the queue.


Friends

class  ACE_Unbounded_Queue_Iterator< T >

Detailed Description

template<class T> template class ACE_Unbounded_Queue

A Queue of "infinite" length.

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


Member Typedef Documentation

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


Constructor & Destructor Documentation

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

construction. Use user specified allocation strategy if specified.

template<classT>
ACE_Unbounded_Queue<T>::ACE_Unbounded_Queue<T> ( const ACE_Unbounded_Queue< T >& us )
 

Copy constructor.

template<classT>
ACE_Unbounded_Queue<T>::~ACE_Unbounded_Queue<T> ( void )
 

Destructor.


Member Function Documentation

template<classT>
ACE_Unbounded_Queue_Iterator< T > ACE_Unbounded_Queue< T >::begin ( void )
 

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

Copy nodes into this queue.

template<classT>
void ACE_Unbounded_Queue<T>::delete_nodes ( void ) [protected]
 

Delete all the nodes in the queue.

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

Removes and returns the first <item> on the queue. Returns 0 on success, -1 if the queue was empty.

template<classT>
void ACE_Unbounded_Queue<T>::dump ( void ) const
 

Dump the state of an object.

template<classT>
ACE_Unbounded_Queue_Iterator< T > ACE_Unbounded_Queue< T >::end ( void )
 

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

Adds <new_item> to the head of the queue. Returns 0 on success, -1 on failure.

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

Adds <new_item> to the tail of the queue. Returns 0 on success, -1 on failure.

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

Get the <slot>th element in the set. Returns -1 if the element isn't in the range {0..<size> - 1}, else 0.

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

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

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

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

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

Assignment operator.

template<classT>
void ACE_Unbounded_Queue<T>::reset ( void )
 

Reset the to be empty and release all its dynamically allocated resources.

template<classT>
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<classT>
ACE_INLINE size_t ACE_Unbounded_Queue< T >::size ( void ) const
 

The number of items in the queue.


Friends And Related Function Documentation

template<classT>
class ACE_Unbounded_Queue_Iterator [friend]
 


Member Data Documentation

template<classT>
ACE_Unbounded_Queue<T>::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

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

Allocation Strategy of the queue.

template<classT>
size_t ACE_Unbounded_Queue<T>::cur_size_ [protected]
 

Current size of the queue.

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

Pointer to the dummy node in the circular linked Queue.


The documentation for this class was generated from the following files:
Generated at Wed Nov 21 10:34:35 2001 for ACE by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000