loadgen/inc/loadgen_cpuload.h
changeset 0 d6fe6244b863
equal deleted inserted replaced
-1:000000000000 0:d6fe6244b863
       
     1 /*
       
     2 * Copyright (c) 2009 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 "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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef LOADGEN_CPULOAD_H
       
    20 #define LOADGEN_CPULOAD_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 
       
    26 #include "loadgen_loadbase.h"
       
    27 #include "loadgen_loadattributes.h"
       
    28 
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 
       
    32 
       
    33 
       
    34 // CLASS DECLARATIONS
       
    35 
       
    36 class CCPULoad : public CLoadBase
       
    37     {
       
    38 public:
       
    39     static CCPULoad* NewL(TCPULoadAttributes& aAttributes, TInt aReferenceNumber);
       
    40     virtual ~CCPULoad();
       
    41         
       
    42 private: // Constructors
       
    43     CCPULoad(TCPULoadAttributes& aAttributes, TInt aReferenceNumber);
       
    44     void ConstructL();  
       
    45 
       
    46 public:  // New methods
       
    47     virtual void Resume();
       
    48     virtual void Suspend();
       
    49     virtual void SetPriority();
       
    50     virtual void Close();
       
    51     virtual TPtrC Description();
       
    52     inline TCPULoadAttributes& Attributes() { return iAttributes; }
       
    53 
       
    54 public:  // New static methods
       
    55     static TInt ThreadFunction(TAny* aThreadArg);
       
    56 
       
    57 private:  // New static methods
       
    58     static void GenerateLoad(TCPULoadAttributes& aAttributes);
       
    59     static void DoHeaveStuff(TInt aMode);
       
    60 
       
    61 private: // Data
       
    62     TCPULoadAttributes      iAttributes;    
       
    63     RThread                 iThread;
       
    64     };
       
    65  
       
    66 
       
    67 #endif