Revert "License conversion from Flora to Apache 2.0"
[platform/core/uifw/dali-core.git] / dali / internal / update / common / scene-graph-buffers.h
1 #ifndef __DALI_INTERNAL_SCENE_GRAPH_BUFFERS_H__
2 #define __DALI_INTERNAL_SCENE_GRAPH_BUFFERS_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 // INTERNAL INCLUDES
21 #include <dali/internal/common/buffer-index.h>
22
23 namespace Dali
24 {
25
26 namespace Internal
27 {
28
29 namespace SceneGraph
30 {
31
32 /**
33  * Node values (position etc.) are double-buffered.  A SceneGraphBuffers object
34  * can be used to keep track of which buffers are being written or read.
35  */
36 class SceneGraphBuffers
37 {
38 public:
39
40   static BufferIndex INITIAL_EVENT_BUFFER_INDEX;  // 0
41   static BufferIndex INITIAL_UPDATE_BUFFER_INDEX; // 1
42
43   /**
44    * Create a SceneGraphBuffers object.
45    */
46   SceneGraphBuffers();
47
48   /**
49    * Non-virtual destructor; not intended as a base class.
50    */
51   ~SceneGraphBuffers();
52
53   /**
54    * Retrieve the current event-buffer index.
55    * @return The buffer index.
56    */
57   BufferIndex GetEventBufferIndex() const { return mEventBufferIndex; }
58
59   /**
60    * Retrieve the current update-buffer index.
61    * @return The buffer index.
62    */
63   BufferIndex GetUpdateBufferIndex() const { return mUpdateBufferIndex; }
64
65   /**
66    * Swap the Event & Update buffer indices.
67   */
68   void Swap();
69
70 private:
71
72   // Undefined
73   SceneGraphBuffers(const SceneGraphBuffers&);
74
75   // Undefined
76   SceneGraphBuffers& operator=(const SceneGraphBuffers& rhs);
77
78 private:
79
80   BufferIndex mEventBufferIndex;  ///< 0 or 1 (opposite of mUpdateBufferIndex)
81   BufferIndex mUpdateBufferIndex; ///< 0 or 1 (opposite of mEventBufferIndex)
82 };
83
84 } // namespace SceneGraph
85
86 } // namespace Internal
87
88 } // namespace Dali
89
90 #endif // __DALI_INTERNAL_SCENE_GRAPH_BUFFERS_H__