uiacceltk/hitchcock/goommonitor/src/goomapplicationconfig.cpp
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2008 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 Graphics Out of Memory Monitor
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "goomapplicationconfig.h"
       
    20 #include "goomconstants.hrh"
       
    21 #include "goomcloseappconfig.h"
       
    22 #include "goomtraces.h"
       
    23 
       
    24 CGOomApplicationConfig* CGOomApplicationConfig::NewL(TUint aApplicationId)
       
    25     {
       
    26     FUNC_LOG;
       
    27 
       
    28     CGOomApplicationConfig* self = new (ELeave) CGOomApplicationConfig(aApplicationId);
       
    29     CleanupStack::PushL(self);
       
    30     self->ConstructL();
       
    31     CleanupStack::Pop(self);
       
    32     return self;
       
    33     }
       
    34 
       
    35 // Add a rule
       
    36 // This class takes ownership of the given rule
       
    37 // This rule applies to this application itself (and not a plugin associated with this application)
       
    38 // The rule would usually apply to an "application close" event
       
    39 void CGOomApplicationConfig::AddRuleL(MGOomRuleConfig* aRule)
       
    40     {   
       
    41     FUNC_LOG;
       
    42 
       
    43    __ASSERT_ALWAYS(iCloseAppConfig, GOomMonitorPanic(KRuleConfiguredBeforeApplication));
       
    44     
       
    45     iCloseAppConfig->AddRuleL(aRule);
       
    46     }
       
    47 
       
    48 CGOomApplicationConfig::~CGOomApplicationConfig()
       
    49     {
       
    50     FUNC_LOG;
       
    51 
       
    52     delete iCloseAppConfig;
       
    53     }
       
    54 
       
    55 void CGOomApplicationConfig::ConstructL()
       
    56     {
       
    57     FUNC_LOG;
       
    58 
       
    59     iGoodRamThreshold = KGOomThresholdUnset;
       
    60     iLowRamThreshold = KGOomThresholdUnset;  
       
    61     iTargetFree = KGOomThresholdUnset;
       
    62     }
       
    63 
       
    64 CGOomApplicationConfig::CGOomApplicationConfig(TUint aApplicationId) : iApplicationId(aApplicationId)
       
    65     {
       
    66     FUNC_LOG;
       
    67     }