SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches

Useful as a base class for classes that use integers as keys in dictionaries, and so forth. More...

#include <rw/rwint.h>

Inheritance diagram for RWInteger:
RWCollectableInt

Public Member Functions

 RWInteger (int i=0)
 
RWspace binaryStoreSize () const
 
 operator int () const
 
int value () const
 
int value (int newval)
 

Friends

std::istream & operator>> (std::istream &i, RWInteger &x)
 

Related Symbols

(Note that these are not member symbols.)

RWFileoperator<< (RWFile &file, const RWInteger &x)
 
RWvostreamoperator<< (RWvostream &str, const RWInteger &x)
 
std::ostream & operator<< (std::ostream &o, const RWInteger &x)
 
RWFileoperator>> (RWFile &file, RWInteger &x)
 
RWvistreamoperator>> (RWvistream &str, RWInteger &x)
 

Detailed Description

Integer class. This class is useful as a base class for classes that use integers as keys in dictionaries, and so forth.

Synopsis
#include <rw/rwint.h>
Useful as a base class for classes that use integers as keys in dictionaries, and so forth.
Definition rwint.h:41
Persistence
Isomorphic

Constructor & Destructor Documentation

◆ RWInteger()

RWInteger::RWInteger ( int i = 0)
inline

Constructs an RWInteger with value i. Serves as a type conversion from int.

Note
If no argument is supplied, the value defaults to zero (0).

Member Function Documentation

◆ binaryStoreSize()

RWspace RWInteger::binaryStoreSize ( ) const
inline

Returns the number of bytes necessary to store the object using the global function:

RWFile& operator<<(RWFile&, const RWInteger&);

◆ operator int()

RWInteger::operator int ( ) const
inline

Type conversion to int.

◆ value() [1/2]

int RWInteger::value ( ) const
inline

Returns the value of the RWInteger.

◆ value() [2/2]

int RWInteger::value ( int newval)
inline

Changes the value of the RWInteger to newval and returns the old value.

Friends And Related Symbol Documentation

◆ operator<<() [1/3]

RWFile & operator<< ( RWFile & file,
const RWInteger & x )
related

Saves the RWInteger x to an RWFile.

◆ operator<<() [2/3]

RWvostream & operator<< ( RWvostream & str,
const RWInteger & x )
related

Saves the RWInteger x to a virtual stream.

◆ operator<<() [3/3]

std::ostream & operator<< ( std::ostream & o,
const RWInteger & x )
related

Outputs x to std::ostream o.

◆ operator>>() [1/3]

RWFile & operator>> ( RWFile & file,
RWInteger & x )
related

Restores an RWInteger into x from an RWFile, replacing the previous contents of x.

◆ operator>>() [2/3]

RWvistream & operator>> ( RWvistream & str,
RWInteger & x )
related

Restores an RWInteger into x from a virtual stream, replacing the previous contents of x.

◆ operator>> [3/3]

std::istream & operator>> ( std::istream & i,
RWInteger & x )
friend

Inputs x from std::istream i.

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