TInteger Class Reference

#include <bigint.h>

class TInteger
Protected Attributes
TUint iPtr
TUint iSize
Public Member Enumerations
enumTRandomAttribute { EAllBitsRandom, ETopBitSet, ETop2BitsSet }
Protected Member Enumerations
enumTSign { EPositive, ENegative }
Public Member Functions
IMPORT_C TBoolBit(TUint)
IMPORT_C TUintBitCount(void)
IMPORT_C HBufC8 *BufferLC()
IMPORT_C HBufC8 *BufferWithNoTruncationLC()
IMPORT_C TUintByteCount(void)
IMPORT_C TIntConvertToLongL(void)
IMPORT_C voidCopyL(const TInteger &, TBool)
IMPORT_C voidCopyL(const TInt, TBool)
IMPORT_C RIntegerDividedByL(const TInteger &)
IMPORT_C RIntegerDividedByL(TUint)
IMPORT_C RIntegerExponentiateL(const TInteger &)
IMPORT_C RIntegerGCDL(const TInteger &)
IMPORT_C RIntegerInverseModL(const TInteger &)
TBool IsEven()
TBool IsNegative()
TBool IsOdd()
TBool IsPositive()
IMPORT_C TBoolIsPrimeL(void)
TBool IsZero()
IMPORT_C RIntegerMinusL(const TInteger &)
IMPORT_C RIntegerModularExponentiateL(const TInteger &, const TInteger &, const TInteger &)
IMPORT_C RIntegerModularMultiplyL(const TInteger &, const TInteger &, const TInteger &)
IMPORT_C RIntegerModuloL(const TInteger &)
IMPORT_C TUintModuloL(TUint)
IMPORT_C voidNegate(void)
TBool NotNegative()
TBool NotPositive()
TBool NotZero()
IMPORT_C const TInteger &One(void)
IMPORT_C RIntegerPlusL(const TInteger &)
IMPORT_C voidSet(const RInteger &)
IMPORT_C voidSetBit(TUint)
IMPORT_C TIntSignedCompare(const TInteger &)
IMPORT_C TIntSignedCompare(TInt)
IMPORT_C RIntegerSquaredL(void)
IMPORT_C RIntegerTimesL(const TInteger &)
IMPORT_C const TInteger &Two(void)
IMPORT_C TIntUnsignedCompare(const TInteger &)
IMPORT_C TUintWordCount(void)
IMPORT_C const TInteger &Zero(void)
IMPORT_C TBooloperator!()
TBool operator!=(const TInteger &)
TBool operator!=(TInt)
IMPORT_C TInteger &operator%=(const TInteger &)
IMPORT_C TInteger &operator%=(TInt)
IMPORT_C TInteger &operator*=(const TInteger &)
IMPORT_C TInteger &operator*=(TInt)
IMPORT_C TInteger &operator++()
IMPORT_C TInteger &operator+=(const TInteger &)
IMPORT_C TInteger &operator+=(TInt)
IMPORT_C TInteger &operator--()
IMPORT_C TInteger &operator-=(const TInteger &)
IMPORT_C TInteger &operator-=(TInt)
IMPORT_C TInteger &operator/=(const TInteger &)
IMPORT_C TInteger &operator/=(TInt)
TBool operator<(const TInteger &)
TBool operator<(TInt)
IMPORT_C TInteger &operator<<=(TUint)
TBool operator<=(const TInteger &)
TBool operator<=(TInt)
TBool operator==(const TInteger &)
TBool operator==(TInt)
TBool operator>(const TInteger &)
TBool operator>(TInt)
TBool operator>=(const TInteger &)
TBool operator>=(TInt)
IMPORT_C TInteger &operator>>=(TUint)
Protected Member Functions
TInteger(void)
voidCleanGrowL(TUint)
voidCleanNewL(TUint)
voidCleanResizeL(TUint)
voidConstruct(const TDesC8 &)
voidConstruct(const TInteger &)
voidConstruct(TInt)
voidConstruct(TUint)
voidConstructStack(TUint, TUint)
voidConstructStack(TUint, const TInteger &)
TInt ConvertToLong(void)
TUint ConvertToUnsignedLong(void)
voidCreateNewL(TUint)
voidDivideL(RInteger &, RInteger &, const TInteger &, const TInteger &)
voidDivideL(TUint &, RInteger &, const TInteger &, TUint)
TBool IsConvertableToLong(void)
TBool IsHeapBased(void)
TBool IsStackBased(void)
TUint Modulo(const TInteger &, TUint)
RInteger PositiveAddL(const TInteger &, const TInteger &)
voidPositiveDivide(TUint &, TInteger &, const TInteger &, TUint)
voidPositiveDivideL(RInteger &, RInteger &, const TInteger &, const TInteger &)
RInteger PositiveMultiplyL(const TInteger &, const TInteger &)
RInteger PositiveSubtractL(const TInteger &, const TInteger &)
voidPrimeRandomizeL(TUint, TRandomAttribute)
TUint *constPtr(void)
voidRandomizeL(TUint, TRandomAttribute)
voidRandomizeL(const TInteger &, const TInteger &)
voidSetHeapBased(void)
voidSetPtr(TUint *)
voidSetSign(TSign)
voidSetSize(TUint)
voidSetStackBased(void)
TSign Sign(void)
TUint Size(void)
TBool SmallPrimeRandomizeL(void)

