WT_FIFO< _ItemType > Class Template Reference

#include <fifo.h>

Inheritance diagram for WT_FIFO< _ItemType >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<class _ItemType>
class WT_FIFO< _ItemType >

A utility class template describing a FIFO queue.

Definition at line 31 of file fifo.h.

Public Member Functions

 WT_FIFO ()
 Constructs a WT_FIFO object.
 WT_FIFO (int initial_size)
 Constructs a WT_FIFO object with given initial queue size.
virtual ~WT_FIFO ()
 Destroys a WT_FIFO object.
int size () const
 Returns the size of the queue.
WT_Result add (int add_size, _ItemType const *add_buffer)
 Adds an array of items to the queue.
void fetch (int fetch_size, int start_item, _ItemType *fetch_buffer) const
 Retrieves an array of items from the queue.
void remove (int remove_size, _ItemType *remove_buffer)
 Removes an array of items from the queue (from the beginning of the queue) and copies them to the array.
void remove (int remove_size)
 Removes an array of items from the queue (from the beginning of the queue.).
void clear_all ()
 Clears the queue.
int pointer_to_index (_ItemType const *ptr) const
 Returns the pseudo-index of the item in the queue.
_ItemType & item (int index) const
 Retrieves the item at the given pseudo-index.
void pop ()
 Removes the LAST item that was placed in the queue.


Member Function Documentation

template<class _ItemType>
WT_Result WT_FIFO< _ItemType >::add int  add_size,
_ItemType const *  add_buffer
 

Adds an array of items to the queue.

Parameters:
add_size  Number of items in the array.
add_buffer  Pointer to the array of items.

Definition at line 132 of file fifo.h.

template<class _ItemType>
void WT_FIFO< _ItemType >::fetch int  fetch_size,
int  start_item,
_ItemType *  fetch_buffer
const
 

Retrieves an array of items from the queue.

Warning:
Client is responsible for ensuring that the queue has at least as many items as are requested.
Parameters:
fetch_size  Number of items to retrieve.
start_item  Index in queue to start retrieval.
fetch_buffer  Destination buffer, receives requested items.

Definition at line 229 of file fifo.h.

template<class _ItemType>
_ItemType & WT_FIFO< _ItemType >::item int  index  )  const
 

Retrieves the item at the given pseudo-index.

The architecture of the queue is a wraparound buffer. This hides the architecture and uses the given index as if the start were always at zero.

Definition at line 316 of file fifo.h.

template<class _ItemType>
int WT_FIFO< _ItemType >::pointer_to_index _ItemType const *  ptr  )  const
 

Returns the pseudo-index of the item in the queue.

The architecture of the queue is a wraparound buffer. This hides the architecture and returns the index relative to the start position as if the start were always at zero.

Warning:
Client is responsible for ensuring the item actually exists in the queue.
Parameters:
ptr  Item to look for.

Definition at line 340 of file fifo.h.

template<class _ItemType>
void WT_FIFO< _ItemType >::remove int  remove_size  ) 
 

Removes an array of items from the queue (from the beginning of the queue.).

Warning:
Client is responsible for ensuring that the queue has at least as many items as are indicated.

Definition at line 277 of file fifo.h.

template<class _ItemType>
void WT_FIFO< _ItemType >::remove int  remove_size,
_ItemType *  remove_buffer
 

Removes an array of items from the queue (from the beginning of the queue) and copies them to the array.

Warning:
Client is responsible for ensuring that the queue has at least as many items as are indicated.
Parameters:
remove_size  Number of items to remove.
remove_buffer  Destination buffer, receives removed items.

Definition at line 268 of file fifo.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 22:41:17 2009 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.5