(GCC 6.2) Remove unused functions from automated tests
[platform/core/uifw/dali-core.git] / dali / internal / event / common / thread-local-storage.h
1 #ifndef __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__
2 #define __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__
3
4 /*
5  * Copyright (c) 2015 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 // INTERNAL INCLUDES
22 #include <dali/internal/event/common/stage-def.h>
23
24 namespace Dali
25 {
26
27 struct Vector2;
28
29 namespace Integration
30 {
31 class PlatformAbstraction;
32 }
33
34 namespace Internal
35 {
36
37 class Core;
38 class NotificationManager;
39 class ResourceClient;
40 class ResourceManager;
41 class ImageFactory;
42 class ShaderFactory;
43 class GestureEventProcessor;
44 class RelayoutController;
45
46 namespace SceneGraph
47 {
48 class UpdateManager;
49 }
50
51 /**
52  * Class to store a pointer to core in thread local storage.
53  *
54  */
55 class ThreadLocalStorage
56 {
57 public:
58
59   /**
60    * Constructor
61    * Creates the TLS and adds a pointer to core
62    * @param [in] core reference to core
63    */
64   ThreadLocalStorage(Core* core);
65
66   /**
67    * Destructor.
68    */
69   ~ThreadLocalStorage();
70
71   /**
72    * Remove core pointer.
73    * Prevents the core pointer being automatically deleted when the thread exits.
74    */
75   void Remove();
76
77   /**
78    * Get the TLS
79    * @return reference to the TLS
80    */
81   static ThreadLocalStorage& Get();
82
83   /**
84    * Checks if the TLS has been created
85    * @return if the TLS has been created
86    */
87   static bool Created();
88
89   /**
90    * Get a pointer to the TLS or NULL if not initialized
91    * @return pointer to the TLS
92    */
93   static ThreadLocalStorage* GetInternal();
94
95   /**
96    * get platform abstraction
97    * @return reference to core
98    */
99   Dali::Integration::PlatformAbstraction& GetPlatformAbstraction();
100
101   /**
102    * Retrieve the update manager
103    * @return reference to update manager
104    */
105   SceneGraph::UpdateManager& GetUpdateManager();
106
107   /**
108    * Returns the Notification Manager
109    * @return reference to the Notification Manager
110    */
111   NotificationManager& GetNotificationManager();
112
113   /**
114    * Returns the Resource Manager
115    * @return reference to the Resource Manager
116    */
117   ResourceManager& GetResourceManager();
118
119   /**
120    * Returns the Resource Client
121    * @return reference to the Resource Client
122    */
123   ResourceClient& GetResourceClient();
124
125   /**
126    * Returns the Image Factory
127    * @return reference to the Image Factory
128    */
129   ImageFactory& GetImageFactory();
130
131   /**
132    * Returns the Shader Factory
133    * @return reference to the Shader Factory
134    */
135   ShaderFactory& GetShaderFactory();
136
137   /**
138    * Returns the current stage.
139    * @return A pointer to the current stage.
140    */
141   StagePtr GetCurrentStage();
142
143   /**
144    * Returns the gesture event processor.
145    * @return A reference to the gesture event processor.
146    */
147   GestureEventProcessor& GetGestureEventProcessor();
148
149   /**
150    * Return the relayout controller
151    * @Return Return a reference to the relayout controller
152    */
153   RelayoutController& GetRelayoutController();
154
155 private:
156
157   Core* mCore;                                              ///< reference to core
158
159 };
160
161 } // namespace Internal
162
163 } // namespace Dali
164
165 #endif // __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__