1 #ifndef __DALI_INTERNAL_EVENT_THREAD_SERVICES_H__
2 #define __DALI_INTERNAL_EVENT_THREAD_SERVICES_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.
25 #include <dali/internal/common/buffer-index.h>
41 * Abstract interface of services for event-thread objects.
42 * Used for registering objects, queueing messages during the event-thread for the next update.
43 * Allows the event-thread to read double-buffered property values.
45 class EventThreadServices
52 virtual ~EventThreadServices()
56 * @brief Registers the object as created with the Object registry.
58 * @param[in] object to register
60 virtual void RegisterObject( BaseObject* object) = 0;
63 * @brief Unregisters the object from Object registry.
65 * @param[in] object to unregister
67 virtual void UnregisterObject( BaseObject* object) = 0;
70 * @brief Get a reference to the UpdateManager
72 * @return the update manager
74 virtual SceneGraph::UpdateManager& GetUpdateManager() = 0;
77 * Reserve space for another message in the queue; this must then be initialized by the caller.
78 * The message will be read from the update-thread after the next FlushMessages is called.
79 * @post Calling this method may invalidate any previously returned slots.
80 * @param[in] size The message size with respect to the size of type "char".
81 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
82 * @return A pointer to the first char allocated for the message.
84 virtual unsigned int* ReserveMessageSlot( std::size_t size, bool updateScene = true ) = 0;
87 * @return the current event-buffer index.
89 virtual BufferIndex GetEventBufferIndex() const = 0;
92 * @return true if core is still running and we can send messages
94 static bool IsCoreRunning();
97 } // namespace Internal
101 #endif // __DALI_INTERNAL_EVENT_THREAD_SERVICES_H__