rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWCollectableAssociation Class Reference
[RWCollectable-derived]

Associates a key with a value in the Essential Tools Module "dictionary" collection classes. More...

#include <rw/collass.h>

Inheritance diagram for RWCollectableAssociation:
RWCollectable

List of all members.

Public Member Functions

virtual RWCollectablenewSpecies () const
virtual RWClassID isA () const
 RWCollectableAssociation ()
 RWCollectableAssociation (RWCollectable *k, RWCollectable *v)
virtual ~RWCollectableAssociation ()
RWCollectablekey () const
RWCollectablevalue () const
RWCollectablevalue (RWCollectable *ct)
virtual RWspace binaryStoreSize () const
virtual int compareTo (const RWCollectable *c) const
virtual unsigned hash () const
virtual bool isEqual (const RWCollectable *c) const
virtual void restoreGuts (RWvistream &)
virtual void restoreGuts (RWFile &)
virtual void saveGuts (RWvostream &) const
virtual void saveGuts (RWFile &) const

Static Public Member Functions

static RWClassID classIsA ()

Detailed Description

RWCollectableAssociation inherits class RWCollectable. Used internally to associate a key with a value in the Essential Tools Module "dictionary" collection classes. Comparison and equality testing are forwarded to the key part of the association.

Synopsis

 #include <rw/collass.h>

Related Classes

The dictionary containers RWBTreeDictionary, RWHashDictionary, and RWIdentityDictionary make use of RWCollectableAssociation. When any of their content is dealt with as an RWCollectable, such as when operator+=() or asBag() is used, the RWCollectableAssociation is exposed.

Persistence

Polymorphic


Constructor & Destructor Documentation

RWCollectableAssociation::RWCollectableAssociation (  ) 

Default constructor

RWCollectableAssociation::RWCollectableAssociation ( RWCollectable k,
RWCollectable v 
) [inline]

Constructs an RWCollectableAssociation with the given key and value.

virtual RWCollectableAssociation::~RWCollectableAssociation (  )  [virtual]

Empty destructor.


Member Function Documentation

virtual RWspace RWCollectableAssociation::binaryStoreSize (  )  const [virtual]

Returns the number of bytes used by the virtual function saveGuts(RWFile&) to store an object. Typically, this involves adding up the space required to store all primitives, plus the results of calling recursiveStoreSize() for all objects inheriting from RWCollectable. See the Essential Tools Module User's Guide for details.

Reimplemented from RWCollectable.

static RWClassID RWCollectableAssociation::classIsA (  )  [static]

Returns the RWClassID of this class.

Reimplemented from RWCollectable.

virtual int RWCollectableAssociation::compareTo ( const RWCollectable c  )  const [virtual]

Returns the results of calling RWCollectable::compareTo().

Reimplemented from RWCollectable.

virtual unsigned RWCollectableAssociation::hash (  )  const [virtual]

Returns the results of calling key()->hash().

Reimplemented from RWCollectable.

virtual RWClassID RWCollectableAssociation::isA (  )  const [virtual]

Returns the unique ID for RWCollectableAssociation.

Reimplemented from RWCollectable.

virtual bool RWCollectableAssociation::isEqual ( const RWCollectable c  )  const [virtual]

Returns the results of calling RWCollectable::isEqual().

Reimplemented from RWCollectable.

RWCollectable* RWCollectableAssociation::key (  )  const [inline]

Returns the key part of the association.

virtual RWCollectable* RWCollectableAssociation::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 RWCollectable.

virtual void RWCollectableAssociation::restoreGuts ( RWFile  )  [virtual]

Reads an object's state from a binary file, using class RWFile, replacing the previous state.

Reimplemented from RWCollectable.

virtual void RWCollectableAssociation::restoreGuts ( RWvistream  )  [virtual]

Reads an object's state from an input stream, replacing the previous state.

Reimplemented from RWCollectable.

virtual void RWCollectableAssociation::saveGuts ( RWFile  )  const [virtual]

Writes an object's state to a binary file, using class RWFile.

Reimplemented from RWCollectable.

virtual void RWCollectableAssociation::saveGuts ( RWvostream  )  const [virtual]

Writes an object's state to an output stream.

Reimplemented from RWCollectable.

RWCollectable* RWCollectableAssociation::value ( RWCollectable ct  ) 

Sets the value to ct and returns the old value.

RWCollectable* RWCollectableAssociation::value (  )  const [inline]

Returns the value part of the association.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© 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.