*/
// INTERNAL INCLUDES
-#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/actors/custom-actor.h>
+#include <dali/public-api/object/base-handle.h>
namespace Dali
{
*/
class DALI_CORE_API WeakHandleBase
{
-
public:
-
/**
* @brief Default constructor which provides an uninitialized Dali::WeakHandleBase.
* @SINCE_1_2.60
* @SINCE_1_2.60
* @param [in] handle A reference to the handle of the DALi object
*/
- WeakHandleBase( BaseHandle& handle );
+ WeakHandleBase(BaseHandle& handle);
/**
* @brief Destructor to free resources.
* @param [in] rhs A reference to the copied WeakHandleBase
* @return A reference to this WeakHandleBase
*/
- WeakHandleBase& operator=( const WeakHandleBase& rhs );
+ WeakHandleBase& operator=(const WeakHandleBase& rhs);
+
+ /**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ WeakHandleBase(WeakHandleBase&& rhs) noexcept;
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ WeakHandleBase& operator=(WeakHandleBase&& rhs) noexcept;
/**
* @brief Equality operator overload.
*/
void Reset();
-
protected:
-
/// @cond internal
struct Impl;
Impl* mImpl;
/// @endcond
};
-
/**
* @brief Weak handle for the given type of DALi object.
* @SINCE_1_2.60
* @see WeakHandleBase
*/
-template < class T >
+template<class T>
class WeakHandle : public WeakHandleBase
{
public:
-
/**
* @copydoc Dali::WeakHandleBase::WeakHandleBase()
*/
/**
* @copydoc Dali::WeakHandleBase::WeakHandleBase( BaseHandle& )
*/
- WeakHandle( T& handle )
- : WeakHandleBase( handle )
+ WeakHandle(T& handle)
+ : WeakHandleBase(handle)
{
}
/**
* @copydoc Dali::WeakHandleBase::~WeakHandleBase()
*/
- ~WeakHandle() {}
+ ~WeakHandle() = default;
/**
* @copydoc Dali::WeakHandleBase::WeakHandleBase(const WeakHandleBase&)
*/
WeakHandle(const WeakHandle& handle)
- : WeakHandleBase( handle )
+ : WeakHandleBase(handle)
{
}
/**
- * @copydoc Dali::WeakHandleBase::operator=()
+ * @copydoc Dali::WeakHandleBase::operator=(const WeakHandleBase& rhs)
*/
- WeakHandle& operator=( const WeakHandle& rhs )
+ WeakHandle& operator=(const WeakHandle& rhs)
{
WeakHandleBase::operator=(rhs);
return *this;
}
/**
+ * @copydoc Dali::WeakHandleBase::WeakHandleBase(WeakHandleBase&& rhs)
+ */
+ WeakHandle(WeakHandle&& rhs) = default;
+
+ /**
+ * @copydoc Dali::WeakHandleBase::operator=(WeakHandleBase&& rhs)
+ */
+ WeakHandle& operator=(WeakHandle&& rhs) = default;
+
+ /**
* @copydoc Dali::WeakHandleBase::operator==()
*/
bool operator==(const WeakHandle& rhs) const
*/
T GetHandle() const
{
- BaseHandle handle( WeakHandleBase::GetBaseHandle() );
- if( handle )
+ BaseHandle handle(WeakHandleBase::GetBaseHandle());
+ if(handle)
{
- return DownCast< T >( handle );
+ return DownCast<T>(handle);
}
else
{