1 #ifndef __DALI_INTERNAL_NOTIFICATION_MANAGER_H__
2 #define __DALI_INTERNAL_NOTIFICATION_MANAGER_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.
29 class PropertyNotification;
33 * Provides notifications to the event-thread regarding the changes in previous update(s).
34 * For example after an animation finished, or after resources were loaded.
36 class NotificationManager
41 * Create an NotificationManager. Owned by Core in event thread side.
43 NotificationManager();
48 virtual ~NotificationManager();
50 /// Update side interface, can only be called from Update-thread
53 * Queue a scene message. This method is thread-safe.
54 * @param[in] message A newly allocated message; NotificationManager takes ownership.
56 void QueueMessage( MessageBase* message );
59 * Signal Notification Manager that update frame is completed so it can let event thread process the notifications
61 void UpdateCompleted();
63 /// Event side interface, can only be called from Update-thread
66 * Query whether the NotificationManager has messages to process.
67 * @return True if there are messages to process.
69 bool MessagesToProcess();
72 * This function is called by Core when events are processed.
74 void ProcessMessages();
77 * Retrieve the notification count; this is incremented when Notify() is called.
79 unsigned int GetNotificationCount() const;
88 * A functor for querying the notification count.
89 * This is useful for skipping duplicate operations during NotificationManager::Notify()
91 struct NotificationCountQuery
93 NotificationCountQuery(const NotificationManager& manager)
94 : mNotificationManager(manager)
98 unsigned int operator()() const
100 return mNotificationManager.GetNotificationCount();
105 const NotificationManager& mNotificationManager;
108 } // namespace Internal
112 #endif // __DALI_INTERNAL_NOTIFICATION_MANAGER_H__