Delete ImageFactory and ImageFactoryCache as they are unused
[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) 2017 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 ShaderFactory;
42 class GestureEventProcessor;
43 class RelayoutController;
44
45 namespace SceneGraph
46 {
47 class UpdateManager;
48 }
49
50 /**
51  * Class to store a pointer to core in thread local storage.
52  *
53  */
54 class ThreadLocalStorage
55 {
56 public:
57
58   /**
59    * Constructor
60    * Creates the TLS and adds a pointer to core
61    * @param [in] core reference to core
62    */
63   ThreadLocalStorage(Core* core);
64
65   /**
66    * Destructor.
67    */
68   ~ThreadLocalStorage();
69
70   /**
71    * Remove core pointer.
72    * Prevents the core pointer being automatically deleted when the thread exits.
73    */
74   void Remove();
75
76   /**
77    * Get the TLS
78    * @return reference to the TLS
79    */
80   static ThreadLocalStorage& Get();
81
82   /**
83    * Checks if the TLS has been created
84    * @return if the TLS has been created
85    */
86   static bool Created();
87
88   /**
89    * Get a pointer to the TLS or NULL if not initialized
90    * @return pointer to the TLS
91    */
92   static ThreadLocalStorage* GetInternal();
93
94   /**
95    * get platform abstraction
96    * @return reference to core
97    */
98   Dali::Integration::PlatformAbstraction& GetPlatformAbstraction();
99
100   /**
101    * Retrieve the update manager
102    * @return reference to update manager
103    */
104   SceneGraph::UpdateManager& GetUpdateManager();
105
106   /**
107    * Returns the Notification Manager
108    * @return reference to the Notification Manager
109    */
110   NotificationManager& GetNotificationManager();
111
112   /**
113    * Returns the Resource Manager
114    * @return reference to the Resource Manager
115    */
116   ResourceManager& GetResourceManager();
117
118   /**
119    * Returns the Resource Client
120    * @return reference to the Resource Client
121    */
122   ResourceClient& GetResourceClient();
123
124   /**
125    * Returns the Shader Factory
126    * @return reference to the Shader Factory
127    */
128   ShaderFactory& GetShaderFactory();
129
130   /**
131    * Returns the current stage.
132    * @return A pointer to the current stage.
133    */
134   StagePtr GetCurrentStage();
135
136   /**
137    * Returns the gesture event processor.
138    * @return A reference to the gesture event processor.
139    */
140   GestureEventProcessor& GetGestureEventProcessor();
141
142   /**
143    * Return the relayout controller
144    * @Return Return a reference to the relayout controller
145    */
146   RelayoutController& GetRelayoutController();
147
148 private:
149
150   Core* mCore;                                              ///< reference to core
151
152 };
153
154 } // namespace Internal
155
156 } // namespace Dali
157
158 #endif // __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__