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 platform abstraction
94 * @return reference to core
96 Dali::Integration::PlatformAbstraction& GetPlatformAbstraction();
99 * Retrieve the update manager
100 * @return reference to update manager
102 SceneGraph::UpdateManager& GetUpdateManager();
105 * Returns the Notification Manager
106 * @return reference to the Notification Manager
108 NotificationManager& GetNotificationManager();
111 * Returns the Resource Manager
112 * @return reference to the Resource Manager
114 ResourceManager& GetResourceManager();
117 * Returns the Resource Client
118 * @return reference to the Resource Client
120 ResourceClient& GetResourceClient();
123 * Returns the Image Factory
124 * @return reference to the Image Factory
126 ImageFactory& GetImageFactory();
129 * Returns the Model Factory
130 * @return reference to the Image Factory
132 ModelFactory& GetModelFactory();
135 * Returns the Font Factory
136 * @return reference to the Font Factory
138 FontFactory& GetFontFactory();
141 * Returns the Shader Factory
142 * @return reference to the Shader Factory
144 ShaderFactory& GetShaderFactory();
147 * Returns the current stage.
148 * @return A smart-pointer to the current stage.
150 StagePtr GetCurrentStage();
153 * Return the message controller
154 * @return A reference to the message controller
156 EventToUpdate& GetEventToUpdate();
159 * Returns the gesture event processor.
160 * @return A reference to the gesture event processor.
162 GestureEventProcessor& GetGestureEventProcessor();
165 * Returns the Emoji factory.
166 * @return a reference to the Emoji factory.
168 EmojiFactory& GetEmojiFactory();
172 Core* mCore; ///< reference to core
176 } // namespace Internal
180 #endif // __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__