Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsTInt64< T > Class Template Reference

This class encapsulates full 64-bit integer functionality and provides simple arithmetic and conversion operations. More...

#include <nsInt64.h>

Inheritance diagram for nsTInt64< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 nsTInt64 (void)
 Construct a new 64-bit integer.
 nsTInt64 (const PRInt32 aInt32)
 Construct a new 64-bit integer from a 32-bit signed integer.
 nsTInt64 (const PRUint32 aUint32)
 Construct a new 64-bit integer from a 32-bit unsigned integer.
 nsTInt64 (const PRFloat64 aFloat64)
 Construct a new 64-bit integer from a floating point value.
 nsTInt64 (const T aInt64)
 Construct a new 64-bit integer from a native 64-bit integer.
 nsTInt64 (const nsTInt64 &aObject)
 Construct a new 64-bit integer from another 64-bit integer.
const nsTInt64operator= (const nsTInt64 &aObject)
 Assign a 64-bit integer to another 64-bit integer.
 operator PRInt32 (void) const
 Convert a 64-bit integer to a signed 32-bit value.
 operator PRUint32 (void) const
 Convert a 64-bit integer to an unsigned 32-bit value.
 operator PRFloat64 (void) const
 Convert a 64-bit integer to a floating point value.
 operator T () const
 Convert a 64-bit integer to a native 64-bit integer.
const nsTInt64 operator- (void)
 Perform unary negation on a 64-bit integer.
nsTInt64operator+= (const nsTInt64 &aObject)
 Increment a 64-bit integer by a 64-bit integer amount.
nsTInt64operator-= (const nsTInt64 &aObject)
 Decrement a 64-bit integer by a 64-bit integer amount.
nsTInt64operator*= (const nsTInt64 &aObject)
 Multiply a 64-bit integer by a 64-bit integer amount.
nsTInt64operator/= (const nsTInt64 &aObject)
 Divide a 64-bit integer by a 64-bit integer amount.
nsTInt64operator%= (const nsTInt64 &aObject)
 Compute the modulus of a 64-bit integer to a 64-bit value.
nsTInt64operator<<= (int aCount)
 Shift a 64-bit integer left.
nsTInt64operator>>= (int aCount)
 Shift a 64-bit signed integer right.
const nsTInt64 operator+ (const nsTInt64 &aObject2) const
 Add two 64-bit integers.
const nsTInt64 operator- (const nsTInt64 &aObject2) const
 Subtract one 64-bit integer from another.
const nsTInt64 operator* (const nsTInt64 &aObject2) const
 Multiply two 64-bit integers.
const nsTInt64 operator/ (const nsTInt64 &aObject2) const
 Divide one 64-bit integer by another.
const nsTInt64 operator% (const nsTInt64 &aObject2) const
 Compute the modulus of two 64-bit integers.
const nsTInt64 operator<< (int aCount) const
 Shift left a 64-bit integer.
const nsTInt64 operator>> (int aCount) const
 Shift right a signed 64-bit integer.
PRBool operator== (const nsTInt64 &aObject2) const
 Determine if two 64-bit integers are equal.
PRBool operator== (T aValue) const
PRBool operator!= (const nsTInt64 &aObject2) const
 Determine if two 64-bit integers are not equal.
PRBool operator!= (T aValue) const
const nsTInt64 operator& (const nsTInt64 &aObject2) const
 Perform a bitwise AND of two 64-bit integers.
const nsTInt64 operator| (const nsTInt64 &aObject2) const
 Perform a bitwise OR of two 64-bit integers.
const nsTInt64 operator^ (const nsTInt64 &aObject2) const
 Perform a bitwise XOR of two 64-bit integers.
const nsTInt64 operator~ (void) const
 Compute the bitwise NOT of a 64-bit integer.
nsTInt64operator&= (const nsTInt64 &aObject)
 Compute the bitwise AND with another 64-bit integer.
