kerneltest/f32test/rofs/src/randgen.h
changeset 9 96e5fb8b040d
equal deleted inserted replaced
-1:000000000000 9:96e5fb8b040d
       
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Pseudo-random number generator
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef RANDGEN_H
       
    19 #define RANDGEN_H
       
    20 
       
    21 #if defined(__EPOC32__) || defined (__WINS__)
       
    22 #include <e32std.h>
       
    23 
       
    24 #else
       
    25 typedef	unsigned int	TUint;
       
    26 #endif
       
    27 
       
    28 class TRandomGenerator
       
    29 	{
       
    30 	public:
       
    31 		TRandomGenerator();
       
    32 		inline void SetSeed( const TUint aSeed );
       
    33 		TUint Next();
       
    34 
       
    35 	private:
       
    36 		TUint	iValue;
       
    37 	};
       
    38 
       
    39 inline void TRandomGenerator::SetSeed( const TUint aSeed )
       
    40 	{
       
    41 	iValue = aSeed;
       
    42 	}
       
    43 
       
    44 #endif