ad33f964b3273e65e97635426f780110035596db
[platform/core/uifw/dali-core.git] / dali / public-api / render-tasks / render-task-list.h
1 #ifndef DALI_RENDER_TASK_LIST_H
2 #define DALI_RENDER_TASK_LIST_H
3
4 /*
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <cstdint> // uint32_t
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/object/base-handle.h>
26
27 namespace Dali
28 {
29 /**
30  * @addtogroup dali_core_rendering_effects
31  * @{
32  */
33
34 class RenderTask;
35
36 namespace Internal DALI_INTERNAL
37 {
38 class RenderTaskList;
39 }
40
41 /**
42  * @brief An ordered list of Dali::RenderTask%s.
43  *
44  * These tasks describe how the Dali scene should be rendered; @see Dali::RenderTask for more details.
45  * @SINCE_1_0.0
46  */
47 class DALI_CORE_API RenderTaskList : public BaseHandle
48 {
49 public:
50   /**
51    * @brief Creates an empty RenderTaskList handle.
52    *
53    * This can be initialised with Stage::GetRenderTaskList().
54    * @SINCE_1_0.0
55    */
56   RenderTaskList();
57
58   /**
59    * @brief Downcasts a handle to RenderTaskList handle.
60    *
61    * If handle points to a RenderTaskList the downcast produces valid
62    * handle. If not, the returned handle is left uninitialized.
63    *
64    * @SINCE_1_0.0
65    * @param[in] handle A handle to an object
66    * @return A handle to a RenderTaskList or an uninitialized handle
67    */
68   static RenderTaskList DownCast(BaseHandle handle);
69
70   /**
71    * @brief Destructor.
72    *
73    * This is non-virtual since derived Handle types must not contain data or virtual methods.
74    * @SINCE_1_0.0
75    */
76   ~RenderTaskList();
77
78   /**
79    * @brief This copy constructor is required for (smart) pointer semantics.
80    *
81    * @SINCE_1_0.0
82    * @param [in] handle A reference to the copied handle
83    */
84   RenderTaskList(const RenderTaskList& handle);
85
86   /**
87    * @brief This assignment operator is required for (smart) pointer semantics.
88    *
89    * @SINCE_1_0.0
90    * @param [in] rhs A reference to the copied handle
91    * @return A reference to this
92    */
93   RenderTaskList& operator=(const RenderTaskList& rhs);
94
95   /**
96    * @brief Move constructor.
97    *
98    * @SINCE_1_9.22
99    * @param[in] rhs A reference to the moved handle
100    */
101   RenderTaskList(RenderTaskList&& rhs);
102
103   /**
104    * @brief Move assignment operator.
105    *
106    * @SINCE_1_9.22
107    * @param[in] rhs A reference to the moved handle
108    * @return A reference to this handle
109    */
110   RenderTaskList& operator=(RenderTaskList&& rhs);
111
112   /**
113    * @brief Creates a new RenderTask.
114    *
115    * This will be appended to the list of render-tasks.
116    * @SINCE_1_0.0
117    * @return A valid handle to a new RenderTask
118    */
119   RenderTask CreateTask();
120
121   /**
122    * @brief Removes a RenderTask from the list of render-tasks.
123    * @SINCE_1_0.0
124    * @param[in] task The render-task to remove.
125    */
126   void RemoveTask(RenderTask task);
127
128   /**
129    * @brief Queries the number of render-tasks in the list.
130    *
131    * This is ordered i.e. the task with index 0 is the first to be processed each frame.
132    * @SINCE_1_0.0
133    * @return The number of render-tasks
134    */
135   uint32_t GetTaskCount() const;
136
137   /**
138    * @brief Retrieves a render-task.
139    *
140    * @SINCE_1_0.0
141    * @param[in] index The index of the render task to retrieve
142    * @return A handle to the render-task
143    * @pre index should be in range i.e. less than GetTaskCount().
144    */
145   RenderTask GetTask(uint32_t index) const;
146
147 public: // Not intended for application developers
148   /// @cond internal
149   /**
150    * @brief This constructor is used by Dali New() methods.
151    *
152    * @SINCE_1_0.0
153    * @param [in] renderTask A pointer to a newly allocated render-task
154    */
155   explicit DALI_INTERNAL RenderTaskList(Internal::RenderTaskList* renderTask);
156   /// @endcond
157 };
158
159 /**
160  * @}
161  */
162 } // namespace Dali
163
164 #endif //DALI_RENDER_TASK_LIST_H