Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes
RandomStream Class Reference
Inheritance diagram for RandomStream:
Inheritance graph
[legend]
Collaboration diagram for RandomStream:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RandomStream (PRUint32 aSeed)
PRUint32 GetStartSeed ()
PRUint32 Next ()
void Read (char *aBuf, PRUint32 aCount)
PRBool Match (char *aBuf, PRUint32 aCount)
void Skip (PRUint32 aCount)

Protected Attributes

PRUint32 mState
PRUint32 mStartSeed

Detailed Description

Definition at line 71 of file TestWriteStream.cpp.


Constructor & Destructor Documentation

RandomStream::RandomStream ( PRUint32  aSeed) [inline]

Definition at line 73 of file TestWriteStream.cpp.

                                 {
        mStartSeed = mState = aSeed;
    }

Member Function Documentation

Definition at line 77 of file TestWriteStream.cpp.

                            {
        return mStartSeed;
    }
PRBool RandomStream::Match ( char *  aBuf,
PRUint32  aCount 
) [inline, virtual]

Implements nsITestDataStream.

Definition at line 94 of file TestWriteStream.cpp.

                                       {
        PRUint32 i;
        for (i = 0; i < aCount; i++) {
            if (*aBuf++ != (char)(Next() & 0xff))
                return PR_FALSE;
        }
        return PR_TRUE;
    }

Here is the call graph for this function:

PRUint32 RandomStream::Next ( ) [inline, virtual]

Implements nsITestDataStream.

Definition at line 81 of file TestWriteStream.cpp.

                    {
        mState = 1103515245 * mState + 12345;
        return mState;
    }

Here is the caller graph for this function:

void RandomStream::Read ( char *  aBuf,
PRUint32  aCount 
) [inline, virtual]

Implements nsITestDataStream.

Definition at line 86 of file TestWriteStream.cpp.

                                           {
        PRUint32 i;
        for (i = 0; i < aCount; i++) {
            *aBuf++ = Next();
        }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void RandomStream::Skip ( PRUint32  aCount) [inline, virtual]

Implements nsITestDataStream.

Definition at line 104 of file TestWriteStream.cpp.

                          {
        while (aCount--)
            Next();
    }

Here is the call graph for this function:


Member Data Documentation

Definition at line 112 of file TestWriteStream.cpp.

Definition at line 111 of file TestWriteStream.cpp.


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