Detailed Description

Abstract base class defining the interface for handling and manipulating big integers.

TInteger is capable of representing both negative and positive integers with an absolute value of less than 2^32^(2^32). To create an integer look at RInteger. TInteger defines an interface for the RInteger implementation - it is not intended that TIntegers be copied or assigned from other TIntegers. On EKA1 platforms, this is possible, but it should be avoided.

See also: RInteger

Member Attribute Documentation

iPtr

TUint iPtr[protected]

iSize

TUint iSize[protected]

Member Enumeration Documentation

Enum TRandomAttribute

EnumeratorValueDescription
EAllBitsRandom0
ETopBitSet1
ETop2BitsSet2

Enum TSign

EnumeratorValueDescription
EPositive0
ENegative1

Constructor & Destructor Documentation

TInteger ( void )

IMPORT_CTInteger(void)[protected]

Member Function Documentation

Bit ( TUint )

IMPORT_C TBoolBit(TUintaBitPos)const

BitCount ( void )

IMPORT_C TUintBitCount(void)const

Get the number of bits required to represent this RInteger.

Return Value
The size of the integer in bits.

BufferLC ( )

IMPORT_C HBufC8 *BufferLC()const

Creates a new buffer containing the big-endian binary representation of this integer.

Note that it does not support the exporting of negative integers.

Return Value
The new buffer.
Leave Codes
KErrNegativeExportNotSupportedIf this instance is a negative integer.

BufferWithNoTruncationLC ( )

IMPORT_C HBufC8 *BufferWithNoTruncationLC()const

ByteCount ( void )

IMPORT_C TUintByteCount(void)const

Gets the number of bytes required to represent this RInteger.

Return Value
The size of the integer in bytes.

CleanGrowL ( TUint )

voidCleanGrowL(TUintaNewSize)[protected]

CleanNewL ( TUint )

voidCleanNewL(TUintaNewSize)[protected]

CleanResizeL ( TUint )

voidCleanResizeL(TUintaNewSize)[protected]

Construct ( const TDesC8 & )

voidConstruct(const TDesC8 &aValue)[protected]

Construct ( const TInteger & )

voidConstruct(const TInteger &aInteger)[protected]

Construct ( TInt )

voidConstruct(TIntaInteger)[protected]

Construct ( TUint )

voidConstruct(TUintaInteger)[protected]

ConstructStack ( TUint, TUint )

voidConstructStack(TUintaWords,
TUintaInteger
)[protected]

ConstructStack ( TUint, const TInteger & )

voidConstructStack(TUintaWords,
const TInteger &aInteger
)[protected]

ConvertToLong ( void )

TInt ConvertToLong(void)const [protected]

ConvertToLongL ( void )

IMPORT_C TIntConvertToLongL(void)const

ConvertToUnsignedLong ( void )

TUint ConvertToUnsignedLong(void)const [protected, inline]

CopyL ( const TInteger &, TBool )

IMPORT_C voidCopyL(const TInteger &aInteger,
TBoolaAllowShrink = ETrue
)

CopyL ( const TInt, TBool )

IMPORT_C voidCopyL(const TIntaInteger,
TBoolaAllowShrink = ETrue
)

CreateNewL ( TUint )

voidCreateNewL(TUintaNewSize)[protected]

DivideL ( RInteger &, RInteger &, const TInteger &, const TInteger & )