nsTInt64operator|= (const nsTInt64 &aObject)
 Compute the bitwise OR with another 64-bit integer.
nsTInt64operator^= (const nsTInt64 &aObject)
 Compute the bitwise XOR with another 64-bit integer.
PRBool operator! () const
 Allow doing if (!some_nsInt64)

Public Attributes

T mValue

Detailed Description

template<class T>
class nsTInt64< T >

This class encapsulates full 64-bit integer functionality and provides simple arithmetic and conversion operations.

Definition at line 54 of file nsInt64.h.


Constructor & Destructor Documentation

template<class T>
nsTInt64< T >::nsTInt64 ( void  ) [inline]

Construct a new 64-bit integer.

Definition at line 63 of file nsInt64.h.

                   : mValue(LL_ZERO) {
    }

Here is the caller graph for this function:

template<class T>
nsTInt64< T >::nsTInt64 ( const PRInt32  aInt32) [inline]

Construct a new 64-bit integer from a 32-bit signed integer.

Definition at line 69 of file nsInt64.h.

                                   {
        LL_I2L(mValue, aInt32);
    }
template<class T>
nsTInt64< T >::nsTInt64 ( const PRUint32  aUint32) [inline]

Construct a new 64-bit integer from a 32-bit unsigned integer.

Definition at line 76 of file nsInt64.h.

                                     {
        LL_UI2L(mValue, aUint32);
    }
template<class T>
nsTInt64< T >::nsTInt64 ( const PRFloat64  aFloat64) [inline]

Construct a new 64-bit integer from a floating point value.

Definition at line 83 of file nsInt64.h.

                                       {
        LL_D2L(mValue, aFloat64);
    }
template<class T>
nsTInt64< T >::nsTInt64 ( const T  aInt64) [inline]

Construct a new 64-bit integer from a native 64-bit integer.

Definition at line 90 of file nsInt64.h.

                             : mValue(aInt64) {
    }
template<class T>
nsTInt64< T >::nsTInt64 ( const nsTInt64< T > &  aObject) [inline]

Construct a new 64-bit integer from another 64-bit integer.

Definition at line 96 of file nsInt64.h.

                                      : mValue(aObject.mValue) {
    }

Member Function Documentation

template<class T>
nsTInt64< T >::operator PRFloat64 ( void  ) const [inline]

Convert a 64-bit integer to a floating point value.

Definition at line 130 of file nsInt64.h.

                                   {
        PRFloat64 result;
        LL_L2D(result, mValue);
        return result;
    }
template<class T>
nsTInt64< T >::operator PRInt32 ( void  ) const [inline]

Convert a 64-bit integer to a signed 32-bit value.

Definition at line 112 of file nsInt64.h.

                                 {
        PRInt32 result;
        LL_L2I(result, mValue);
        return result;
    }
template<class T>
nsTInt64< T >::operator PRUint32 ( void  ) const [inline]

Convert a 64-bit integer to an unsigned 32-bit value.

Definition at line 121 of file nsInt64.h.

                                  {
        PRUint32 result;
        LL_L2UI(result, mValue);
        return result;
    }
template<class T>
nsTInt64< T >::operator T ( ) const [inline]

Convert a 64-bit integer to a native 64-bit integer.

Definition at line 139 of file nsInt64.h.

                       {
        return mValue;
    }
template<class T>
PRBool nsTInt64< T >::operator! ( ) const [inline]

Allow doing if (!some_nsInt64)

Definition at line 356 of file nsInt64.h.

                             {
        return LL_IS_ZERO(mValue);
    }
template<class T>
PRBool nsTInt64< T >::operator!= ( const nsTInt64< T > &  aObject2) const [inline]

Determine if two 64-bit integers are not equal.

Definition at line 284 of file nsInt64.h.

                                                {
        return LL_NE(mValue, aObject2.mValue);
    }
template<class T>
PRBool nsTInt64< T >::operator!= ( T  aValue) const [inline]

