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;
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 Shader Factory
134 * @return reference to the Shader Factory
136 ShaderFactory& GetShaderFactory();
139 * Returns the current stage.
140 * @return A smart-pointer to the current stage.
142 StagePtr GetCurrentStage();
145 * Return the message controller
146 * @return A reference to the message controller
148 EventToUpdate& GetEventToUpdate();
151 * Returns the gesture event processor.
152 * @return A reference to the gesture event processor.
154 GestureEventProcessor& GetGestureEventProcessor();
158 Core* mCore; ///< reference to core
162 } // namespace Internal
166 #endif // __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__