voidDivideL(RInteger &aRemainder,
RInteger &aQuotient,
const TInteger &aDividend,
const TInteger &aDivisor
)const [protected]

DivideL ( TUint &, RInteger &, const TInteger &, TUint )

voidDivideL(TUint &aRemainder,
RInteger &aQoutient,
const TInteger &aDividend,
TUintaDivisor
)const [protected]

DividedByL ( const TInteger & )

IMPORT_C RIntegerDividedByL(const TInteger &aOperand)const

DividedByL ( TUint )

IMPORT_C RIntegerDividedByL(TUintaOperand)const

ExponentiateL ( const TInteger & )

IMPORT_C RIntegerExponentiateL(const TInteger &aExponent)const

GCDL ( const TInteger & )

IMPORT_C RIntegerGCDL(const TInteger &aOperand)const

InverseModL ( const TInteger & )

IMPORT_C RIntegerInverseModL(const TInteger &aMod)const

IsConvertableToLong ( void )

TBool IsConvertableToLong(void)const [protected]

IsEven ( )

TBool IsEven()const [inline]

IsHeapBased ( void )

TBool IsHeapBased(void)const [protected, inline]

IsNegative ( )

TBool IsNegative()const [inline]

IsOdd ( )

TBool IsOdd()const [inline]

IsPositive ( )

TBool IsPositive()const [inline]

IsPrimeL ( void )

IMPORT_C TBoolIsPrimeL(void)const

IsStackBased ( void )

TBool IsStackBased(void)const [protected, inline]

IsZero ( )

TBool IsZero()const [inline]

MinusL ( const TInteger & )

IMPORT_C RIntegerMinusL(const TInteger &aOperand)const

ModularExponentiateL ( const TInteger &, const TInteger &, const TInteger & )

IMPORT_C RIntegerModularExponentiateL(const TInteger &aBase,
const TInteger &aExp,
const TInteger &aMod
)[static]

ModularMultiplyL ( const TInteger &, const TInteger &, const TInteger & )

IMPORT_C RIntegerModularMultiplyL(const TInteger &aA,
const TInteger &aB,
const TInteger &aModulus
)[static]

Modulo ( const TInteger &, TUint )

TUint Modulo(const TInteger &aDividend,
TUintaDivisor
)const [protected]

ModuloL ( const TInteger & )

IMPORT_C RIntegerModuloL(const TInteger &aOperand)const

ModuloL ( TUint )

IMPORT_C TUintModuloL(TUintaOperand)const

Negate ( void )

IMPORT_C voidNegate(void)

NotNegative ( )

TBool NotNegative()const [inline]

NotPositive ( )

TBool NotPositive()const [inline]

NotZero ( )

TBool NotZero()const [inline]

One ( void )

IMPORT_C const TInteger &One(void)[static]

Gets the TInteger that represents one

Return Value
The TInteger representing one

PlusL ( const TInteger & )

IMPORT_C RIntegerPlusL(const TInteger &aOperand)const

PositiveAddL ( const TInteger &, const TInteger & )

RInteger PositiveAddL(const TInteger &aA,
const TInteger &aB
)const [protected]

PositiveDivide ( TUint &, TInteger &, const TInteger &, TUint )

voidPositiveDivide(TUint &aRemainder,
TInteger &aQoutient,
const TInteger &aDividend,
TUintaDivisor
)const [protected]

PositiveDivideL ( RInteger &, RInteger &, const TInteger &, const TInteger & )

voidPositiveDivideL(RInteger &aRemainder,
RInteger &aQuotient,
const TInteger &aDividend,
const TInteger &aDivisor
)const [protected]

PositiveMultiplyL ( const TInteger &, const TInteger & )

RInteger PositiveMultiplyL(const TInteger &aA,
const TInteger &aB
)const [protected]

PositiveSubtractL ( const TInteger &, const TInteger & )

RInteger PositiveSubtractL(const TInteger &aA,
const TInteger &aB
)const [protected]

PrimeRandomizeL ( TUint, TRandomAttribute )

voidPrimeRandomizeL(TUintaBits,
TRandomAttributeaAttr
)[protected]

Ptr ( void )

TUint *constPtr(void)const [protected, inline]

RandomizeL ( TUint, TRandomAttribute )

voidRandomizeL(TUintaBits,
TRandomAttributeaAttr
)[protected]