Definition at line 289 of file nsInt64.h.

                                {
        return LL_NE(mValue, aValue);
    }
template<class T>
const nsTInt64 nsTInt64< T >::operator% ( const nsTInt64< T > &  aObject2) const [inline]

Compute the modulus of two 64-bit integers.

Definition at line 247 of file nsInt64.h.

                                               {
        return nsTInt64(*this) %= aObject2;
    }
template<class T>
nsTInt64& nsTInt64< T >::operator%= ( const nsTInt64< T > &  aObject) [inline]

Compute the modulus of a 64-bit integer to a 64-bit value.

Definition at line 189 of file nsInt64.h.

                                                   {
        LL_MOD(mValue, mValue, aObject.mValue);
        return *this;
    }
template<class T>
const nsTInt64 nsTInt64< T >::operator& ( const nsTInt64< T > &  aObject2) const [inline]

Perform a bitwise AND of two 64-bit integers.

Definition at line 297 of file nsInt64.h.

                                               {
        return nsTInt64(*this) &= aObject2;
    }
template<class T>
nsTInt64& nsTInt64< T >::operator&= ( const nsTInt64< T > &  aObject) [inline]

Compute the bitwise AND with another 64-bit integer.

Definition at line 331 of file nsInt64.h.

                                                   {
        LL_AND(mValue, mValue, aObject.mValue);
        return *this;
    }
template<class T>
const nsTInt64 nsTInt64< T >::operator* ( const nsTInt64< T > &  aObject2) const [inline]

Multiply two 64-bit integers.

Definition at line 231 of file nsInt64.h.

                                               {
        return nsTInt64(*this) *= aObject2;
    }
template<class T>
nsTInt64& nsTInt64< T >::operator*= ( const nsTInt64< T > &  aObject) [inline]

Multiply a 64-bit integer by a 64-bit integer amount.

Definition at line 173 of file nsInt64.h.

                                                   {
        LL_MUL(mValue, mValue, aObject.mValue);
        return *this;
    }
template<class T>
const nsTInt64 nsTInt64< T >::operator+ ( const nsTInt64< T > &  aObject2) const [inline]

Add two 64-bit integers.

Definition at line 215 of file nsInt64.h.

                                               {
        return nsTInt64(*this) += aObject2;
    }
template<class T>
nsTInt64& nsTInt64< T >::operator+= ( const nsTInt64< T > &  aObject) [inline]

Increment a 64-bit integer by a 64-bit integer amount.

Definition at line 157 of file nsInt64.h.

                                                   {
        LL_ADD(mValue, mValue, aObject.mValue);
        return *this;
    }
template<class T>
const nsTInt64 nsTInt64< T >::operator- ( void  ) [inline]

Perform unary negation on a 64-bit integer.

Definition at line 146 of file nsInt64.h.

                                    {
        nsTInt64 result;
        LL_NEG(result.mValue, mValue);
        return result;
    }
template<class T>
const nsTInt64 nsTInt64< T >::operator- ( const nsTInt64< T > &  aObject2) const [inline]

Subtract one 64-bit integer from another.

Definition at line 223 of file nsInt64.h.

                                               {
        return nsTInt64(*this) -= aObject2;
    }
template<class T>
nsTInt64& nsTInt64< T >::operator-= ( const nsTInt64< T > &  aObject) [inline]

Decrement a 64-bit integer by a 64-bit integer amount.

Definition at line 165 of file nsInt64.h.

                                                   {
        LL_SUB(mValue, mValue, aObject.mValue);
        return *this;
    }
template<class T>
const nsTInt64 nsTInt64< T >::operator/ ( const nsTInt64< T > &  aObject2) const [inline]

Divide one 64-bit integer by another.

Definition at line 239 of file nsInt64.h.

                                               {
        return nsTInt64(*this) /= aObject2;
    }
