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;
40 class ResourceManager;
42 class GestureEventProcessor;
43 class RelayoutController;
51 * Class to store a pointer to core in thread local storage.
54 class ThreadLocalStorage
60 * Creates the TLS and adds a pointer to core
61 * @param [in] core reference to core
63 ThreadLocalStorage(Core* core);
68 ~ThreadLocalStorage();
71 * Remove core pointer.
72 * Prevents the core pointer being automatically deleted when the thread exits.
78 * @return reference to the TLS
80 static ThreadLocalStorage& Get();
83 * Checks if the TLS has been created
84 * @return if the TLS has been created
86 static bool Created();
89 * Get a pointer to the TLS or NULL if not initialized
90 * @return pointer to the TLS
92 static ThreadLocalStorage* GetInternal();
95 * get platform abstraction
96 * @return reference to core
98 Dali::Integration::PlatformAbstraction& GetPlatformAbstraction();
101 * Retrieve the update manager
102 * @return reference to update manager
104 SceneGraph::UpdateManager& GetUpdateManager();
107 * Returns the Notification Manager
108 * @return reference to the Notification Manager
110 NotificationManager& GetNotificationManager();
113 * Returns the Resource Manager
114 * @return reference to the Resource Manager
116 ResourceManager& GetResourceManager();
119 * Returns the Resource Client
120 * @return reference to the Resource Client
122 ResourceClient& GetResourceClient();
125 * Returns the Shader Factory
126 * @return reference to the Shader Factory
128 ShaderFactory& GetShaderFactory();
131 * Returns the current stage.
132 * @return A pointer to the current stage.
134 StagePtr GetCurrentStage();
137 * Returns the gesture event processor.
138 * @return A reference to the gesture event processor.
140 GestureEventProcessor& GetGestureEventProcessor();
143 * Return the relayout controller
144 * @Return Return a reference to the relayout controller
146 RelayoutController& GetRelayoutController();
150 Core* mCore; ///< reference to core
154 } // namespace Internal
158 #endif // __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__