1 #ifndef __DALI_INTERNAL_EVENT_TO_UPDATE_H__
2 #define __DALI_INTERNAL_EVENT_TO_UPDATE_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
21 #include <dali/internal/common/buffer-index.h>
22 #include <dali/internal/common/message.h>
23 #include <dali/internal/update/common/scene-graph-buffers.h>
32 * Abstract interface for accessing update-thread data from the event-thread.
33 * Used for queueing messages during the event-thread for the next update.
34 * Allows the event-thread to read double-buffered property values.
43 virtual ~EventToUpdate()
48 * Called by the event-thread to signal that FlushQueue will be called
49 * e.g. when it has finished event processing.
51 virtual void EventProcessingStarted() = 0;
54 * Reserve space for another message in the queue; this must then be initialized by the caller.
55 * The message will be read from the update-thread after the next FlushMessages is called.
56 * @post Calling this method may invalidate any previously returned slots.
57 * @param[in] size The message size with respect to the size of type "char".
58 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
59 * @return A pointer to the first char allocated for the message.
61 virtual unsigned int* ReserveMessageSlot( std::size_t size, bool updateScene = true ) = 0;
64 * Retrieve the current event-buffer index.
66 virtual BufferIndex GetEventBufferIndex() const = 0;
69 * Flush the set of messages, which were previously stored with QueueMessage().
70 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
72 * @return True if there are messages to process.
74 virtual bool FlushQueue() = 0;
77 } // namespace Internal
81 #endif // __DALI_INTERNAL_EVENT_TO_UPDATE_H__