Use modern construct 'using' instead of typedef.
[platform/core/uifw/dali-core.git] / dali / internal / update / common / discard-queue.h
index 899d856..5725225 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_DISCARD_QUEUE_H__
-#define __DALI_INTERNAL_DISCARD_QUEUE_H__
+#ifndef DALI_INTERNAL_DISCARD_QUEUE_H
+#define DALI_INTERNAL_DISCARD_QUEUE_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -35,10 +35,10 @@ namespace Internal
 namespace SceneGraph
 {
 
-class GeometryBatcher;
 class RenderQueue;
 class Shader;
 class Camera;
+class Scene;
 
 
 /**
@@ -51,10 +51,10 @@ class Camera;
 class DiscardQueue
 {
 public:
-
-  typedef OwnerContainer< Shader* > ShaderQueue;
-  typedef OwnerContainer< Renderer* > RendererQueue;
-  typedef OwnerContainer< Camera* > CameraQueue;
+  using ShaderQueue   = OwnerContainer<Shader*>;
+  using RendererQueue = OwnerContainer<Renderer*>;
+  using CameraQueue   = OwnerContainer<Camera*>;
+  using SceneQueue    = OwnerContainer<Scene*>;
 
   /**
    * Create a new DiscardQueue.
@@ -102,17 +102,19 @@ public:
   void Add( BufferIndex updateBufferIndex, Camera* camera );
 
   /**
-   * Release the nodes which were queued in the frame N-2.
-   * @pre This method should be called (once) at the beginning of every Update.
+   * Adds an unwanted Scene to the discard queue.
+   * A message will be sent to clean up GL resources in the next Render.
    * @param[in] updateBufferIndex The current update buffer index.
+   * @param[in] scene The discarded scene; DiscardQueue takes ownership.
    */
-  void Clear( BufferIndex updateBufferIndex );
+  void Add( BufferIndex updateBufferIndex, Scene* scene );
 
   /**
-   * Sets pointer to the GeometryBatcher instance
-   * @param[in] geometryBatcher Instance of the GeometryBatcher
+   * Release the nodes which were queued in the frame N-2.
+   * @pre This method should be called (once) at the beginning of every Update.
+   * @param[in] updateBufferIndex The current update buffer index.
    */
-  void SetGeometryBatcher( GeometryBatcher* geometryBatcher );
+  void Clear( BufferIndex updateBufferIndex );
 
 private:
 
@@ -127,13 +129,11 @@ private:
   RenderQueue& mRenderQueue; ///< Used to send GL clean-up messages for the next Render.
 
   // Messages are queued here following the current update buffer number
-  NodeOwnerContainer           mNodeQueue[2];
+  OwnerContainer< Node* >      mNodeQueue[2];
   ShaderQueue                  mShaderQueue[2];
   RendererQueue                mRendererQueue[2];
   CameraQueue                  mCameraQueue[2];
-
-
-  GeometryBatcher*             mGeometryBatcher; ///< Geometry batcher needed to clean up batches upon node deletion
+  SceneQueue                   mSceneQueue[2];
 };
 
 } // namespace SceneGraph
@@ -142,4 +142,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_RESOURCE_DISCARD_QUEUE_H__
+#endif // DALI_INTERNAL_DISCARD_QUEUE_H