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 GestureEventProcessor;
41 class RelayoutController;
49 * Class to store a pointer to core in thread local storage.
52 class ThreadLocalStorage
58 * Creates the TLS and adds a pointer to core
59 * @param [in] core reference to core
61 ThreadLocalStorage(Core* core);
66 ~ThreadLocalStorage();
69 * Remove core pointer.
70 * Prevents the core pointer being automatically deleted when the thread exits.
76 * @return reference to the TLS
78 static ThreadLocalStorage& Get();
81 * Checks if the TLS has been created
82 * @return if the TLS has been created
84 static bool Created();
87 * Get a pointer to the TLS or NULL if not initialized
88 * @return pointer to the TLS
90 static ThreadLocalStorage* GetInternal();
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 Shader Factory
112 * @return reference to the Shader Factory
114 ShaderFactory& GetShaderFactory();
117 * Returns the current stage.
118 * @return A pointer to the current stage.
120 StagePtr GetCurrentStage();
123 * Returns the gesture event processor.
124 * @return A reference to the gesture event processor.
126 GestureEventProcessor& GetGestureEventProcessor();
129 * Return the relayout controller
130 * @Return Return a reference to the relayout controller
132 RelayoutController& GetRelayoutController();
136 Core* mCore; ///< reference to core
140 } // namespace Internal
144 #endif // __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__