Merge "Clean up the code to build successfully on macOS" into devel/master
[platform/core/uifw/dali-core.git] / dali / internal / event / common / property-notification-manager.cpp
index 202c484..b879923 100644 (file)
@@ -1,22 +1,26 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
-// INTERNAL INCLUDES
+// CLASS HEADER
 #include <dali/internal/event/common/property-notification-manager.h>
+
+// INTERNAL INCLUDES
 #include <dali/internal/event/common/property-notification-impl.h>
+#include <dali/internal/common/message.h>
 
 namespace Dali
 {
@@ -29,27 +33,25 @@ PropertyNotificationManager* PropertyNotificationManager::New()
   return new PropertyNotificationManager;
 }
 
-PropertyNotificationManager::~PropertyNotificationManager()
-{
-}
+PropertyNotificationManager::~PropertyNotificationManager() = default;
 
 void PropertyNotificationManager::PropertyNotificationCreated( PropertyNotification& propertyNotification )
 {
-  mPropertyNotifications.insert( &propertyNotification );
+  mPropertyNotifications.PushBack( &propertyNotification );
 }
 
 void PropertyNotificationManager::PropertyNotificationDestroyed( PropertyNotification& propertyNotification )
 {
-  std::set< PropertyNotification* >::iterator iter = std::find( mPropertyNotifications.begin(), mPropertyNotifications.end(), &propertyNotification );
-  DALI_ASSERT_ALWAYS( iter != mPropertyNotifications.end() && "PropertyNotification not found" );
+  Dali::Vector< PropertyNotification* >::Iterator iter = std::find( mPropertyNotifications.Begin(), mPropertyNotifications.End(), &propertyNotification );
+  DALI_ASSERT_ALWAYS( iter != mPropertyNotifications.End() && "PropertyNotification not found" );
 
-  mPropertyNotifications.erase( iter );
+  mPropertyNotifications.Remove( iter );
 }
 
 void PropertyNotificationManager::NotifyProperty( SceneGraph::PropertyNotification* propertyNotification, bool validity )
 {
-  std::set< PropertyNotification* >::iterator iter = mPropertyNotifications.begin();
-  std::set< PropertyNotification* >::iterator endIter = mPropertyNotifications.end();
+  Dali::Vector< PropertyNotification* >::Iterator iter = mPropertyNotifications.Begin();
+  const Dali::Vector< PropertyNotification* >::Iterator endIter = mPropertyNotifications.End();
 
   // walk the collection of PropertyNotifications
   for( ; iter != endIter; ++iter )
@@ -57,7 +59,7 @@ void PropertyNotificationManager::NotifyProperty( SceneGraph::PropertyNotificati
     // found one with the matching SceneGraph::PropertyNotification?
     if( (*iter)->CompareSceneObject( propertyNotification ) )
     {
-      // allow application to access the value that triggered this emit incase of NotifyOnChanged mode
+      // allow application to access the value that triggered this emit incase of NOTIFY_ON_CHANGED mode
       (*iter)->SetNotifyResult(validity);
       // yes..emit signal
       (*iter)->EmitSignalNotify();
@@ -66,9 +68,7 @@ void PropertyNotificationManager::NotifyProperty( SceneGraph::PropertyNotificati
   }
 }
 
-PropertyNotificationManager::PropertyNotificationManager()
-{
-}
+PropertyNotificationManager::PropertyNotificationManager() = default;
 
 } // namespace Internal