usbmgmt/usbmgr/device/classdrivers/ncm/classimplementation/ncmpktdrv/pktdrv/inc/ncmntbbuildsimplepolicy.h
branchRCL_3
changeset 15 f92a4f87e424
equal deleted inserted replaced
14:d3e8e7d462dd 15:f92a4f87e424
       
     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 * Header file for simple NTB build policy
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21 @file
       
    22 @internalComponent
       
    23 */
       
    24 
       
    25 
       
    26 #ifndef NCMNTBBUILDSIMPLEPOLICY_H
       
    27 #define NCMNTBBUILDSIMPLEPOLICY_H
       
    28 
       
    29 
       
    30 #include <e32base.h>
       
    31 #include "ncmntbbuildpolicy.h"
       
    32 
       
    33 
       
    34 /**
       
    35 * a simple build policy, fix packets count in a NTB and a timer to restrict maxiam time delay
       
    36 */
       
    37 
       
    38 NONSHARABLE_CLASS(CNcmNtbBuildSimplePolicy) : public CNcmNtbBuildPolicy
       
    39     {
       
    40 public:
       
    41     static CNcmNtbBuildPolicy* NewL(CNcmNtbBuilder& aPolicy);
       
    42     ~CNcmNtbBuildSimplePolicy();
       
    43 
       
    44 public:
       
    45     /**
       
    46     derived from CNcmNtbBuildPolicy
       
    47     */
       
    48     virtual void StartNewNtb();
       
    49     virtual void UpdateNtb(TInt aSize);
       
    50     virtual void CompleteNtbBuild();
       
    51 	
       
    52 	virtual void UpdateBufferSize(TInt aSize);
       
    53     virtual void UpdateFreeBufferCount(TInt aCount);
       
    54 	virtual void UpdateTotalBufferCount(TInt aCount);
       
    55 
       
    56 private:    
       
    57     void RunL();
       
    58     void DoCancel();
       
    59     void ConstructL();
       
    60     CNcmNtbBuildSimplePolicy(CNcmNtbBuilder& aPolicy);
       
    61     /**
       
    62     * timer for maxiam packet time delay
       
    63     */        
       
    64     RTimer iTimer;
       
    65     /**
       
    66     * packets number in current NTB
       
    67     */    
       
    68     TInt iPacketsCount;
       
    69 	TInt iTotalBufferCount;
       
    70 	TInt iFreeBufferCount;
       
    71 	TInt iBufferSize;
       
    72     
       
    73 };
       
    74 
       
    75 
       
    76 #endif //NCMNTBBUILDSIMPLEPOLICY_H
       
    77