equal
deleted
inserted
replaced
|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "cxememorymonitor.h" |
|
19 #include "cxememorymonitorprivate.h" |
|
20 |
|
21 /*! |
|
22 * Constructor |
|
23 */ |
|
24 CxeMemoryMonitor::CxeMemoryMonitor(CxeFeatureManager &features) |
|
25 { |
|
26 p = new CxeMemoryMonitorPrivate(features); |
|
27 } |
|
28 |
|
29 /*! |
|
30 * Destructor |
|
31 */ |
|
32 CxeMemoryMonitor::~CxeMemoryMonitor() |
|
33 { |
|
34 delete p; |
|
35 } |
|
36 |
|
37 /*! |
|
38 * Get the amount of free memory (RAM). |
|
39 * @return Free RAM in bytes. |
|
40 */ |
|
41 int CxeMemoryMonitor::free() const |
|
42 { |
|
43 return p->free(); |
|
44 } |
|
45 |
|
46 /*! |
|
47 * Request to free memory (RAM) to achieve asked level. |
|
48 * @param required Required free memory after this call. |
|
49 * @return Was it possible to achieve the required level of free memory. |
|
50 */ |
|
51 bool CxeMemoryMonitor::requestFreeMemory(int required) |
|
52 { |
|
53 return p->requestFreeMemory(required); |
|
54 } |
|
55 |
|
56 /*! |
|
57 * Slot to start monitoring free memory. |
|
58 */ |
|
59 void CxeMemoryMonitor::startMonitoring() |
|
60 { |
|
61 p->startMonitoring(); |
|
62 } |
|
63 |
|
64 /*! |
|
65 * Slot to stop monitoring free memory. |
|
66 */ |
|
67 void CxeMemoryMonitor::stopMonitoring() |
|
68 { |
|
69 p->stopMonitoring(); |
|
70 } |
|
71 |
|
72 // end of file |