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;
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 a pointer to the TLS or NULL if not initialized
92 * @return pointer to the TLS
94 static ThreadLocalStorage* GetInternal();
97 * get platform abstraction
98 * @return reference to core
100 Dali::Integration::PlatformAbstraction& GetPlatformAbstraction();
103 * Retrieve the update manager
104 * @return reference to update manager
106 SceneGraph::UpdateManager& GetUpdateManager();
109 * Returns the Notification Manager
110 * @return reference to the Notification Manager
112 NotificationManager& GetNotificationManager();
115 * Returns the Resource Manager
116 * @return reference to the Resource Manager
118 ResourceManager& GetResourceManager();
121 * Returns the Resource Client
122 * @return reference to the Resource Client
124 ResourceClient& GetResourceClient();
127 * Returns the Image Factory
128 * @return reference to the Image Factory
130 ImageFactory& GetImageFactory();
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 pointer to the current stage.
148 StagePtr GetCurrentStage();
151 * Returns the gesture event processor.
152 * @return A reference to the gesture event processor.
154 GestureEventProcessor& GetGestureEventProcessor();
157 * Returns the Emoji factory.
158 * @return a reference to the Emoji factory.
160 EmojiFactory& GetEmojiFactory();
164 Core* mCore; ///< reference to core
168 } // namespace Internal
172 #endif // __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__