-#ifndef __DALI_INTERNAL_ANIMATOR_CONNECTOR_BASE_H__
-#define __DALI_INTERNAL_ANIMATOR_CONNECTOR_BASE_H__
+#ifndef DALI_INTERNAL_ANIMATOR_CONNECTOR_BASE_H
+#define DALI_INTERNAL_ANIMATOR_CONNECTOR_BASE_H
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
/**
* Constructor.
*/
- AnimatorConnectorBase(
- Object& object,
- Property::Index propertyIndex,
- int32_t componentIndex,
- Internal::AnimatorFunctionBase* animatorFunction,
- AlphaFunction alpha,
- const TimePeriod& period)
- : mParent( nullptr ),
- mObject( &object ),
- mAnimator( nullptr ),
- mAnimatorFunction( animatorFunction ),
+ AnimatorConnectorBase(Object& object,
+ Property::Index propertyIndex,
+ int32_t componentIndex,
+ AlphaFunction alpha,
+ const TimePeriod& period)
+ : mObject(&object),
mAlphaFunction(alpha),
mTimePeriod(period),
- mPropertyIndex( propertyIndex ),
- mComponentIndex( componentIndex )
+ mPropertyIndex(propertyIndex),
+ mComponentIndex(componentIndex)
{
object.AddObserver( *this );
}
/**
* Virtual destructor.
*/
- virtual ~AnimatorConnectorBase()
+ ~AnimatorConnectorBase() override
{
if( mObject )
{
mObject->RemoveObserver( *this );
}
-
- // If there is not a SceneGraph::Animator, the AnimatorConnector is responsible for deleting the mAnimatorFunction
- // otherwise, the animator function ownership is transferred to the SceneGraph::Animator
- if( !mAnimator )
- {
- delete mAnimatorFunction;
- }
}
/**
void CreateAnimator()
{
DALI_ASSERT_DEBUG( mAnimator == nullptr );
- DALI_ASSERT_DEBUG( mAnimatorFunction != nullptr );
DALI_ASSERT_DEBUG( mParent != nullptr );
//Get the PropertyOwner the animator is going to animate
/**
* From Object::Observer
*/
- virtual void SceneObjectAdded( Object& object ) override final
+ void SceneObjectAdded( Object& object ) final
{
// If the animator has not been created yet, create it now.
if( !mAnimator && mObject )
/**
* From Object::Observer
*/
- virtual void SceneObjectRemoved( Object& object ) override final
+ void SceneObjectRemoved( Object& object ) final
{
}
/**
* From Object::Observer
*/
- virtual void ObjectDestroyed( Object& object )
+ void ObjectDestroyed( Object& object ) override
{
mObject = nullptr;
}
protected:
-
- Animation* mParent; ///< The parent owns the connector.
- Object* mObject; ///< Not owned by the animator connector. Valid until ObjectDestroyed() is called.
- SceneGraph::AnimatorBase* mAnimator;
- Internal::AnimatorFunctionBase* mAnimatorFunction; ///< Owned by the animator connector until an Scenegraph::Animator is created
+ Animation* mParent{nullptr}; ///< The parent owns the connector.
+ Object* mObject; ///< Not owned by the animator connector. Valid until ObjectDestroyed() is called.
+ SceneGraph::AnimatorBase* mAnimator{nullptr};
AlphaFunction mAlphaFunction;
- TimePeriod mTimePeriod;
+ TimePeriod mTimePeriod;
Property::Index mPropertyIndex;
- int32_t mComponentIndex;
-
+ int32_t mComponentIndex;
};
} // namespace Internal
} // namespace Dali
-#endif // __DALI_INTERNAL_ANIMATOR_CONNECTOR_BASE_H__
+#endif // DALI_INTERNAL_ANIMATOR_CONNECTOR_BASE_H