sysresmonitoring/oommonitor/src/oomIdletimerule.cpp
changeset 35 13fd6fd25fe7
equal deleted inserted replaced
29:6a787171e1de 35:13fd6fd25fe7
       
     1 /*
       
     2 * Copyright (c) 2006-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:  Configuration representation classes for Out of Memory Monitor.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "oomidletimerule.h"
       
    19 #include "oomwindowgrouplist.h"
       
    20 #include "OomTraces.h"
       
    21 
       
    22 COomIdleTimeRule* COomIdleTimeRule::NewL(TTimeIntervalSeconds aIdleTime, TInt aPriority)
       
    23     {
       
    24     FUNC_LOG;
       
    25 
       
    26     COomIdleTimeRule* self = new (ELeave) COomIdleTimeRule(aIdleTime, aPriority);
       
    27     return self;
       
    28     }
       
    29 
       
    30 TBool COomIdleTimeRule::RuleIsApplicable(const COomWindowGroupList& aWindowGroupList, TInt aAppIndexInWindowGroup) const
       
    31     {
       
    32     FUNC_LOG;
       
    33 
       
    34     TBool applicable = EFalse;
       
    35     if (aAppIndexInWindowGroup >= 0)
       
    36         {
       
    37         applicable = (aWindowGroupList.IdleTime(aAppIndexInWindowGroup) >= iIdleTime);
       
    38         }
       
    39     return applicable;
       
    40     }
       
    41 
       
    42 COomIdleTimeRule::~COomIdleTimeRule()
       
    43     {
       
    44     FUNC_LOG;
       
    45     }
       
    46 
       
    47 COomIdleTimeRule::COomIdleTimeRule(TTimeIntervalSeconds aIdleTime, TInt aPriority) : iIdleTime(aIdleTime), iPriority(aPriority)
       
    48     {
       
    49     FUNC_LOG;
       
    50     }
       
    51