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 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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/internal/event/common/stage-def.h>
31 class PlatformAbstraction;
38 class NotificationManager;
40 class ResourceManager;
44 class GestureEventProcessor;
46 class RelayoutController;
54 * Class to store a pointer to core in thread local storage.
57 class ThreadLocalStorage
63 * Creates the TLS and adds a pointer to core
64 * @param [in] core reference to core
66 ThreadLocalStorage(Core* core);
71 ~ThreadLocalStorage();
74 * Remove core pointer.
75 * Prevents the core pointer being automatically deleted when the thread exits.
81 * @return reference to the TLS
83 static ThreadLocalStorage& Get();
86 * Checks if the TLS has been created
87 * @return if the TLS has been created
89 static bool Created();
92 * Get a pointer to the TLS or NULL if not initialized
93 * @return pointer to the TLS
95 static ThreadLocalStorage* GetInternal();
98 * get platform abstraction
99 * @return reference to core
101 Dali::Integration::PlatformAbstraction& GetPlatformAbstraction();
104 * Retrieve the update manager
105 * @return reference to update manager
107 SceneGraph::UpdateManager& GetUpdateManager();
110 * Returns the Notification Manager
111 * @return reference to the Notification Manager
113 NotificationManager& GetNotificationManager();
116 * Returns the Resource Manager
117 * @return reference to the Resource Manager
119 ResourceManager& GetResourceManager();
122 * Returns the Resource Client
123 * @return reference to the Resource Client
125 ResourceClient& GetResourceClient();
128 * Returns the Image Factory
129 * @return reference to the Image Factory
131 ImageFactory& GetImageFactory();
134 * Returns the Font Factory
135 * @return reference to the Font Factory
137 FontFactory& GetFontFactory();
140 * Returns the Shader Factory
141 * @return reference to the Shader Factory
143 ShaderFactory& GetShaderFactory();
146 * Returns the current stage.
147 * @return A pointer to the current stage.
149 StagePtr GetCurrentStage();
152 * Returns the gesture event processor.
153 * @return A reference to the gesture event processor.
155 GestureEventProcessor& GetGestureEventProcessor();
158 * Returns the Emoji factory.
159 * @return a reference to the Emoji factory.
161 EmojiFactory& GetEmojiFactory();
164 * Return the relayout controller
165 * @Return Return a reference to the relayout controller
167 RelayoutController& GetRelayoutController();
171 Core* mCore; ///< reference to core
175 } // namespace Internal
179 #endif // __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__