*
*/
+// EXTERNAL INCLUDES
+#include <memory>
+
// INTERNAL INCLUDES
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/internal/common/buffer-index.h>
#include <dali/internal/update/common/property-owner.h>
+#include <dali/internal/update/manager/update-proxy-impl.h>
namespace Dali
{
namespace Internal
{
-class UpdateProxy;
-
namespace SceneGraph
{
/**
* Construct a new FrameCallbackProcessor.
*/
- FrameCallbackProcessor( TransformManager& transformManager, Node& rootNode );
+ FrameCallbackProcessor( TransformManager& transformManager );
/**
* Non-virtual Destructor.
*/
void Update( BufferIndex bufferIndex, float elapsedSeconds );
+ /**
+ * Called by the UpdateManager when the node hierarchy changes.
+ */
+ void NodeHierarchyChanged()
+ {
+ mNodeHierarchyChanged = true;
+ }
+
private:
// From PropertyOwner::Observer
struct FrameCallbackInfo
{
- FrameCallbackInterface* frameCallback;
- UpdateProxy* updateProxyImpl;
+ /**
+ * Default Constructor
+ * @param[in] frameCallbackObject A pointer to the frame-callback object
+ * @param[in] updateProxyPtr A raw pointer to the newly created updateProxy
+ * @note Ownership of @updateProxyPtr is passed to this class.
+ */
+ FrameCallbackInfo( FrameCallbackInterface* frameCallbackObject, UpdateProxy* updateProxyPtr )
+ : frameCallback( frameCallbackObject ),
+ updateProxyImpl( updateProxyPtr )
+ {
+ }
+
+ ~FrameCallbackInfo() = default; ///< Default destructor.
+
+ // Movable but not copyable
+ FrameCallbackInfo( const FrameCallbackInfo& ) = delete; ///< Deleted copy constructor.
+ FrameCallbackInfo( FrameCallbackInfo&& ) = default; ///< Default move constructor.
+ FrameCallbackInfo& operator=( const FrameCallbackInfo& ) = delete; ///< Deleted copy assignment operator.
+ FrameCallbackInfo& operator=( FrameCallbackInfo&& ) = default; ///< Default move assignment operator.
+
+ // Data
+ FrameCallbackInterface* frameCallback{ nullptr }; ///< Pointer to the implementation of the FrameCallbackInterface.
+ std::unique_ptr< UpdateProxy > updateProxyImpl{ nullptr }; ///< A unique pointer to the implementation of the UpdateProxy.
};
- std::vector< FrameCallbackInfo > mFrameCallbacks;
+ std::vector< FrameCallbackInfo > mFrameCallbacks; ///< A container of all the frame-callbacks & accompanying update-proxies.
TransformManager& mTransformManager;
- Node& mRootNode;
+
+ bool mNodeHierarchyChanged; ///< Set to true if the node hierarchy changes
};
} // namespace SceneGraph