[dali_2.3.24] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / animated-vector-image / vector-animation-manager.h
index fe6b87a..53dbb06 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_VECTOR_ANIMATION_MANAGER_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/integration-api/ordered-set.h>
 #include <dali/integration-api/processor-interface.h>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/signals/callback.h>
@@ -40,11 +41,6 @@ class VectorAnimationThread;
 class VectorAnimationManager : public Integration::Processor
 {
 public:
-  struct LifecycleObserver
-  {
-    virtual void VectorAnimationManagerDestroyed() = 0;
-  };
-
   /**
    * @brief Constructor.
    */
@@ -56,18 +52,6 @@ public:
   ~VectorAnimationManager() override;
 
   /**
-   * Add a lifecycle observer
-   * @param[in] observer The object watching this one
-   */
-  void AddObserver(LifecycleObserver& observer);
-
-  /**
-   * Remove a lifecycle observer
-   * @param[in] observer The object watching this one
-   */
-  void RemoveObserver(LifecycleObserver& observer);
-
-  /**
    * Get the vector animation thread.
    * @return A raw pointer pointing to the vector animation thread.
    */
@@ -94,6 +78,14 @@ protected: // Implementation of Processor
    */
   void Process(bool postProcessor) override;
 
+  /**
+   * @copydoc Dali::Integration::Processor::GetProcessorName()
+   */
+  std::string_view GetProcessorName() const override
+  {
+    return "VectorAnimationManager";
+  }
+
 private:
   // Undefined
   VectorAnimationManager(const VectorAnimationManager& manager) = delete;
@@ -102,10 +94,10 @@ private:
   VectorAnimationManager& operator=(const VectorAnimationManager& manager) = delete;
 
 private:
-  std::vector<CallbackBase*>             mEventCallbacks;
-  std::vector<LifecycleObserver*>        mLifecycleObservers;
+  Dali::Integration::OrderedSet<CallbackBase> mEventCallbacks; ///< Event triggered callback lists (owned)
+
   std::unique_ptr<VectorAnimationThread> mVectorAnimationThread;
-  bool                                   mProcessorRegistered;
+  bool                                   mProcessorRegistered : 1;
 };
 
 } // namespace Internal