uiacceltk/hitchcock/plugins/alfoogmplugin/src/alfoogmplugin.cpp
changeset 0 15bf7259bb7c
child 11 46927d61fef3
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2009 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:  OOM plugin for ALFserver.
       
    15 *
       
    16 */
       
    17 
       
    18 #include <ecom/ecom.h>
       
    19 #include <ecom/implementationproxy.h>
       
    20 #include <goommonitorplugin.h>
       
    21 #include <w32std.h>
       
    22 
       
    23 #include <alf/alfdirectclient.h>
       
    24 
       
    25 class CAlfOogmMonitorPlugin : public CGOomMonitorPlugin
       
    26     {
       
    27 public:
       
    28     CAlfOogmMonitorPlugin();
       
    29     ~CAlfOogmMonitorPlugin();
       
    30     void ConstructL();
       
    31 
       
    32 public:
       
    33     void FreeRam(TInt aBytesToFree);
       
    34     void MemoryGood();
       
    35 
       
    36 private:
       
    37     RAlfDirectClient iAlfDirectClient;
       
    38     };
       
    39 
       
    40 // -----------------------------------------------------------------------------
       
    41 // C++ constructor.
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 CAlfOogmMonitorPlugin::CAlfOogmMonitorPlugin()
       
    45     {
       
    46     }
       
    47 
       
    48 // -----------------------------------------------------------------------------
       
    49 // Destructor.
       
    50 // -----------------------------------------------------------------------------
       
    51 //
       
    52 CAlfOogmMonitorPlugin::~CAlfOogmMonitorPlugin()
       
    53     {
       
    54     
       
    55     }
       
    56 
       
    57 // -----------------------------------------------------------------------------
       
    58 // Symbian two-phased constructor (2nd phase).
       
    59 // -----------------------------------------------------------------------------
       
    60 //
       
    61 void CAlfOogmMonitorPlugin::ConstructL()
       
    62     {
       
    63     CGOomMonitorPluginBase::ConstructL();
       
    64     }
       
    65 
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // Tries to free RAM.
       
    69 // -----------------------------------------------------------------------------
       
    70 //
       
    71 void CAlfOogmMonitorPlugin::FreeRam(TInt aBytesToFree)
       
    72     {
       
    73  	iAlfDirectClient.EnableLowMemoryState(aBytesToFree);
       
    74     }
       
    75 
       
    76 // -----------------------------------------------------------------------------
       
    77 // CAlfOogmMonitorPlugin::MemoryGood
       
    78 // -----------------------------------------------------------------------------
       
    79 //
       
    80 void CAlfOogmMonitorPlugin::MemoryGood()
       
    81     {
       
    82     iAlfDirectClient.EnableLowMemoryState(EFalse);	
       
    83     }
       
    84 
       
    85 // -----------------------------------------------------------------------------
       
    86 // Creates plugin.
       
    87 // -----------------------------------------------------------------------------
       
    88 //
       
    89 TAny* CreatePlugin()
       
    90     {
       
    91     CAlfOogmMonitorPlugin* plugin = new(ELeave) CAlfOogmMonitorPlugin;
       
    92     CleanupStack::PushL(plugin);
       
    93     plugin->ConstructL();
       
    94     CleanupStack::Pop(plugin);
       
    95     return plugin;
       
    96     }
       
    97 
       
    98 // -----------------------------------------------------------------------------
       
    99 // Implementation table for plugin.
       
   100 // -----------------------------------------------------------------------------
       
   101 //
       
   102 const TImplementationProxy ImplementationTable[] =
       
   103     {
       
   104     {{0xE4B6C988}, ::CreatePlugin}
       
   105     };
       
   106 
       
   107 // -----------------------------------------------------------------------------
       
   108 // ImplementationGroupProxy
       
   109 // -----------------------------------------------------------------------------
       
   110 //
       
   111 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
   112     {
       
   113     aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ;
       
   114     return ImplementationTable;
       
   115     }
       
   116 
       
   117 // End of file
       
   118