merge with master
[platform/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
38      * pattern.
39      * Function matches each (whole!) line against specified pattern.
40      * @param pattern Perl-like regular expresion used to search through
41      * meminfo.
42      * @return Found value.
43      * @throw PlatformException If could not find meminfo file.
44      * @throw UnsupportedException If pattern didn't match any line in meminfo
45      * file.
46      */
47     unsigned long getMeminfoValue(const char* pattern) const;
48 };
49 } // Memory
50 } // Platform
51 } // WrtPlugins
52
53 #endif /* WRTDEVICEAPIS_MEMORY_MANAGER_H_ */