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 FBaseRtIRunnable.h
19 * @brief This is the header file for the %IRunnable interface.
21 * This header file contains the declarations of the %IRunnable interface.
23 #ifndef _FBASE_RT_I_RUNNABLE_H_
24 #define _FBASE_RT_I_RUNNABLE_H_
26 #include <FBaseResult.h>
27 #include <FBaseObject.h>
30 namespace Tizen { namespace Base { namespace Runtime
33 * @interface IRunnable
34 * @brief This interface is the basic unit of the task. Also, it is the execution unit of
35 * the thread. This interface must be inherited by the class whose instances will
40 * @remarks Classes which inherit the %IRunnable interface must implement the Run() method.
42 * The %IRunnable interface is the basic unit of the task. Also, it is the execution unit of
43 * the thread. This interface must be inherited by the class whose instances will
46 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/thread_programming.htm">Thread Programming</a>.
50 * The following example demonstrates how to use the %IRunnable interface.
56 * using namespace Tizen::Base;
57 * using namespace Tizen::Base::Runtime;
60 * : public Tizen::Base::Object
61 * , public Tizen::Base::Runtime::IRunnable
66 * for (int i = 0; i < 10000; ++i)
80 class _OSP_EXPORT_ IRunnable
84 * This is the destructor for this class.
88 virtual ~IRunnable(void);
92 * This method is an executable body of the task. In many cases, this method is called by the thread.
93 * Although this method can return the result of the execution, the returned value might be discarded
94 * by the executor of this task.
98 * @return A pointer to the result of the task, @n
101 virtual Tizen::Base::Object* Run(void) = 0;
104 } } } // Tizen::Base::Runtime
106 #endif // _FBASE_RT_I_RUNNABLE_H_