void AnimationPlaylist::AnimationCreated( Animation& animation )
{
- mAnimations.insert( &animation );
+ mAnimations.PushBack( &animation );
}
void AnimationPlaylist::AnimationDestroyed( Animation& animation )
{
- std::set< Animation* >::iterator iter = find( mAnimations.begin(), mAnimations.end(), &animation );
- DALI_ASSERT_ALWAYS( iter != mAnimations.end() && "Animation not found" );
+ Dali::Vector< Animation* >::Iterator iter = std::find( mAnimations.Begin(), mAnimations.End(), &animation );
+ DALI_ASSERT_ALWAYS( iter != mAnimations.End() && "Animation not found" );
- mAnimations.erase( iter );
+ mAnimations.Remove( iter );
}
void AnimationPlaylist::OnPlay( Animation& animation )
{
- mPlaylist.insert( Dali::Animation(&animation) );
+ mPlaylist.push_back( Dali::Animation(&animation) );
}
void AnimationPlaylist::OnClear( Animation& animation )
{
- mPlaylist.erase( Dali::Animation(&animation) );
+ std::vector< Dali::Animation >::iterator iter = std::find( mPlaylist.begin(), mPlaylist.end(), Dali::Animation(&animation) );
+ std::vector< Dali::Animation >::iterator last = mPlaylist.end();
+ if( iter != last )
+ {
+ --last; // move to real last
+ std::swap( *iter, *last ); // swap
+ mPlaylist.resize( mPlaylist.size() - 1u );
+ }
}
void AnimationPlaylist::NotifyCompleted()
// Since animations can be unreferenced during the signal emissions, iterators into animationPointers may be invalidated.
// First copy and reference the finished animations, then emit signals
- for ( std::set< Animation* >::iterator iter = mAnimations.begin(); iter != mAnimations.end(); ++iter )
+ for ( Dali::Vector< Animation* >::Iterator iter = mAnimations.Begin(); iter != mAnimations.End(); ++iter )
{
Animation* animation = *iter;
// The animation may be present in mPlaylist - remove if necessary
// Note that the animation "Finish" signal is emitted after Stop() has been called
- mPlaylist.erase( Dali::Animation(animation) );
+ std::vector< Dali::Animation >::iterator iter = std::find( mPlaylist.begin(), mPlaylist.end(), Dali::Animation(animation) );
+ mPlaylist.erase( iter );
}
}
// INTERNAL INCLUDES
#include <dali/public-api/animation/animation.h>
-#include <dali/public-api/common/set-wrapper.h>
+#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/common/vector-wrapper.h>
#include <dali/internal/event/common/complete-notification-interface.h>
namespace Dali
private:
- std::set< Animation* > mAnimations; ///< All existing animations (not referenced)
- std::set< Dali::Animation > mPlaylist; ///< The currently playing animations (reference counted)
+ Dali::Vector< Animation* > mAnimations; ///< All existing animations (not owned)
+ std::vector< Dali::Animation > mPlaylist; ///< The currently playing animations (owned through handle)
};
void ObjectRegistry::RegisterObject( Dali::BaseObject* object )
{
- // Assert than an object is only registered once
- DALI_ASSERT_DEBUG( mDebugRegistry.end() == mDebugRegistry.find( object ) );
-
-#ifdef DEBUG_ENABLED
- // This allows us to assert that an object is only registered once (debug builds only)
- mDebugRegistry.insert( object );
-#endif // DEBUG_ENABLED
-
if ( !mObjectCreatedSignalV2.Empty() )
{
Dali::BaseHandle handle( object );
void ObjectRegistry::UnregisterObject( Dali::BaseObject* object )
{
-#ifdef DEBUG_ENABLED
- // This allows us to assert that an object is only registered once (debug builds only)
- mDebugRegistry.erase( object );
-#endif // DEBUG_ENABLED
-
mObjectDestroyedSignalV2.Emit( object );
}
*/
// INTERNAL INCLUDES
-#ifdef DEBUG_ENABLED
-#include <dali/public-api/common/set-wrapper.h>
-#endif
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/object/object-registry.h>
#include <dali/public-api/object/base-object.h>
Dali::ObjectRegistry::ObjectCreatedSignalV2 mObjectCreatedSignalV2;
Dali::ObjectRegistry::ObjectDestroyedSignalV2 mObjectDestroyedSignalV2;
-#ifdef DEBUG_ENABLED
- std::set< Dali::BaseObject* > mDebugRegistry; ///< This allows us to assert that an object is only registered once (debug builds only)
-#endif
-
};
} // namespace Internal
*
*/
-// 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
{
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 )
*/
// INTERNAL INCLUDES
-#include <dali/public-api/common/set-wrapper.h>
-#include <dali/internal/common/message.h>
+#include <dali/public-api/common/dali-vector.h>
#include <dali/internal/event/common/property-notifier.h>
namespace Dali
private:
- std::set< PropertyNotification* > mPropertyNotifications; ///< All existing PropertyNotifications (not referenced)
+ Dali::Vector< PropertyNotification* > mPropertyNotifications; ///< All existing PropertyNotifications (not owned)
};
// INTERNAL INCLUDES
#include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/common/set-wrapper.h>
#include <dali/public-api/object/ref-object.h>
#include <dali/internal/render/gl-resources/context.h>
#include <dali/integration-api/resource-cache.h>
#include <dali/public-api/common/intrusive-ptr.h>
#include <dali/public-api/common/light.h>
#include <dali/public-api/common/loading-state.h>
-#include <dali/public-api/common/map-wrapper.h>
-#include <dali/public-api/common/set-wrapper.h>
#include <dali/public-api/common/stage.h>
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/common/view-mode.h>