SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWCollectableAssociation Class Reference

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

#include <rw/collass.h>

Inheritance diagram for RWCollectableAssociation:
RWCollectable

Public Member Functions

 RWCollectableAssociation ()
 
 RWCollectableAssociation (RWCollectable *k, RWCollectable *v)
 
virtual ~RWCollectableAssociation ()
 
virtual RWspace binaryStoreSize () const
 
virtual int compareTo (const RWCollectable *c) const
 
virtual RWCollectablecopy () const
 
virtual unsigned hash () const
 
virtual RWClassID isA () const
 
virtual bool isEqual (const RWCollectable *c) const
 
RWCollectablekey () const
 
virtual RWCollectablenewSpecies () const
 
virtual void restoreGuts (RWFile &)
 
virtual void restoreGuts (RWvistream &)
 
virtual void saveGuts (RWFile &) const
 
virtual void saveGuts (RWvostream &) const
 
RWCollectablevalue () const
 
RWCollectablevalue (RWCollectable *ct)
 
- Public Member Functions inherited from RWCollectable
virtual ~RWCollectable ()
 
RWspace recursiveStoreSize () const
 
RWStringID stringID () const
 

Static Public Member Functions

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

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>
See also
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() [1/2]

RWCollectableAssociation::RWCollectableAssociation ( )

Default constructor

◆ RWCollectableAssociation() [2/2]

RWCollectableAssociation::RWCollectableAssociation ( RWCollectable * k,
RWCollectable * v )
inline

Constructs an RWCollectableAssociation with the given key and value.

◆ ~RWCollectableAssociation()

virtual RWCollectableAssociation::~RWCollectableAssociation ( )
virtual

Empty destructor.

Member Function Documentation

◆ binaryStoreSize()

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.

◆ classIsA()

static RWClassID RWCollectableAssociation::classIsA ( )
static

Returns the RWClassID of this class.

◆ compareTo()

virtual int RWCollectableAssociation::compareTo ( const RWCollectable * c) const
virtual

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

Reimplemented from RWCollectable.

◆ copy()

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

◆ hash()

virtual unsigned RWCollectableAssociation::hash ( ) const
virtual

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

Reimplemented from RWCollectable.

◆ isA()

virtual RWClassID RWCollectableAssociation::isA ( ) const
virtual

Returns the unique ID for RWCollectableAssociation.

Reimplemented from RWCollectable.

◆ isEqual()

virtual bool RWCollectableAssociation::isEqual ( const RWCollectable * c) const
virtual

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

Reimplemented from RWCollectable.

◆ key()

RWCollectable * RWCollectableAssociation::key ( ) const
inline

Returns the key part of the association.

◆ newSpecies()

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

◆ restoreGuts() [1/2]

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.

◆ restoreGuts() [2/2]

virtual void RWCollectableAssociation::restoreGuts ( RWvistream & )
virtual

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

Reimplemented from RWCollectable.

◆ saveGuts() [1/2]

virtual void RWCollectableAssociation::saveGuts ( RWFile & ) const
virtual

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

Reimplemented from RWCollectable.

◆ saveGuts() [2/2]

virtual void RWCollectableAssociation::saveGuts ( RWvostream & ) const
virtual

Writes an object's state to an output stream.

Reimplemented from RWCollectable.

◆ value() [1/2]

RWCollectable * RWCollectableAssociation::value ( ) const
inline

Returns the value part of the association.

◆ value() [2/2]

RWCollectable * RWCollectableAssociation::value ( RWCollectable * ct)

Sets the value to ct and returns the old value.

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