2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file FSysRuntimeInfo.h
19 * @brief This is the header file for the %RuntimeInfo class.
21 * This header file contains the declarations of the %RuntimeInfo class.
24 #ifndef _FSYS_RUNTIME_INFO_H_
25 #define _FSYS_RUNTIME_INFO_H_
27 #include <FBaseString.h>
28 #include <FBaseUuId.h>
29 #include <FBaseColIList.h>
31 namespace Tizen { namespace System
34 class IRuntimeInfoGetIntAsyncResultListener;
35 class IRuntimeInfoGetLonglongAsyncResultListener;
39 * @brief This class provides methods for getting runtime information.
43 * @final This class is not intended for extension.
45 * The %RuntimeInfo class provides runtime information, such as the allocated memory used by the application storage, memory, and CPU utilization. To get the information, you must provide the <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">RuntimeInfo key</a>.
47 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">Runtime Information</a>.
49 * The following example demonstrates how to use the %RuntimeInfo class.
52 * #include <FSystem.h>
54 * using namespace Tizen::Base;
55 * using namespace Tizen::System;
58 * MyClass::GetAllocatedMemory(void)
60 * result r = E_SUCCESS;
62 * String key(L"http://tizen.org/runtime/memory.allocated");
63 * long long allocatedMemory = 0;
65 * r = RuntimeInfo::GetValue(key, allocatedMemory);
66 * TryCatch(r == E_SUCCESS, , "MyRuntimeInfo: Failed to get value");
77 class _OSP_EXPORT_ RuntimeInfo
78 : public Tizen::Base::Object
83 * Gets the specific Tizen::Base::String type runtime information based on the specified
88 * @return An error code
89 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
90 * @param[out] value The runtime information of type Tizen::Base::String
91 * @exception E_SUCCESS The method is successful.
92 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
93 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
95 static result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
98 * Gets the specific integer type runtime information based on the specified
103 * @return An error code
104 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information @n
106 * The following key values are updated: @n
107 * - Since Tizen, refer <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">here</a>.
108 * - @b Deprecated All the key values provided prior to %Tizen are deprecated. For more detailed information, refer
109 * <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info_deprecated.htm">here</a>.
111 * @param[out] value The integer type runtime information
112 * @exception E_SUCCESS The method is successful.
113 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
114 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
116 static result GetValue(const Tizen::Base::String& key, int& value);
119 * Gets the specific @c long @c long type runtime information based on the specified
124 * @return An error code
125 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information @n
127 * The following key values are updated: @n
128 * - Since Tizen, refer <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">here</a>.
129 * - @b Deprecated All the key values provided prior to %Tizen are deprecated. For more detailed information, refer
130 * <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info_deprecated.htm">here</a>.
131 * @xmlonly <pcheck kind="value" since="1.0" deprecated="yes"> @endxmlonly MaxAllocatableMemory, AvailableVideoMemory @xmlonly </pcheck> @endxmlonly
133 * @param[out] value The @c long @c long type runtime information
134 * @exception E_SUCCESS The method is successful.
135 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
136 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
138 static result GetValue(const Tizen::Base::String& key, long long& value);
141 * Gets the specific double type runtime information based on the specified
146 * @return An error code
147 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
148 * @param[out] value The @c double type runtime information
149 * @exception E_SUCCESS The method is successful.
150 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
151 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
153 static result GetValue(const Tizen::Base::String& key, double& value);
156 * Gets the specific @c bool type runtime information based on the specified
161 * @return An error code
162 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
163 * @param[out] value The @c bool type runtime information
164 * @exception E_SUCCESS The method is successful.
165 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
166 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
168 static result GetValue(const Tizen::Base::String& key, bool& value);
171 * Gets the specific UuId type runtime information based on the specified
176 * @return An error code
177 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
178 * @param[out] value The UuId type runtime information
179 * @exception E_SUCCESS The method is successful.
180 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
181 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
183 static result GetValue(const Tizen::Base::String& key, Tizen::Base::UuId& value);
186 * Gets the specific @c long @c long type runtime information based on specified designators (key) asynchronously.
190 * @return An error code
191 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
192 * @param[in] listener The result listener
193 * @exception E_SUCCESS The method is successful.
194 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
195 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
197 static result GetValueAsync(const Tizen::Base::String& key, IRuntimeInfoGetLonglongAsyncResultListener* listener);
200 * Gets the specific @c int type runtime information based on specified designators (key) asynchronously.
204 * @return An error code
205 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
206 * @param[in] listener The result listener
207 * @exception E_SUCCESS The method is successful.
208 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
209 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
211 static result GetValueAsync(const Tizen::Base::String& key, IRuntimeInfoGetIntAsyncResultListener* listener);
215 * This is the default constructor for this class. This default constructor is intentionally declared as private so that only the platform can create an instance.
220 * This is the destructor for this class. This destructor overrides Tizen::Base::Object::~Object().
222 virtual ~RuntimeInfo(void);
225 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
227 RuntimeInfo(const RuntimeInfo& value);
230 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
232 RuntimeInfo& operator =(const RuntimeInfo& value);
235 friend class _RuntimeInfoImpl;
236 class _RuntimeInfoImpl* __pRuntimeInfoImpl;
241 #endif // _FSYS_RUNTIME_INFO_H_