1 #ifndef DALI_INTERNAL_NOTIFICATION_MANAGER_H
2 #define DALI_INTERNAL_NOTIFICATION_MANAGER_H
5 * Copyright (c) 2021 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.
27 class CompleteNotificationInterface;
31 * Provides notifications to the event-thread regarding the changes in previous update(s).
32 * For example after an animation finished, or after resources were loaded.
34 class NotificationManager
38 * Create an NotificationManager. Owned by Core in event thread side.
40 NotificationManager();
45 virtual ~NotificationManager();
47 /// Update side interface, can only be called from Update-thread
50 * Queue a scene message to an interface. This method is thread-safe.
51 * @param[in] instance to be notified about completion of the Update side event.
53 void QueueCompleteNotification(CompleteNotificationInterface* instance);
56 * Queue a scene message. This method is thread-safe.
57 * @param[in] message A newly allocated message; NotificationManager takes ownership.
59 void QueueMessage(MessageBase* message);
62 * Signal Notification Manager that update frame is completed so it can let event thread process the notifications
64 void UpdateCompleted();
66 /// Event side interface, can only be called from Update-thread
69 * Query whether the NotificationManager has messages to process.
70 * @return True if there are messages to process.
72 bool MessagesToProcess();
75 * This function is called by Core when events are processed.
77 void ProcessMessages();
81 NotificationManager(const NotificationManager& notificationManager);
84 NotificationManager& operator=(const NotificationManager& notificationManager);
91 } // namespace Internal
95 #endif // DALI_INTERNAL_NOTIFICATION_MANAGER_H