rwlogo
SourcePro C++ 12.5

SourcePro® C++ API Reference Guide

Product Documentation:

   SourcePro C++
Documentation Home

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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 RWClassID isA () const
 
virtual bool isEqual (const RWCollectable *) const
 
virtual RWCollectable * newSpecies () const
 
RWSlistCollectablesQueue & operator= (RWSlistCollectablesQueue &&rhs)
 
RWSlistCollectablesQueue & operator= (const RWSlistCollectablesQueue &rhs)
 
virtual RWCollectable * remove (const RWCollectable *)
 
- Public Member Functions inherited from RWSlistCollectables
 RWSlistCollectables ()
 
 RWSlistCollectables (RWCollectable *a)
 
 RWSlistCollectables (const RWSlistCollectables &lst)
 
 RWSlistCollectables (RWSlistCollectables &&lst)
 
virtual RWCollectable * append (RWCollectable *a)
 
virtual void apply (RWapplyCollectable ap, void *x)
 
virtual RWCollectable *& at (size_t i)
 
virtual const RWCollectable * at (size_t i) const
  More...
 
virtual void clear ()
 
virtual bool contains (const RWCollectable *target) const
 
bool containsReference (const RWCollectable *e) const
 
virtual size_t entries () const
 
virtual RWCollectable * find (const RWCollectable *target) const
 
RWCollectable * findReference (const RWCollectable *e) const
 
virtual RWCollectable * first () const
 
RWCollectable * get ()
 
virtual size_t index (const RWCollectable *c) const
 
virtual RWCollectable * insert (RWCollectable *a)
 
virtual RWCollectable * insertAt (size_t indx, RWCollectable *e)
 
virtual bool isEmpty () const
 
virtual RWCollectable * last () const
 
virtual RWConstIterator * newConstIterator () const
 
virtual RWIterator * newIterator ()
 
virtual size_t occurrencesOf (const RWCollectable *target) const
 
size_t occurrencesOfReference (const RWCollectable *e) const
 
RWSlistCollectables & operator= (RWSlistCollectables &&rhs)
 
RWSlistCollectables & operator= (const RWSlistCollectables &rhs)
 
bool operator== (const RWSlistCollectables &s) const
 
RWCollectable * removeReference (const RWCollectable *e)
 

Private Member Functions

RWCollectable * prepend (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 only available on platforms with rvalue reference support.

Member Function Documentation

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.

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

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

Condition:
This method is only available 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 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.
Provide feedback to Rogue Wave about its documentation.