1 #ifndef __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__
2 #define __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
11 // http://floralicense.org/license/
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.
21 #include <dali/internal/event/common/stage-impl.h>
30 class PlatformAbstraction;
37 class NotificationManager;
39 class ResourceManager;
45 class GestureEventProcessor;
53 * Class to store a pointer to core in thread local storage.
56 class ThreadLocalStorage
62 * Creates the TLS and adds a pointer to core
63 * @param [in] core reference to core
65 ThreadLocalStorage(Core* core);
70 ~ThreadLocalStorage();
73 * Remove core pointer.
74 * Prevents the core pointer being automatically deleted when the thread exits.
80 * @return reference to the TLS
82 static ThreadLocalStorage& Get();
85 * Checks if the TLS has been created
86 * @return if the TLS has been created
88 static bool Created();
91 * get platform abstraction
92 * @return reference to core
94 Dali::Integration::PlatformAbstraction& GetPlatformAbstraction();
97 * Retrieve the update manager
98 * @return reference to update manager
100 SceneGraph::UpdateManager& GetUpdateManager();
103 * Returns the Notification Manager
104 * @return reference to the Notification Manager
106 NotificationManager& GetNotificationManager();
109 * Returns the Resource Manager
110 * @return reference to the Resource Manager
112 ResourceManager& GetResourceManager();
115 * Returns the Resource Client
116 * @return reference to the Resource Client
118 ResourceClient& GetResourceClient();
121 * Returns the Image Factory
122 * @return reference to the Image Factory
124 ImageFactory& GetImageFactory();
127 * Returns the Model Factory
128 * @return reference to the Image Factory
130 ModelFactory& GetModelFactory();
133 * Returns the Font Factory
134 * @return reference to the Font Factory
136 FontFactory& GetFontFactory();
139 * Returns the Shader Factory
140 * @return reference to the Shader Factory
142 ShaderFactory& GetShaderFactory();
145 * Returns the current stage.
146 * @return A smart-pointer to the current stage.
148 StagePtr GetCurrentStage();
151 * Return the message controller
152 * @return A reference to the message controller
154 EventToUpdate& GetEventToUpdate();
157 * Returns the gesture event processor.
158 * @return A reference to the gesture event processor.
160 GestureEventProcessor& GetGestureEventProcessor();
164 Core* mCore; ///< reference to core
168 } // namespace Internal
172 #endif // __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__