SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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 (RWFile &)
 
virtual void restoreGuts (RWvistream &)
 
virtual void saveGuts (RWFile &) const
 
virtual void saveGuts (RWvostream &) 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>
Provides a polymorphically persistable RWInteger.
Definition collint.h:49
Persistence
Polymorphic

Constructor & Destructor Documentation

◆ RWCollectableInt() [1/2]

RWCollectableInt::RWCollectableInt ( )

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

◆ RWCollectableInt() [2/2]

RWCollectableInt::RWCollectableInt ( int j)
inline

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

◆ ~RWCollectableInt()

virtual RWCollectableInt::~RWCollectableInt ( )
virtual

Empty destructor.

Member Function Documentation

◆ binaryStoreSize()

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.

◆ classIsA()

static RWClassID RWCollectableInt::classIsA ( )
static

Returns the RWClassID of this class.

◆ compareTo()

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.

◆ copy()

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.

◆ hash()

virtual unsigned RWCollectableInt::hash ( ) const
virtual

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

Reimplemented from RWCollectable.

◆ isA()

virtual RWClassID RWCollectableInt::isA ( ) const
virtual

Returns the unique ID for RWCollectableInt.

Reimplemented from RWCollectable.

◆ isEqual()

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.

◆ newSpecies()

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.

◆ restoreGuts() [1/2]

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.

◆ restoreGuts() [2/2]

virtual void RWCollectableInt::restoreGuts ( RWvistream & )
virtual

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

Reimplemented from RWCollectable.

◆ saveGuts() [1/2]

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

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

Reimplemented from RWCollectable.

◆ saveGuts() [2/2]

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

Writes an object's state to an output stream.

Reimplemented from RWCollectable.

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