Initialize Tizen 2.3
[framework/web/wrt-commons.git] / modules_mobile / core / include / dpl / mutable_task_list.h
1 /*
2  * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /*
17  * @file    mutable_task_list.h
18  * @author  Tomasz Iwanek (t.iwanek@samsung.com)
19  * @version 1.0
20  * @brief   Header file for task list
21  */
22 #ifndef DPL_MUTABLE_TASK_LIST_H
23 #define DPL_MUTABLE_TASK_LIST_H
24
25 #include <dpl/task.h>
26 #include <list>
27
28 namespace DPL {
29 class MutableTaskList :
30     public Task
31 {
32     private:
33         typedef std::list<Task *> Tasks;
34
35         Tasks m_tasks;
36         Tasks::iterator m_currentTask;
37
38         bool m_running;
39
40     protected:
41         void AddTask(Task *task);
42
43     public:
44         MutableTaskList();
45         virtual ~MutableTaskList();
46
47         bool NextStep();
48         bool Abort();
49         size_t GetStepCount() const;
50 };
51 } // namespace DPL
52
53 #endif // DPL_MUTABLE_TASK_LIST_H