- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Mers::Utils::Containers::ObjectQueue Class Reference

`#include <ObjectQueue.h>`

Inheritance diagram for Mers::Utils::Containers::ObjectQueue:

[legend]
Collaboration diagram for Mers::Utils::Containers::ObjectQueue:

[legend]
List of all members.

## Public Member Functions
| ObjectQueue (bool myOwnershipStatus, int myMaxQueueSize=-1)
virtual | ~ObjectQueue ()
virtual int | enqueue (BaseModelObject *element)
virtual int | dequeue (BaseModelObject *&element)
virtual int | peekQueue (BaseModelObject *&element)
## Protected Member Functions
virtual void | printElement (std::ostream &out, void const *element) const
virtual void | deleteElement (void *element) const
virtual void * | newElement (void const *element) const

## Detailed Description

A dynamic queue of BaseModelObject.

Author:
  Paul H. Elliott

Definition at line 32 of file ObjectQueue.h.

## Constructor & Destructor Documentation

ObjectQueue::ObjectQueue | ( | bool | myOwnershipStatus,
|  | int | myMaxQueueSize = `-1` |
| ) |  |  |

Creates a new, empty queue of BaseModelObject.

Parameters:

  | myOwnershipStatus | the ownership status. If true, this object owns the array objects it contains and should delete them upon being deleted.
  | myMaxQueueSize | a positive value limits the queue to having at most myMaxQueueSize elements. The queue will be resized to hold myMaxQueueSize elements. If a negative value is specified, the queue will grow to fit the number of inserted elements as space permits.

Definition at line 26 of file ObjectQueue.cpp.

ObjectQueue::~ObjectQueue | ( |  | ) | `[virtual]`

Destroys the queue.

Definition at line 34 of file ObjectQueue.cpp.

## Member Function Documentation

int ObjectQueue::enqueue | ( | BaseModelObject * | element | ) | `[virtual]`

Adds the specified element to the end of the queue, adding space as necessary.

Parameters:

  | element | the element being added to the queue.

Returns:
  0 on success or a positive number if the queue could not be resized.

Definition at line 41 of file ObjectQueue.cpp.

References Mers::Utils::Containers::DynamicQueue::enqueue().

Here is the call graph for this function:

int ObjectQueue::dequeue | ( | BaseModelObject *& | element | ) | `[virtual]`

Returns the element at the beginning of the queue and removes it from the queue.

Parameters:

  | element | the first element is returned here

Returns:
  0 on success, a positive number if the queue was empty. This also sets element to NULL.

Definition at line 48 of file ObjectQueue.cpp.

References Mers::Utils::Containers::DynamicQueue::dequeue().

Here is the call graph for this function:

int ObjectQueue::peekQueue | ( | BaseModelObject *& | element | ) | `[virtual]`

Returns the element at the beginning of the queue but does not remove it from the queue.

Parameters:

  | element | the first element is returned here.

Returns:
  0 on success, a positive number if the queue was empty. This also sets element to NULL.

Definition at line 55 of file ObjectQueue.cpp.

References Mers::Utils::Containers::DynamicQueue::peekQueue().

Here is the call graph for this function:

void ObjectQueue::printElement | ( | std::ostream & | out,
|  | void const * | element |
| ) |  |  | const`[protected, virtual]`

Prints the element of this queue to the ostream out. This is called by the DynamicQueue::operator<< for each element being printed Derived classes overide this function to provide proper printing of the elements within the queue.

Parameters:

  | out | the stream being printed to.
  | element | the element being printed.

Implements Mers::Utils::Containers::DynamicArray.

Definition at line 64 of file ObjectQueue.cpp.

References Mers::Utils::Lang::BaseModelObject::BaseModelObject().

Here is the call graph for this function:

void ObjectQueue::deleteElement | ( | void * | element | ) | const`[protected, virtual]`

Called when an element should be deleted because it's storage space is being deleted. This function deletes the element.

Parameters:

  | element | the array entry to delete

Implements Mers::Utils::Containers::DynamicArray.

Definition at line 73 of file ObjectQueue.cpp.

References Mers::Utils::Lang::BaseModelObject::BaseModelObject().

Here is the call graph for this function:

void * ObjectQueue::newElement | ( | void const * | element | ) | const`[protected, virtual]`

Creates and returns a new array object that is a copy of the element passed in.

Parameters:

  | element | the element being copied

Returns:
  the new array object that is a copy of element

Implements Mers::Utils::Containers::DynamicArray.

Definition at line 80 of file ObjectQueue.cpp.

References Mers::Utils::Lang::BaseModelObject::BaseModelObject(), and Mers::Utils::Lang::BaseModelObject::getObjectType().

Here is the call graph for this function:

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

- /Users/fpy/titan-1-5-MBARI/Mers/Utils/Containers/ObjectQueue.h
- /Users/fpy/titan-1-5-MBARI/Mers/Utils/Containers/ObjectQueue.cpp