wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacPRNGenerator.h
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Declaration of the WlanPRNGenerator class.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 6 %
       
    20 */
       
    21 
       
    22 #ifndef WLANPNRGENERATOR_H
       
    23 #define WLANPNRGENERATOR_H
       
    24 
       
    25 /**
       
    26 *  Class implements a pseudorandom number generator of 32 bit unsigned integers
       
    27 *
       
    28 *  Full periodic PRN generator. 
       
    29 *  All the numbers between 0 and 2pow31 - 1 are generated before repeating.
       
    30 *  Executes efficiently with 32-bit arithmetic
       
    31 *
       
    32 *  @lib wlanumac.lib
       
    33 *  @since S60 v3.1
       
    34 */
       
    35 class WlanPRNGenerator
       
    36     {
       
    37     enum { EMultiplier = 16807 /* 7pow5 */};
       
    38     enum { EModulus = 2147483647 /* 2pow31 - 1 */};
       
    39 
       
    40 public:
       
    41 
       
    42     /**
       
    43     * C++ default constructor.
       
    44     */
       
    45     inline WlanPRNGenerator();
       
    46 
       
    47     /**
       
    48     * PRN generation function.
       
    49     * @since S60 3.1
       
    50     * @return generated PRN
       
    51     */
       
    52     inline TUint32 Generate();
       
    53                         
       
    54 private:
       
    55 
       
    56     // Prohibit copy constructor
       
    57     WlanPRNGenerator( const WlanPRNGenerator& );
       
    58     // Prohibit assigment operator
       
    59     WlanPRNGenerator& operator= ( const WlanPRNGenerator& );   
       
    60 
       
    61 private: // Data
       
    62 
       
    63     /** PRN value */
       
    64     TUint32 iValue;
       
    65     };
       
    66 
       
    67 #include "UmacPRNGenerator.inl"
       
    68 
       
    69 #endif      // WLANPNRGENERATOR_H