#include <Unbounded_Queue.h>
Collaboration diagram for ACE_Unbounded_Queue< T >:
Public Types | |
typedef ACE_Unbounded_Queue_Iterator< T > | ITERATOR |
typedef ACE_Unbounded_Queue_Const_Iterator< T > | CONST_ITERATOR |
Public Member Functions | |
ACE_Unbounded_Queue (ACE_Allocator *alloc=0) | |
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 0. | |
int | enqueue_tail (const T &new_item) |
int | enqueue_head (const T &new_item) |
int | dequeue_head (T &item) |
void | reset (void) |
int | get (T *&item, size_t slot=0) const |
int | set (const T &item, size_t slot) |
Set the slot th element of the queue to item. | |
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 Member Functions | |
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_Allocator * | allocator_ |
Allocation Strategy of the queue. | |
Friends | |
class | ACE_Unbounded_Queue_Iterator< T > |
class | ACE_Unbounded_Queue_Const_Iterator< T > |
This implementation of an unbounded queue uses a circular linked list with a dummy node.
Requirements and Performance Characteristics
typedef ACE_Unbounded_Queue_Const_Iterator<T> ACE_Unbounded_Queue< T >::CONST_ITERATOR |
typedef ACE_Unbounded_Queue_Iterator<T> ACE_Unbounded_Queue< T >::ITERATOR |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Unbounded_Queue< T >::ACE_Unbounded_Queue | ( | ACE_Allocator * | alloc = 0 |
) |
Initialize an empty queue using the strategy provided.
ACE_Unbounded_Queue< T >::ACE_Unbounded_Queue | ( | const ACE_Unbounded_Queue< T > & | ) |
Copy constructor.
Initialize the queue to be a copy of the provided queue.
ACE_Unbounded_Queue< T >::~ACE_Unbounded_Queue | ( | void | ) |
Destructor.
Clean up the memory for the queue.
ACE_Unbounded_Queue_Iterator< T > ACE_Unbounded_Queue< T >::begin | ( | void | ) |
void ACE_Unbounded_Queue< T >::copy_nodes | ( | const ACE_Unbounded_Queue< T > & | ) | [protected] |
Copy nodes into this queue.
void ACE_Unbounded_Queue< T >::delete_nodes | ( | void | ) | [protected] |
Delete all the nodes in the queue.
int ACE_Unbounded_Queue< T >::dequeue_head | ( | T & | item | ) |
Remove an item from the head of the queue.
void ACE_Unbounded_Queue< T >::dump | ( | void | ) | const |
Dump the state of an object.
ACE_Unbounded_Queue_Iterator< T > ACE_Unbounded_Queue< T >::end | ( | void | ) |
int ACE_Unbounded_Queue< T >::enqueue_head | ( | const T & | new_item | ) |
Insert an item at the head of the queue.
int ACE_Unbounded_Queue< T >::enqueue_tail | ( | const T & | new_item | ) |
Insert an item at the end of the queue.
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.
ACE_INLINE int ACE_Unbounded_Queue< T >::is_empty | ( | void | ) | const |
Returns 1 if the container is empty, otherwise returns 0.
Constant time check to see if the queue is empty.
ACE_INLINE int ACE_Unbounded_Queue< T >::is_full | ( | void | ) | const |
Returns 0.
The queue cannot be full, so it always returns 0.
void ACE_Unbounded_Queue< T >::operator= | ( | const ACE_Unbounded_Queue< T > & | ) |
Assignment operator.
Perform a deep copy of rhs.
void ACE_Unbounded_Queue< T >::reset | ( | void | ) |
Delete the queue nodes.
int ACE_Unbounded_Queue< T >::set | ( | const T & | item, | |
size_t | slot | |||
) |
Set the slot th element of the queue to item.
Set the slot th element in the set. Will pad out the set with empty nodes if slot is beyond the range {0..cur_size_ - 1}. Returns -1 on failure, 0 if slot isn't initially in range, and 0 otherwise.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE size_t ACE_Unbounded_Queue< T >::size | ( | void | ) | const |
The number of items in the queue.
Return the size of the queue.
friend class ACE_Unbounded_Queue_Const_Iterator< T > [friend] |
friend class ACE_Unbounded_Queue_Iterator< T > [friend] |
ACE_Unbounded_Queue< T >::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
ACE_Allocator* ACE_Unbounded_Queue< T >::allocator_ [protected] |
Allocation Strategy of the queue.
size_t ACE_Unbounded_Queue< T >::cur_size_ [protected] |
Current size of the queue.
ACE_Node<T>* ACE_Unbounded_Queue< T >::head_ [protected] |
Pointer to the dummy node in the circular linked Queue.