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-impl.h>
31 class PlatformAbstraction;
38 class NotificationManager;
40 class ResourceManager;
46 class GestureEventProcessor;
55 * Class to store a pointer to core in thread local storage.
58 class ThreadLocalStorage
64 * Creates the TLS and adds a pointer to core
65 * @param [in] core reference to core
67 ThreadLocalStorage(Core* core);
72 ~ThreadLocalStorage();
75 * Remove core pointer.
76 * Prevents the core pointer being automatically deleted when the thread exits.
82 * @return reference to the TLS
84 static ThreadLocalStorage& Get();
87 * Checks if the TLS has been created
88 * @return if the TLS has been created
90 static bool Created();
93 * Get a pointer to the TLS or NULL if not initialized
94 * @return pointer to the TLS
96 static ThreadLocalStorage* GetInternal();
99 * get platform abstraction
100 * @return reference to core
102 Dali::Integration::PlatformAbstraction& GetPlatformAbstraction();
105 * Retrieve the update manager
106 * @return reference to update manager
108 SceneGraph::UpdateManager& GetUpdateManager();
111 * Returns the Notification Manager
112 * @return reference to the Notification Manager
114 NotificationManager& GetNotificationManager();
117 * Returns the Resource Manager
118 * @return reference to the Resource Manager
120 ResourceManager& GetResourceManager();
123 * Returns the Resource Client
124 * @return reference to the Resource Client
126 ResourceClient& GetResourceClient();
129 * Returns the Image Factory
130 * @return reference to the Image Factory
132 ImageFactory& GetImageFactory();
135 * Returns the Model Factory
136 * @return reference to the Image Factory
138 ModelFactory& GetModelFactory();
141 * Returns the Font Factory
142 * @return reference to the Font Factory
144 FontFactory& GetFontFactory();
147 * Returns the Shader Factory
148 * @return reference to the Shader Factory
150 ShaderFactory& GetShaderFactory();
153 * Returns the current stage.
154 * @return A smart-pointer to the current stage.
156 StagePtr GetCurrentStage();
159 * Return the message controller
160 * @return A reference to the message controller
162 EventToUpdate& GetEventToUpdate();
165 * Returns the gesture event processor.
166 * @return A reference to the gesture event processor.
168 GestureEventProcessor& GetGestureEventProcessor();
171 * Returns the Emoji factory.
172 * @return a reference to the Emoji factory.
174 EmojiFactory& GetEmojiFactory();
178 Core* mCore; ///< reference to core
182 } // namespace Internal
186 #endif // __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__