1 #ifndef __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__
2 #define __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__
5 * Copyright (c) 2017 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;
39 class ResourceManager;
41 class GestureEventProcessor;
42 class RelayoutController;
50 * Class to store a pointer to core in thread local storage.
53 class ThreadLocalStorage
59 * Creates the TLS and adds a pointer to core
60 * @param [in] core reference to core
62 ThreadLocalStorage(Core* core);
67 ~ThreadLocalStorage();
70 * Remove core pointer.
71 * Prevents the core pointer being automatically deleted when the thread exits.
77 * @return reference to the TLS
79 static ThreadLocalStorage& Get();
82 * Checks if the TLS has been created
83 * @return if the TLS has been created
85 static bool Created();
88 * Get a pointer to the TLS or NULL if not initialized
89 * @return pointer to the TLS
91 static ThreadLocalStorage* GetInternal();
94 * get platform abstraction
95 * @return reference to core
97 Dali::Integration::PlatformAbstraction& GetPlatformAbstraction();
100 * Retrieve the update manager
101 * @return reference to update manager
103 SceneGraph::UpdateManager& GetUpdateManager();
106 * Returns the Notification Manager
107 * @return reference to the Notification Manager
109 NotificationManager& GetNotificationManager();
112 * Returns the Resource Manager
113 * @return reference to the Resource Manager
115 ResourceManager& GetResourceManager();
118 * Returns the Shader Factory
119 * @return reference to the Shader Factory
121 ShaderFactory& GetShaderFactory();
124 * Returns the current stage.
125 * @return A pointer to the current stage.
127 StagePtr GetCurrentStage();
130 * Returns the gesture event processor.
131 * @return A reference to the gesture event processor.
133 GestureEventProcessor& GetGestureEventProcessor();
136 * Return the relayout controller
137 * @Return Return a reference to the relayout controller
139 RelayoutController& GetRelayoutController();
143 Core* mCore; ///< reference to core
147 } // namespace Internal
151 #endif // __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__