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