Nokia N97 SDK
Example Applications Guide

MemoryRequester.h

00001 /*
00002  * ============================================================================
00003  *  Name        : MemoryRequester.h
00004  *  Part of     : OomMonitor Example Application
00005  *  Description : ?Description
00006  *  Version     : %version: 1 % << Don't touch! Updated by Synergy at check-out.
00007  *
00008  *  Copyright © 2009 Nokia.  All rights reserved.
00009  *  This material, including documentation and any related computer
00010  *  programs, is protected by copyright controlled by Nokia.  All
00011  *  rights are reserved.  Copying, including reproducing, storing,
00012  *  adapting or translating, any or all of this material requires the
00013  *  prior written consent of Nokia.  This material also contains
00014  *  confidential information which may not be disclosed to others
00015  *  without the prior written consent of Nokia.
00016  * ============================================================================
00017  * Template version: 4.2
00018  */
00019 
00020 #ifndef MEMORYREQUESTER_H_
00021 #define MEMORYREQUESTER_H_
00022 
00023 #include <e32base.h>
00024 
00025 class ROomMonitorSession;
00026 
00027 class MMemoryRequesterObserver
00028     {
00029 public:
00030     virtual void MemoryRequestCompleteL(TInt aResult)=0;
00031     };
00032 
00033 /**
00034  * An Active Object which wraps up the asynchronous call to the 
00035  * OomMonitor to request free memory.
00036  */
00037 class CMemoryRequester: public CActive
00038 {
00039 public: 
00040     ~CMemoryRequester();
00041     
00042     static CMemoryRequester* NewL(ROomMonitorSession& aOomMonitorSession,
00043             MMemoryRequesterObserver& aObserver);
00044     
00045     void Start(TInt aBytesRequested);
00046     
00047 private:
00048     CMemoryRequester(ROomMonitorSession& aOomMonitorSession,
00049             MMemoryRequesterObserver& aObserver);
00050     
00051     void RunL();
00052     
00053     void DoCancel();
00054 
00055 private:
00056     /*
00057      * A handle to the Oom Monitor session, already connected.
00058      */
00059     ROomMonitorSession& iOomMonitorSession;
00060 
00061     /*
00062      * Observer class to callback into when the request is complete
00063      */    
00064     MMemoryRequesterObserver& iObserver;
00065 };
00066 
00067 #endif /* MEMORYREQUESTER_H_ */

© Nokia 2009

Back to top