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 FBaseRtIRunnable.h
20 * @brief This is the header file for the %IRunnable interface.
22 * This header file contains the declarations of the %IRunnable interface.
24 #ifndef _FBASE_RT_I_RUNNABLE_H_
25 #define _FBASE_RT_I_RUNNABLE_H_
27 #include <FBaseResult.h>
28 #include <FBaseObject.h>
31 namespace Tizen { namespace Base { namespace Runtime
34 * @interface IRunnable
35 * @brief This interface is the basic unit of the task. Also, it is the execution unit of
36 * the thread. This interface must be inherited by the class whose instances will
41 * @remarks Classes which inherit the %IRunnable interface must implement the Run() method.
43 * The %IRunnable interface is the basic unit of the task. Also, it is the execution unit of
44 * the thread. This interface must be inherited by the class whose instances will
47 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/thread_programming.htm">Thread Programming</a>.
51 * The following example demonstrates how to use the %IRunnable interface.
57 * using namespace Tizen::Base;
58 * using namespace Tizen::Base::Runtime;
61 * : public Tizen::Base::Object
62 * , public Tizen::Base::Runtime::IRunnable
67 * for (int i = 0; i < 10000; ++i)
81 class _OSP_EXPORT_ IRunnable
85 * This is the destructor for this class.
89 virtual ~IRunnable(void);
93 * This method is an executable body of the task. In many cases, this method is called by the thread.
94 * Although this method can return the result of the execution, the returned value might be discarded
95 * by the executor of this task.
99 * @return A pointer to the result of the task, @n
102 virtual Tizen::Base::Object* Run(void) = 0;
105 } } } // Tizen::Base::Runtime
107 #endif // _FBASE_RT_I_RUNNABLE_H_