SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Static Public Member Functions
RWCollectableInt Class Reference

Provides a polymorphically persistable RWInteger. More...

#include <rw/collint.h>

Inheritance diagram for RWCollectableInt:
RWCollectable RWInteger

Public Member Functions

 RWCollectableInt ()
 
 RWCollectableInt (int j)
 
virtual ~RWCollectableInt ()
 
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
 
virtual RWCollectablenewSpecies () const
 
virtual void restoreGuts (RWvistream &)
 
virtual void restoreGuts (RWFile &)
 
virtual void saveGuts (RWvostream &) const
 
virtual void saveGuts (RWFile &) const
 
- Public Member Functions inherited from RWCollectable
virtual ~RWCollectable ()
 
RWspace recursiveStoreSize () const
 
RWStringID stringID () const
 
- Public Member Functions inherited from RWInteger
 RWInteger (int i=0)
 
RWspace binaryStoreSize () const
 
 operator int () const
 
int value () const
 
int value (int newval)
 

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

Additional Inherited Members

Detailed Description

Collectable integers. Inherits from classes RWInteger and RWCollectable. This class is useful when integers are used as keys in the "dictionary" collection classes, or if integers are stored and retrieved as RWCollectable instances.

The virtual functions of the base class RWCollectable have been redefined.

Synopsis
typedef RWCollectableInt Integer; // Smalltalk typedef
#include <rw/collint.h>
Persistence
Polymorphic

Constructor & Destructor Documentation

RWCollectableInt::RWCollectableInt ( )

Calls the appropriate base class constructor. See RWInteger::RWInteger().

RWCollectableInt::RWCollectableInt ( int  j)
inline

Calls the appropriate base class constructor. See RWInteger::RWInteger(int).

virtual RWCollectableInt::~RWCollectableInt ( )
virtual

Empty destructor.

Member Function Documentation

virtual RWspace RWCollectableInt::binaryStoreSize ( ) const
inlinevirtual

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 RWCollectableInt::classIsA ( )
static

Returns the RWClassID of this class.

virtual int RWCollectableInt::compareTo ( const RWCollectable c) const
virtual

If c is an RWCollectableInt, returns the difference between self and c, otherwise returns a nonzero value based on the type of c.

Reimplemented from RWCollectable.

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

virtual unsigned RWCollectableInt::hash ( ) const
virtual

Returns the value of RWCollectableInt as an unsigned, to be used as a hash value.

Reimplemented from RWCollectable.

virtual RWClassID RWCollectableInt::isA ( ) const
virtual

Returns the unique ID for RWCollectableInt.

Reimplemented from RWCollectable.

virtual bool RWCollectableInt::isEqual ( const RWCollectable t) const
virtual

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

Reimplemented from RWCollectable.

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

virtual void RWCollectableInt::restoreGuts ( RWvistream )
virtual

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

Reimplemented from RWCollectable.

virtual void RWCollectableInt::restoreGuts ( RWFile )
virtual

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

Reimplemented from RWCollectable.

virtual void RWCollectableInt::saveGuts ( RWvostream ) const
virtual

Writes an object's state to an output stream.

Reimplemented from RWCollectable.

virtual void RWCollectableInt::saveGuts ( RWFile ) const
virtual

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

Reimplemented from RWCollectable.

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