SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Private Member Functions
RWSlistCollectablesQueue Class Reference

A restricted interface to class RWSlistCollectables in order to implement a first in first out (FIFO) queue. More...

#include <rw/queuecol.h>

Inheritance diagram for RWSlistCollectablesQueue:
RWSlistCollectables RWSequenceable RWCollection RWCollectable

Public Member Functions

 RWSlistCollectablesQueue ()
 
 RWSlistCollectablesQueue (RWCollectable *a)
 
 RWSlistCollectablesQueue (const RWSlistCollectablesQueue &queue)
 
 RWSlistCollectablesQueue (RWSlistCollectablesQueue &&queue)
 
virtual RWCollectablecopy () const
 
virtual RWClassID isA () const
 
virtual bool isEqual (const RWCollectable *) const
 
virtual RWCollectablenewSpecies () const
 
RWSlistCollectablesQueueoperator= (RWSlistCollectablesQueue &&rhs)
 
RWSlistCollectablesQueueoperator= (const RWSlistCollectablesQueue &rhs)
 
virtual RWCollectableremove (const RWCollectable *)
 
- Public Member Functions inherited from RWSlistCollectables
 RWSlistCollectables ()
 
 RWSlistCollectables (RWCollectable *a)
 
 RWSlistCollectables (const RWSlistCollectables &lst)
 
 RWSlistCollectables (RWSlistCollectables &&lst)
 
virtual RWCollectableappend (RWCollectable *a)
 
virtual void apply (RWapplyCollectable ap, void *x)
 
virtual RWCollectable *& at (size_t i)
 
virtual const RWCollectableat (size_t i) const
 
virtual void clear ()
 
virtual bool contains (const RWCollectable *target) const
 
bool containsReference (const RWCollectable *e) const
 
virtual size_t entries () const
 
virtual RWCollectablefind (const RWCollectable *target) const
 
RWCollectablefindReference (const RWCollectable *e) const
 
virtual RWCollectablefirst () const
 
RWCollectableget ()
 
virtual size_t index (const RWCollectable *c) const
 
virtual RWCollectableinsert (RWCollectable *a)
 
virtual RWCollectableinsertAt (size_t indx, RWCollectable *e)
 
virtual bool isEmpty () const
 
virtual RWCollectablelast () const
 
virtual RWConstIteratornewConstIterator () const
 
virtual RWIteratornewIterator ()
 
virtual size_t occurrencesOf (const RWCollectable *target) const
 
size_t occurrencesOfReference (const RWCollectable *e) const
 
RWSlistCollectablesoperator= (RWSlistCollectables &&rhs)
 
RWSlistCollectablesoperator= (const RWSlistCollectables &rhs)
 
bool operator== (const RWSlistCollectables &s) const
 
RWCollectableremoveReference (const RWCollectable *e)
 
- Public Member Functions inherited from RWCollection
virtual ~RWCollection ()
 
RWBag asBag () const
 
RWBinaryTree asBinaryTree () const
 
RWOrdered asOrderedCollection () const
 
RWSet asSet () const
 
RWBinaryTree asSortedCollection () const
 
virtual RWspace binaryStoreSize () const
 
virtual void clearAndDestroy ()
 
void operator+= (const RWCollection &c)
 
void operator-= (const RWCollection &c)
 
virtual void restoreGuts (RWvistream &)
 
virtual void restoreGuts (RWFile &)
 
virtual void saveGuts (RWvostream &) const
 
virtual void saveGuts (RWFile &) const
 
RWCollectionselect (RWtestCollectable tst, void *vp) const
 
- Public Member Functions inherited from RWCollectable
virtual ~RWCollectable ()
 
virtual int compareTo (const RWCollectable *) const
 
virtual unsigned hash () const
 
RWspace recursiveStoreSize () const
 
RWStringID stringID () const
 

Private Member Functions

RWCollectableprepend (RWCollectable *)
 
virtual void removeAndDestroy (const RWCollectable *)
 

Additional Inherited Members

- Static Public Member Functions inherited from RWCollectable
static RWClassID classID (const RWStringID &name)
 
static RWClassID classIsA ()
 
static bool isAtom (RWClassID id)
 
static RWspace nilStoreSize ()
 
- Static Public Attributes inherited from RWCollection
static size_t DEFAULT_CAPACITY
 

Detailed Description

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.

Synopsis
// Smalltalk typedef:
typedef RWSlistCollectablesQueue Queue ;
#include <rw/queuecol.h>
Persistence
Polymorphic

Constructor & Destructor Documentation

RWSlistCollectablesQueue::RWSlistCollectablesQueue ( )

Constructs an empty queue.

RWSlistCollectablesQueue::RWSlistCollectablesQueue ( RWCollectable a)
inline

Constructs a queue with single item a.

RWSlistCollectablesQueue::RWSlistCollectablesQueue ( const RWSlistCollectablesQueue queue)
inline

Makes a shallow copy of queue.

RWSlistCollectablesQueue::RWSlistCollectablesQueue ( RWSlistCollectablesQueue &&  queue)
inline

Move constructor. The constructed RWSlistCollectablesQueue takes ownership of the data owned by queue.

Condition:
This method is available only on platforms with rvalue reference support.

Member Function Documentation

virtual RWCollectable* RWSlistCollectablesQueue::copy ( ) const
virtual

Returns a new, copy-constructed object of the same type as self. The caller is responsible for deleting the object.

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

Behaves as if compareTo(t) was invoked, returning true if the result equals 0, false otherwise.

Reimplemented from RWSlistCollectables.

virtual RWCollectable* RWSlistCollectablesQueue::newSpecies ( ) const
virtual

Returns a new, default-constructed object of the same type as self. The caller is responsible for deleting the object.

Reimplemented from RWSlistCollectables.

RWSlistCollectablesQueue& RWSlistCollectablesQueue::operator= ( RWSlistCollectablesQueue &&  rhs)
inline

Move assignment. Self takes ownership of the data owned by rhs.

Condition:
This method is available only on platforms with rvalue reference support.
RWSlistCollectablesQueue& RWSlistCollectablesQueue::operator= ( const RWSlistCollectablesQueue rhs)
inline

Assignment operator. Makes a shallow copy of rhs.

RWCollectable* RWSlistCollectablesQueue::prepend ( RWCollectable c)
inlineprivatevirtual

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 )
inlinevirtual

Calls get(). The argument is ignored.

Reimplemented from RWSlistCollectables.

virtual void RWSlistCollectablesQueue::removeAndDestroy ( const RWCollectable target)
inlineprivatevirtual

Removes and deletes the first item in the collection which "matches" the object pointed to by target.

Reimplemented from RWCollection.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.