RandomizeL ( const TInteger &, const TInteger & )

voidRandomizeL(const TInteger &aMin,
const TInteger &aMax
)[protected]

Set ( const RInteger & )

IMPORT_C voidSet(const RInteger &aInteger)

SetBit ( TUint )

IMPORT_C voidSetBit(TUintaBitPos)

SetHeapBased ( void )

voidSetHeapBased(void)[protected, inline]

SetPtr ( TUint * )

voidSetPtr(TUint *aPtr)[protected, inline]

SetSign ( TSign )

voidSetSign(TSignaSign)[protected, inline]

SetSize ( TUint )

voidSetSize(TUintaSize)[protected, inline]

SetStackBased ( void )

voidSetStackBased(void)[protected, inline]

Sign ( void )

TSign Sign(void)const [protected, inline]

SignedCompare ( const TInteger & )

IMPORT_C TIntSignedCompare(const TInteger &aThat)const

SignedCompare ( TInt )

IMPORT_C TIntSignedCompare(TIntaThat)const

Size ( void )

TUint Size(void)const [protected, inline]

SmallPrimeRandomizeL ( void )

TBool SmallPrimeRandomizeL(void)[protected]

SquaredL ( void )

IMPORT_C RIntegerSquaredL(void)const

TimesL ( const TInteger & )

IMPORT_C RIntegerTimesL(const TInteger &aOperand)const

Two ( void )

IMPORT_C const TInteger &Two(void)[static]

Gets the TInteger that represents two

Return Value
The TInteger representing two

UnsignedCompare ( const TInteger & )

IMPORT_C TIntUnsignedCompare(const TInteger &aThat)const

WordCount ( void )

IMPORT_C TUintWordCount(void)const

Gets the number of words required to represent this RInteger.

Return Value
The size of the integer in words.

Zero ( void )

IMPORT_C const TInteger &Zero(void)[static]

Gets the TInteger that represents zero

Return Value
The TInteger representing zero

operator! ( )

IMPORT_C TBooloperator!()const

operator!= ( const TInteger & )

TBool operator!=(const TInteger &aInteger)const [inline]

operator!= ( TInt )

TBool operator!=(TIntaInteger)const [inline]

operator%= ( const TInteger & )

IMPORT_C TInteger &operator%=(const TInteger &aOperand)

operator%= ( TInt )

IMPORT_C TInteger &operator%=(TIntaOperand)

operator*= ( const TInteger & )

IMPORT_C TInteger &operator*=(const TInteger &aOperand)

operator*= ( TInt )

IMPORT_C TInteger &operator*=(TIntaOperand)

operator++ ( )

IMPORT_C TInteger &operator++()

operator+= ( const TInteger & )

IMPORT_C TInteger &operator+=(const TInteger &aOperand)

operator+= ( TInt )

IMPORT_C TInteger &operator+=(TIntaOperand)

operator-- ( )

IMPORT_C TInteger &operator--()

operator-= ( const TInteger & )

IMPORT_C TInteger &operator-=(const TInteger &aOperand)

operator-= ( TInt )

IMPORT_C TInteger &operator-=(TIntaOperand)

operator/= ( const TInteger & )

IMPORT_C TInteger &operator/=(const TInteger &aOperand)

operator/= ( TInt )

IMPORT_C TInteger &operator/=(TIntaOperand)

operator< ( const TInteger & )

TBool operator<(const TInteger &aInteger)const [inline]

operator< ( TInt )

TBool operator<(TIntaInteger)const [inline]

operator<<= ( TUint )

IMPORT_C TInteger &operator<<=(TUintaBits)

operator<= ( const TInteger & )

TBool operator<=(const TInteger &aInteger)const [inline]

operator<= ( TInt )

TBool operator<=(TIntaInteger)const [inline]

operator== ( const TInteger & )

TBool operator==(const TInteger &aInteger)const [inline]

operator== ( TInt )

TBool operator==(TIntaInteger)const [inline]

operator> ( const TInteger & )

TBool operator>(const TInteger &aInteger)const [inline]

operator> ( TInt )

TBool operator>(TIntaInteger)const [inline]

operator>= ( const TInteger & )

TBool operator>=(const TInteger &aInteger)const [inline]

operator>= ( TInt )

TBool operator>=(TIntaInteger)const [inline]

operator>>= ( TUint )

IMPORT_C TInteger &operator>>=(TUintaBits)