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.
46 * 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 Tizen::Base::String type runtime information based on the specified designators (key).
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 integer type runtime information based on the specified designators (key).
102 * @return An error code
103 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information @n
105 * The following key values are updated: @n
106 * - Since Tizen, refer <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">here</a>.
107 * - @b Deprecated All the key values provided prior to %Tizen are deprecated. For more detailed information, refer
108 * <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info_deprecated.htm">here</a>.
110 * @param[out] value The integer type runtime information
111 * @exception E_SUCCESS The method is successful.
112 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
113 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
115 static result GetValue(const Tizen::Base::String& key, int& value);
118 * Gets the @c long @c long type runtime information based on the specified designators (key).
122 * @return An error code
123 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information @n
125 * The following key values are updated: @n
126 * - Since Tizen, refer <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">here</a>.
127 * - @b Deprecated All the key values provided prior to %Tizen are deprecated. For more detailed information, refer
128 * <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info_deprecated.htm">here</a>.
129 * @xmlonly <pcheck kind="value" since="1.0" deprecated="yes"> @endxmlonly MaxAllocatableMemory, AvailableVideoMemory @xmlonly </pcheck> @endxmlonly
131 * @param[out] value The @c long @c long type runtime information
132 * @exception E_SUCCESS The method is successful.
133 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
134 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
136 static result GetValue(const Tizen::Base::String& key, long long& value);
139 * Gets the double type runtime information based on the specified designators (key).
143 * @return An error code
144 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
145 * @param[out] value The @c double type runtime information
146 * @exception E_SUCCESS The method is successful.
147 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
148 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
150 static result GetValue(const Tizen::Base::String& key, double& value);
153 * Gets the @c bool type runtime information based on the specified designators (key).
157 * @return An error code
158 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
159 * @param[out] value The @c bool type runtime information
160 * @exception E_SUCCESS The method is successful.
161 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
162 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
164 static result GetValue(const Tizen::Base::String& key, bool& value);
167 * Gets the UuId type runtime information based on the specified designators (key).
171 * @return An error code
172 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
173 * @param[out] value The UuId type runtime information
174 * @exception E_SUCCESS The method is successful.
175 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
176 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
178 static result GetValue(const Tizen::Base::String& key, Tizen::Base::UuId& value);
181 * Gets the @c long @c long type runtime information based on specified designators (key) asynchronously.
185 * @return An error code
186 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
187 * @param[in] listener The result listener
188 * @exception E_SUCCESS The method is successful.
189 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
190 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
192 static result GetValueAsync(const Tizen::Base::String& key, IRuntimeInfoGetLonglongAsyncResultListener* listener);
195 * Gets the @c int type runtime information based on specified designators (key) asynchronously.
199 * @return An error code
200 * @param[in] key The <a href="../org.tizen.native.appprogramming/html/guide/system/runtime_info.htm">key name</a> of the runtime information
201 * @param[in] listener The result listener
202 * @exception E_SUCCESS The method is successful.
203 * @exception E_OBJ_NOT_FOUND The specified @c key is not found.
204 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
206 static result GetValueAsync(const Tizen::Base::String& key, IRuntimeInfoGetIntAsyncResultListener* listener);
210 * 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.
215 * This is the destructor for this class. This destructor overrides Tizen::Base::Object::~Object().
217 virtual ~RuntimeInfo(void);
220 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
222 RuntimeInfo(const RuntimeInfo& value);
225 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
227 RuntimeInfo& operator =(const RuntimeInfo& value);
230 friend class _RuntimeInfoImpl;
231 class _RuntimeInfoImpl* __pRuntimeInfoImpl;
236 #endif // _FSYS_RUNTIME_INFO_H_