A queue is a sequence with restricted access. It is an ordered collection of elements with no key and no element equality. The elements are arranged so that each collection has a first and a last element, each element except the last has a next element, and each element but the first has a previous element. The type and value of the elements are irrelevant, and have no effect on the behavior of the collection.
You can only add an element as the last element, and you can only remove the first element. Consequently, The elements of a queue are in chronological order.
You can construct and destruct objects of this class.
![]() |
public:
~IAQueue()
Removes all elements from the collection. Destructors are called for all elements contained in the collection and for elements that have been constructed in advance.
Side Effects
All cursors of the collection become undefined.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
You can construct and destruct objects of this class.
public:
IAQueue(INotifier&)
Use this constructor to create a collection with support for notification.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
protected:
IAQueue(IAQueue < Element > const&)
Constructs a collection.
The collection is unbounded and is initially empty.
Exception
IOutOfMemory
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
protected:
IAQueue()
The default constructor.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to compare a collection with a given collection.
![]() |
public:
long compare( IAQueue < Element > const&, long ( * comparisonFunction ) ( Element const & , Element const & ) ) const
Compares the collection with the given collection.
Comparison yields
<0 if the collection is less than the given collection,
0 if the collection is equal to the given collection, and
>0 if the collection is greater than the given collection.
Comparison is defined by the first pair of
corresponding elements, in both collections, that are not equal.
If such a pair exists, the collection with the greater element
is the greater one.
Otherwise, the collection with more elements
is the greater one.
Return Value
Returns the result of the collection comparison.
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to perform miscellaneous functions.
![]() |
Adds the element to the collection as the last element in sequential order. Sets the cursor to the added element.
Preconditions
Side Effects
All cursors of this collection, except the given cursor, become undefined.
Exceptions
public:
virtual void addAsLast(Element const&, ICursor&)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
virtual void addAsLast(Element const&)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
Copies the first element of the collection to the given element, and removes it from the collection.
Precondition
The collection must not be empty.
Side Effects
All cursors of this collection become undefined.
Exception
IEmptyException
public:
virtual void dequeue()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
virtual void dequeue(Element&)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
Adds the element to the collection, and sets the cursor to the added element. For ordinary queues, the given element is added as the last element. For priority queues, the element is added at a position determined by the ordering relation provided for the element or key type.
Preconditions
Side Effects
All cursors of this collection except the given cursor become undefined.
Exceptions
public:
virtual void enqueue(Element const&, ICursor&)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
virtual void enqueue(Element const&)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual void removeFirst()
Removes the first element from the collection. Element destructors are called as described in IACollection::removeAt.
Precondition
The collection must not be empty.
Side Effects
All cursors of this collection become undefined.
Exception
IEmptyException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
virtual ~IARestrictedAccessCollection()
virtual bool add(Element const&)
virtual bool add(Element const&, ICursor&)
virtual void addAllFrom( IARestrictedAccessCollection < Element > const& )
void adoptStreamer(IACollectionStreamer*)
bool allElementsDo( IBoolean ( * applicatorFunction ) ( Element const&, void * ) , void* additionalArgument = 0 ) const
bool allElementsDo(IConstantApplicator < Element >&) const
Element const& any() const
Element const& anyElement() const
virtual void copy( IARestrictedAccessCollection < Element > const& )
INotifier& disableNotification()
Element const& elementAt(ICursor const&) const
Element const& elementAtPosition(IPosition) const
INotifier& enableNotification(bool = true)
Element const& first() const
Element const& firstElement() const
IARestrictedAccessCollection(INotifier&)
bool isBounded() const
bool isConsistent() const
bool isEmpty() const
bool isEnabledForNotification() const
bool isFirst(ICursor const&) const
bool isFirstAt(ICursor const&) const
bool isFull() const
bool isLast(ICursor const&) const
bool isLastAt(ICursor const&) const
Element const& last() const
Element const& lastElement() const
INumber maxNumberOfElements() const
virtual ICursor* newCursor() const
INotifier const& notifier() const
INotifier& notifier()
INotifier& notifyObservers(INotificationEvent const&)
INumber numberOfElements() const
virtual void operator <<=(IDataStream&)
virtual void operator >>=(IDataStream&)
operator INotifier &() const
IPosition position(ICursor const&) const
IPosition positionAt(ICursor const&) const
virtual INumber removeAll()
bool setToFirst(ICursor&) const
bool setToLast(ICursor&) const
bool setToNext(ICursor&) const
void setToPosition(IPosition, ICursor&) const
bool setToPrevious(ICursor&) const
IARestrictedAccessCollection()
IARestrictedAccessCollection( IARestrictedAccessCollection < Element > const& )
static Implementation& ImplOf( IARestrictedAccessCollection < Element > const& )