2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FSysRuntimeInfo.h
20 * @brief This is the header file for the %RuntimeInfo class.
22 * This header file contains the declarations of the %RuntimeInfo class.
25 #ifndef _FSYS_RUNTIME_INFO_H_
26 #define _FSYS_RUNTIME_INFO_H_
28 #include <FBaseString.h>
29 #include <FBaseUuId.h>
30 #include <FBaseColIList.h>
32 namespace Tizen { namespace System
35 class IRuntimeInfoGetIntAsyncResultListener;
36 class IRuntimeInfoGetLonglongAsyncResultListener;
40 * @brief This class provides methods for getting runtime information.
44 * @final This class is not intended for extension.
46 * 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>.
48 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">Runtime Information</a>.
50 * The following example demonstrates how to use the %RuntimeInfo class.
53 * #include <FSystem.h>
55 * using namespace Tizen::Base;
56 * using namespace Tizen::System;
59 * MyClass::GetAllocatedMemory(void)
61 * result r = E_SUCCESS;
63 * String key(L"http://tizen.org/runtime/memory.allocated");
64 * long long allocatedMemory = 0;
66 * r = RuntimeInfo::GetValue(key, allocatedMemory);
67 * TryCatch(r == E_SUCCESS, , "MyRuntimeInfo: Failed to get value");
78 class _OSP_EXPORT_ RuntimeInfo
79 : public Tizen::Base::Object
84 * Gets the specific Tizen::Base::String type runtime information based on the specified
89 * @return An error code
90 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
91 * @param[out] value The runtime information of type Tizen::Base::String
92 * @exception E_SUCCESS The method is successful.
93 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
94 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
96 static result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
99 * Gets the specific integer type runtime information based on the specified
104 * @return An error code
105 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information @n
107 * The following key values are updated: @n
108 * - Since Tizen, refer <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">here</a>.
109 * - @b Deprecated All the key values provided prior to %Tizen are deprecated. For more detailed information, refer
110 * <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info_deprecated.htm">here</a>.
112 * @param[out] value The integer type runtime information
113 * @exception E_SUCCESS The method is successful.
114 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
115 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
117 static result GetValue(const Tizen::Base::String& key, int& value);
120 * Gets the specific @c long @c long type runtime information based on the specified
125 * @return An error code
126 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information @n
128 * The following key values are updated: @n
129 * - Since Tizen, refer <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">here</a>.
130 * - @b Deprecated All the key values provided prior to %Tizen are deprecated. For more detailed information, refer
131 * <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info_deprecated.htm">here</a>.
132 * @xmlonly <pcheck kind="value" since="1.0" deprecated="yes"> @endxmlonly MaxAllocatableMemory, AvailableVideoMemory @xmlonly </pcheck> @endxmlonly
134 * @param[out] value The @c long @c long type runtime information
135 * @exception E_SUCCESS The method is successful.
136 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
137 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
139 static result GetValue(const Tizen::Base::String& key, long long& value);
142 * Gets the specific double type runtime information based on the specified
147 * @return An error code
148 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
149 * @param[out] value The @c double type runtime information
150 * @exception E_SUCCESS The method is successful.
151 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
152 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
154 static result GetValue(const Tizen::Base::String& key, double& value);
157 * Gets the specific @c bool type runtime information based on the specified
162 * @return An error code
163 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
164 * @param[out] value The @c bool type runtime information
165 * @exception E_SUCCESS The method is successful.
166 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
167 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
169 static result GetValue(const Tizen::Base::String& key, bool& value);
172 * Gets the specific UuId type runtime information based on the specified
177 * @return An error code
178 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
179 * @param[out] value The UuId type runtime information
180 * @exception E_SUCCESS The method is successful.
181 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
182 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
184 static result GetValue(const Tizen::Base::String& key, Tizen::Base::UuId& value);
187 * Gets the specific @c long @c long type runtime information based on specified designators (key) asynchronously.
191 * @return An error code
192 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
193 * @param[in] listener The result listener
194 * @exception E_SUCCESS The method is successful.
195 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
196 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
198 static result GetValueAsync(const Tizen::Base::String& key, IRuntimeInfoGetLonglongAsyncResultListener* listener);
201 * Gets the specific @c int type runtime information based on specified designators (key) asynchronously.
205 * @return An error code
206 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
207 * @param[in] listener The result listener
208 * @exception E_SUCCESS The method is successful.
209 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
210 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
212 static result GetValueAsync(const Tizen::Base::String& key, IRuntimeInfoGetIntAsyncResultListener* listener);
216 * 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.
221 * This is the destructor for this class. This destructor overrides Tizen::Base::Object::~Object().
223 virtual ~RuntimeInfo(void);
226 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
228 RuntimeInfo(const RuntimeInfo& value);
231 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
233 RuntimeInfo& operator =(const RuntimeInfo& value);
236 friend class _RuntimeInfoImpl;
237 class _RuntimeInfoImpl* __pRuntimeInfoImpl;
242 #endif // _FSYS_RUNTIME_INFO_H_