1 #ifndef __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__
2 #define __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__
5 * Copyright (c) 2015 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;
43 class GestureEventProcessor;
44 class RelayoutController;
52 * Class to store a pointer to core in thread local storage.
55 class ThreadLocalStorage
61 * Creates the TLS and adds a pointer to core
62 * @param [in] core reference to core
64 ThreadLocalStorage(Core* core);
69 ~ThreadLocalStorage();
72 * Remove core pointer.
73 * Prevents the core pointer being automatically deleted when the thread exits.
79 * @return reference to the TLS
81 static ThreadLocalStorage& Get();
84 * Checks if the TLS has been created
85 * @return if the TLS has been created
87 static bool Created();
90 * Get a pointer to the TLS or NULL if not initialized
91 * @return pointer to the TLS
93 static ThreadLocalStorage* GetInternal();
96 * get platform abstraction
97 * @return reference to core
99 Dali::Integration::PlatformAbstraction& GetPlatformAbstraction();
102 * Retrieve the update manager
103 * @return reference to update manager
105 SceneGraph::UpdateManager& GetUpdateManager();
108 * Returns the Notification Manager
109 * @return reference to the Notification Manager
111 NotificationManager& GetNotificationManager();
114 * Returns the Resource Manager
115 * @return reference to the Resource Manager
117 ResourceManager& GetResourceManager();
120 * Returns the Resource Client
121 * @return reference to the Resource Client
123 ResourceClient& GetResourceClient();
126 * Returns the Image Factory
127 * @return reference to the Image Factory
129 ImageFactory& GetImageFactory();
132 * Returns the Shader Factory
133 * @return reference to the Shader Factory
135 ShaderFactory& GetShaderFactory();
138 * Returns the current stage.
139 * @return A pointer to the current stage.
141 StagePtr GetCurrentStage();
144 * Returns the gesture event processor.
145 * @return A reference to the gesture event processor.
147 GestureEventProcessor& GetGestureEventProcessor();
150 * Return the relayout controller
151 * @Return Return a reference to the relayout controller
153 RelayoutController& GetRelayoutController();
157 Core* mCore; ///< reference to core
161 } // namespace Internal
165 #endif // __DALI_INTERNAL_THREAD_LOCAL_STORAGE_H__