sysresmonitoring/oommonitor/src/oomapplicationconfig.cpp
branchRCL_3
changeset 1 0fdb7f6b0309
child 2 7645e9ce10dc
equal deleted inserted replaced
0:2e3d3ce01487 1:0fdb7f6b0309
       
     1 /*
       
     2 * Copyright (c) 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 "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 
       
    19 
       
    20 #include "oomapplicationconfig.h"
       
    21 #include "oomconstants.hrh"
       
    22 #include "oomcloseappconfig.h"
       
    23 #include "oomtraces.h"
       
    24 
       
    25 COomApplicationConfig* COomApplicationConfig::NewL(TUint aApplicationId)
       
    26     {
       
    27     FUNC_LOG;
       
    28 
       
    29     COomApplicationConfig* self = new (ELeave) COomApplicationConfig(aApplicationId);
       
    30     CleanupStack::PushL(self);
       
    31     self->ConstructL();
       
    32     CleanupStack::Pop(self);
       
    33     return self;
       
    34     }
       
    35 
       
    36 // Add a rule
       
    37 // This class takes ownership of the given rule
       
    38 // This rule applies to this application itself (and not a plugin associated with this application)
       
    39 // The rule would usually apply to an "application close" event
       
    40 void COomApplicationConfig::AddRuleL(MOomRuleConfig* aRule)
       
    41     {   
       
    42     FUNC_LOG;
       
    43 
       
    44    __ASSERT_ALWAYS(iCloseAppConfig, OomMonitorPanic(KRuleConfiguredBeforeApplication));
       
    45     
       
    46     iCloseAppConfig->AddRuleL(aRule);
       
    47     }
       
    48 
       
    49 COomApplicationConfig::~COomApplicationConfig()
       
    50     {
       
    51     FUNC_LOG;
       
    52 
       
    53     delete iCloseAppConfig;
       
    54     }
       
    55 
       
    56 void COomApplicationConfig::ConstructL()
       
    57     {
       
    58     FUNC_LOG;
       
    59 
       
    60     iGoodRamThreshold = KOomThresholdUnset;
       
    61     iLowRamThreshold = KOomThresholdUnset;  
       
    62     }
       
    63 
       
    64 COomApplicationConfig::COomApplicationConfig(TUint aApplicationId) : iApplicationId(aApplicationId)
       
    65     {
       
    66     FUNC_LOG;
       
    67     }