template<class T>
nsTInt64& nsTInt64< T >::operator/= ( const nsTInt64< T > &  aObject) [inline]

Divide a 64-bit integer by a 64-bit integer amount.

Definition at line 181 of file nsInt64.h.

                                                   {
        LL_DIV(mValue, mValue, aObject.mValue);
        return *this;
    }
template<class T>
const nsTInt64 nsTInt64< T >::operator<< ( int  aCount) const [inline]

Shift left a 64-bit integer.

Definition at line 255 of file nsInt64.h.

                                  {
        return nsTInt64(*this) <<= aCount;
    }
template<class T>
nsTInt64& nsTInt64< T >::operator<<= ( int  aCount) [inline]

Shift a 64-bit integer left.

Definition at line 197 of file nsInt64.h.

                                       {
        LL_SHL(mValue, mValue, aCount);
        return *this;
    }
template<class T>
const nsTInt64& nsTInt64< T >::operator= ( const nsTInt64< T > &  aObject) [inline]

Assign a 64-bit integer to another 64-bit integer.

Definition at line 104 of file nsInt64.h.

                                                        {
        mValue = aObject.mValue;
        return *this;
    }
template<class T>
PRBool nsTInt64< T >::operator== ( const nsTInt64< T > &  aObject2) const [inline]

Determine if two 64-bit integers are equal.

Definition at line 271 of file nsInt64.h.

                                                {
        return LL_EQ(mValue, aObject2.mValue);
    }
template<class T>
PRBool nsTInt64< T >::operator== ( T  aValue) const [inline]

Definition at line 276 of file nsInt64.h.

                                {
        return LL_EQ(mValue, aValue);
    }
template<class T>
const nsTInt64 nsTInt64< T >::operator>> ( int  aCount) const [inline]

Shift right a signed 64-bit integer.

Definition at line 263 of file nsInt64.h.

                                  {
        return nsTInt64(*this) >>= aCount;
    }
template<class T>
nsTInt64& nsTInt64< T >::operator>>= ( int  aCount) [inline]

Shift a 64-bit signed integer right.

Definition at line 205 of file nsInt64.h.

                                       {
        LL_SHR(mValue, mValue, aCount);
        return *this;
    }
template<class T>
const nsTInt64 nsTInt64< T >::operator^ ( const nsTInt64< T > &  aObject2) const [inline]

Perform a bitwise XOR of two 64-bit integers.

Definition at line 313 of file nsInt64.h.

                                               {
        return nsTInt64(*this) ^= aObject2;
    }
template<class T>
nsTInt64& nsTInt64< T >::operator^= ( const nsTInt64< T > &  aObject) [inline]

Compute the bitwise XOR with another 64-bit integer.

Definition at line 347 of file nsInt64.h.

                                                   {
        LL_XOR(mValue, mValue, aObject.mValue);
        return *this;
    }
template<class T>
const nsTInt64 nsTInt64< T >::operator| ( const nsTInt64< T > &  aObject2) const [inline]

Perform a bitwise OR of two 64-bit integers.

Definition at line 305 of file nsInt64.h.

                                               {
        return nsTInt64(*this) |= aObject2;
    }
template<class T>
nsTInt64& nsTInt64< T >::operator|= ( const nsTInt64< T > &  aObject) [inline]

Compute the bitwise OR with another 64-bit integer.

Definition at line 339 of file nsInt64.h.

                                                   {
        LL_OR(mValue, mValue, aObject.mValue);
        return *this;
    }
template<class T>
const nsTInt64 nsTInt64< T >::operator~ ( void  ) const [inline]

Compute the bitwise NOT of a 64-bit integer.

Definition at line 322 of file nsInt64.h.

                                          {
        nsTInt64 result;
        LL_NOT(result.mValue, mValue);
        return result;
    }

Member Data Documentation

template<class T>
T nsTInt64< T >::mValue

Definition at line 57 of file nsInt64.h.


The documentation for this class was generated from the following file: