SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
A restricted interface to class RWSlistCollectables in order to implement a first in first out (FIFO) queue. More...
#include <rw/queuecol.h>
Public Member Functions | |
virtual RWCollectable * | newSpecies () const |
virtual RWClassID | isA () const |
RWSlistCollectablesQueue () | |
RWSlistCollectablesQueue (RWCollectable *a) | |
virtual bool | isEqual (const RWCollectable *) const |
virtual RWCollectable * | remove (const RWCollectable *) |
Static Public Member Functions | |
static RWClassID | classIsA () |
Private Member Functions | |
RWCollectable * | prepend (RWCollectable *) |
RWCollectable * | removeReference (const RWCollectable *) |
virtual void | removeAndDestroy (const RWCollectable *) |
Class RWSlistCollectablesQueue represents a restricted interface to class RWSlistCollectables to implement a first in first out (FIFO) queue. A queue is a sequential list for which all insertions are made at one end (the "tail"), and all removals are made at the other end (the "head"). Hence, the ordering is determined externally by the ordering of the insertions. Duplicates are allowed.
An object stored by RWSlistCollectablesQueue must inherit from abstract base class RWCollectable. You must use the virtual function isEqual() (see class RWCollectable) to find a match between a target and an item in the queue.
This class corresponds to the Smalltalk class Queue.
// Smalltalk typedef: typedef RWSlistCollectablesQueue Queue ; #include <rw/queuecol.h> RWSlistCollectablesQueue a;
Polymorphic
RWSlistCollectablesQueue::RWSlistCollectablesQueue | ( | ) |
Constructs an empty queue.
RWSlistCollectablesQueue::RWSlistCollectablesQueue | ( | RWCollectable * | a | ) | [inline] |
Constructs a queue with single item a.
static RWClassID RWSlistCollectablesQueue::classIsA | ( | ) | [static] |
Returns the RWClassID of this class.
Reimplemented from RWSlistCollectables.
virtual RWClassID RWSlistCollectablesQueue::isA | ( | ) | const [virtual] |
Returns __RWSLISTCOLLECTABLESQUEUE
, i.e. a class identifier, that identifies this object's class.
Reimplemented from RWSlistCollectables.
virtual bool RWSlistCollectablesQueue::isEqual | ( | const RWCollectable * | t | ) | const [virtual] |
Returns true
if the collectable object "matches" the object at address t. The default definition is:
return this == t;
i.e., both objects have the same address (a test for identity). The definition may be redefined in any consistent way.
Reimplemented from RWSlistCollectables.
virtual RWCollectable* RWSlistCollectablesQueue::newSpecies | ( | ) | const [virtual] |
Allocates a new object off the heap of the same type as self and returns a pointer to it. You are responsible for deleting the object when done with it.
Reimplemented from RWSlistCollectables.
RWCollectable* RWSlistCollectablesQueue::prepend | ( | RWCollectable * | c | ) | [inline, private, virtual] |
Adds c to the beginning of the collection and returns it. Returns rwnil if the insertion was unsuccessful.
Reimplemented from RWSlistCollectables.
virtual RWCollectable* RWSlistCollectablesQueue::remove | ( | const RWCollectable * | ) | [inline, virtual] |
Calls get(). The argument is ignored.
Reimplemented from RWSlistCollectables.
virtual void RWSlistCollectablesQueue::removeAndDestroy | ( | const RWCollectable * | target | ) | [inline, private, virtual] |
Removes and deletes the first item in the collection which "matches" the object pointed to by target.
Reimplemented from RWCollection.
RWCollectable* RWSlistCollectablesQueue::removeReference | ( | const RWCollectable * | e | ) | [inline, private] |
Removes and returns the first item that is identical to the item pointed to by e (that is, that has the address e). Returns rwnil if there is no such item.
Reimplemented from RWSlistCollectables.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.