a40608c222ea12896fbbd1c4da4ec617056db3d7
[framework/web/wrt-plugins-common.git] / src / modules / tizen / DEPRACATED / Memory / Manager.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *    Licensed under the Apache License, Version 2.0 (the "License");
5  *    you may not use this file except in compliance with the License.
6  *    You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *    Unless required by applicable law or agreed to in writing, software
11  *    distributed under the License is distributed on an "AS IS" BASIS,
12  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *    See the License for the specific language governing permissions and
14  *    limitations under the License.
15  */
16 #ifndef WRTDEVICEAPIS_MEMORY_MANAGER_H_
17 #define WRTDEVICEAPIS_MEMORY_MANAGER_H_
18
19 #include <API/Memory/IManager.h>
20
21 namespace WrtPlugins {
22 namespace Platform {
23 namespace Memory {
24 class Manager : public Api::Memory::IManager
25 {
26   public:
27     static Manager& getInstance();
28
29   public:
30     unsigned long getTotal() const;
31     unsigned long getFree() const;
32
33   private:
34     Manager();
35
36     /**
37      * Reads value from meminfo file looking it up using specified regex pattern.
38      * Function matches each (whole!) line against specified pattern.
39      * @param pattern Perl-like regular expresion used to search through meminfo.
40      * @return Found value.
41      * @throw PlatformException If could not find meminfo file.
42      * @throw UnsupportedException If pattern didn't match any line in meminfo file.
43      */
44     unsigned long getMeminfoValue(const char* pattern) const;
45 };
46 } // Memory
47 } // Platform
48 } // WrtPlugins
49
50 #endif /* WRTDEVICEAPIS_MEMORY_MANAGER_H_ */