From: Richard Huang Date: Wed, 29 Jul 2020 14:33:38 +0000 (+0100) Subject: Add move semantics to common and base Toolkit classes X-Git-Tag: dali_1.9.23~1^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=d886d0a7b8637b2ad52844096091b63991157ff3 Add move semantics to common and base Toolkit classes Change-Id: I45a75274e668d12a15c07b9b3282613d56cfc192 --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-AsyncImageLoader.cpp b/automated-tests/src/dali-toolkit/utc-Dali-AsyncImageLoader.cpp index 7375515..175ccfc 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-AsyncImageLoader.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-AsyncImageLoader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -123,6 +123,22 @@ int UtcDaliAsyncImageLoaderCopyConstructor(void) END_TEST; } +int UtcDaliAsyncImageLoaderMoveConstructor(void) +{ + ToolkitTestApplication application; + + AsyncImageLoader loader = AsyncImageLoader::New( ); + DALI_TEST_CHECK( loader ); + DALI_TEST_EQUALS( 1, loader.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + + AsyncImageLoader moved = std::move( loader ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( !loader ); + + END_TEST; +} + int UtcDaliAsyncImageLoaderAssignmentOperator(void) { ToolkitTestApplication application; @@ -140,6 +156,23 @@ int UtcDaliAsyncImageLoaderAssignmentOperator(void) END_TEST; } +int UtcDaliAsyncImageLoaderMoveAssignment(void) +{ + ToolkitTestApplication application; + + AsyncImageLoader loader = AsyncImageLoader::New( ); + DALI_TEST_CHECK( loader ); + DALI_TEST_EQUALS( 1, loader.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + + AsyncImageLoader moved; + moved = std::move( loader ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( !loader ); + + END_TEST; +} + int UtcDaliAsyncImageLoaderDownCastP(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp index 92e64ec..e99c8f7 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Button.cpp @@ -163,6 +163,25 @@ int UtcDaliButtonCopyConstructorP(void) END_TEST; } +int UtcDaliButtonMoveConstructor(void) +{ + ToolkitTestApplication application; + + Button button = PushButton::New(); + DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), false , TEST_LOCATION ); + button.SetProperty( Button::Property::TOGGLABLE, true ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), true , TEST_LOCATION ); + + Button moved = std::move( button ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( moved.GetProperty( Button::Property::TOGGLABLE ), true , TEST_LOCATION ); + DALI_TEST_CHECK( !button ); + + END_TEST; +} + int UtcDaliButtonAssignmentOperatorP(void) { TestApplication application; @@ -176,6 +195,26 @@ int UtcDaliButtonAssignmentOperatorP(void) END_TEST; } +int UtcDaliButtonMoveAssignment(void) +{ + ToolkitTestApplication application; + + Button button = PushButton::New(); + DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), false , TEST_LOCATION ); + button.SetProperty( Button::Property::TOGGLABLE, true ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), true , TEST_LOCATION ); + + Button moved; + moved = std::move( button ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( moved.GetProperty( Button::Property::TOGGLABLE ), true , TEST_LOCATION ); + DALI_TEST_CHECK( !button ); + + END_TEST; +} + int UtcDaliButtonDownCastP(void) { TestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp b/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp index cc8d381..799a069 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp @@ -90,6 +90,25 @@ int UtcDaliCheckBoxButtonCopyConstructorP(void) END_TEST; } +int UtcDaliCheckBoxButtonMoveConstructor(void) +{ + ToolkitTestApplication application; + + CheckBoxButton button = CheckBoxButton::New(); + DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), true , TEST_LOCATION ); + button.SetProperty( Button::Property::TOGGLABLE, false ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), false , TEST_LOCATION ); + + CheckBoxButton moved = std::move( button ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( moved.GetProperty( Button::Property::TOGGLABLE ), false , TEST_LOCATION ); + DALI_TEST_CHECK( !button ); + + END_TEST; +} + int UtcDaliCheckBoxButtonAssignmentOperatorP(void) { ToolkitTestApplication application; @@ -103,6 +122,26 @@ int UtcDaliCheckBoxButtonAssignmentOperatorP(void) END_TEST; } +int UtcDaliCheckBoxButtonMoveAssignment(void) +{ + ToolkitTestApplication application; + + CheckBoxButton button = CheckBoxButton::New(); + DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), true , TEST_LOCATION ); + button.SetProperty( Button::Property::TOGGLABLE, false ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), false , TEST_LOCATION ); + + CheckBoxButton moved; + moved = std::move( button ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( moved.GetProperty( Button::Property::TOGGLABLE ), false , TEST_LOCATION ); + DALI_TEST_CHECK( !button ); + + END_TEST; +} + int UtcDaliCheckBoxButtonNewP(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp index 1f1b2bc..d10cbec 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Control.cpp @@ -181,6 +181,43 @@ int UtcDaliControlCopyAndAssignment(void) END_TEST; } +int UtcDaliControlMoveConstructor(void) +{ + ToolkitTestApplication application; + + Control control = Control::New(); + DALI_TEST_EQUALS( 1, control.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + control.SetProperty( Actor::Property::SENSITIVE, false ); + DALI_TEST_CHECK( false == control.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + + Control moved = std::move( control ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + DALI_TEST_CHECK( !control ); + + END_TEST; +} + +int UtcDaliControlMoveAssignment(void) +{ + ToolkitTestApplication application; + + Control control = Control::New(); + DALI_TEST_EQUALS( 1, control.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + control.SetProperty( Actor::Property::SENSITIVE, false ); + DALI_TEST_CHECK( false == control.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + + Control moved; + moved = std::move( control ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + DALI_TEST_CHECK( !control ); + + END_TEST; +} + int UtcDaliControlDownCast(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-FlexContainer.cpp b/automated-tests/src/dali-toolkit/utc-Dali-FlexContainer.cpp index a698b3c..61c4a58 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-FlexContainer.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-FlexContainer.cpp @@ -109,6 +109,24 @@ int UtcDaliToolkitFlexContainerCopyConstructorP(void) END_TEST; } +int UtcDaliFlexContainerMoveConstructor(void) +{ + ToolkitTestApplication application; + + FlexContainer flexContainer = FlexContainer::New(); + DALI_TEST_EQUALS( 1, flexContainer.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW_REVERSE ); + DALI_TEST_CHECK( flexContainer.GetProperty( FlexContainer::Property::FLEX_DIRECTION ) == FlexContainer::ROW_REVERSE ); + + FlexContainer moved = std::move( flexContainer ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( moved.GetProperty( FlexContainer::Property::FLEX_DIRECTION ) == FlexContainer::ROW_REVERSE ); + DALI_TEST_CHECK( !flexContainer ); + + END_TEST; +} + int UtcDaliToolkitFlexContainerAssignmentOperatorP(void) { ToolkitTestApplication application; @@ -122,6 +140,25 @@ int UtcDaliToolkitFlexContainerAssignmentOperatorP(void) END_TEST; } +int UtcDaliFlexContainerMoveAssignment(void) +{ + ToolkitTestApplication application; + + FlexContainer flexContainer = FlexContainer::New(); + DALI_TEST_EQUALS( 1, flexContainer.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + flexContainer.SetProperty( FlexContainer::Property::FLEX_DIRECTION, FlexContainer::ROW_REVERSE ); + DALI_TEST_CHECK( flexContainer.GetProperty( FlexContainer::Property::FLEX_DIRECTION ) == FlexContainer::ROW_REVERSE ); + + FlexContainer moved; + moved = std::move( flexContainer ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( moved.GetProperty( FlexContainer::Property::FLEX_DIRECTION ) == FlexContainer::ROW_REVERSE ); + DALI_TEST_CHECK( !flexContainer ); + + END_TEST; +} + // Positive test case for a method int UtcDaliToolkitFlexContainerGetPropertyP(void) { diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp index 204cf23..263a4f2 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp @@ -126,6 +126,24 @@ int UtcDaliImageViewCopyConstructorP(void) END_TEST; } +int UtcDaliImageViewMoveConstructor(void) +{ + ToolkitTestApplication application; + + ImageView imageView = ImageView::New(); + DALI_TEST_EQUALS( 1, imageView.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + imageView.SetProperty( Actor::Property::SENSITIVE, false ); + DALI_TEST_CHECK( false == imageView.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + + ImageView moved = std::move( imageView ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + DALI_TEST_CHECK( !imageView ); + + END_TEST; +} + int UtcDaliImageViewAssignmentOperatorP(void) { ToolkitTestApplication application; @@ -139,6 +157,25 @@ int UtcDaliImageViewAssignmentOperatorP(void) END_TEST; } +int UtcDaliImageViewMoveAssignment(void) +{ + ToolkitTestApplication application; + + ImageView imageView = ImageView::New(); + DALI_TEST_EQUALS( 1, imageView.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + imageView.SetProperty( Actor::Property::SENSITIVE, false ); + DALI_TEST_CHECK( false == imageView.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + + ImageView moved; + moved = std::move( imageView ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + DALI_TEST_CHECK( !imageView ); + + END_TEST; +} + int UtcDaliImageViewDownCastP(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp index 6b5f743..1ba8d0b 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp @@ -166,6 +166,75 @@ int UtcDaliItemViewNew(void) END_TEST; } +int UtcDaliItemViewCopyConstructor(void) +{ + ToolkitTestApplication application; + + TestItemFactory factory; + ItemView itemView = ItemView::New( factory ); + DALI_TEST_CHECK( itemView ); + + ItemView copy( itemView ); + DALI_TEST_CHECK( copy ); + + END_TEST; +} + +int UtcDaliItemViewCopyAssignment(void) +{ + ToolkitTestApplication application; + + TestItemFactory factory; + ItemView itemView = ItemView::New( factory ); + DALI_TEST_CHECK( itemView ); + + ItemView copy; + copy = itemView; + DALI_TEST_CHECK( copy ); + DALI_TEST_EQUALS( itemView, copy, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliItemViewMoveConstructor(void) +{ + ToolkitTestApplication application; + + TestItemFactory factory; + ItemView itemView = ItemView::New( factory ); + DALI_TEST_EQUALS( 1, itemView.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + itemView.SetProperty( Actor::Property::SENSITIVE, false ); + DALI_TEST_CHECK( false == itemView.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + + ItemView moved = std::move( itemView ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + DALI_TEST_CHECK( !itemView ); + + END_TEST; +} + +int UtcDaliItemViewMoveAssignment(void) +{ + ToolkitTestApplication application; + + TestItemFactory factory; + ItemView itemView = ItemView::New( factory ); + DALI_TEST_EQUALS( 1, itemView.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + itemView.SetProperty( Actor::Property::SENSITIVE, false ); + DALI_TEST_CHECK( false == itemView.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + + ItemView moved; + moved = std::move( itemView ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + DALI_TEST_CHECK( !itemView ); + + END_TEST; +} + int UtcDaliItemViewDownCast(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Model3dView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Model3dView.cpp index b13cacb..b5e3429 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Model3dView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Model3dView.cpp @@ -174,6 +174,43 @@ int UtcDaliModelCopyAndAssignment(void) END_TEST; } +int UtcDaliModelMoveConstructor(void) +{ + ToolkitTestApplication application; + + Model3dView view = Toolkit::Model3dView::New(); + DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + view.SetProperty( Actor::Property::SENSITIVE, false ); + DALI_TEST_CHECK( false == view.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + + Model3dView moved = std::move( view ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + DALI_TEST_CHECK( !view ); + + END_TEST; +} + +int UtcDaliModelMoveAssignment(void) +{ + ToolkitTestApplication application; + + Model3dView view = Toolkit::Model3dView::New(); + DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + view.SetProperty( Actor::Property::SENSITIVE, false ); + DALI_TEST_CHECK( false == view.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + + Model3dView moved; + moved = std::move( view ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + DALI_TEST_CHECK( !view ); + + END_TEST; +} + int UtcDaliModelTypeRegistry(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ProgressBar.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ProgressBar.cpp index 9e27978..9e421fd 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ProgressBar.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ProgressBar.cpp @@ -115,6 +115,71 @@ int UtcDaliProgressBarDestructor(void) END_TEST; } +int UtcDaliProgressBarCopyConstructor(void) +{ + ToolkitTestApplication application; + + ProgressBar progressBar = ProgressBar::New(); + DALI_TEST_CHECK( progressBar ); + + ProgressBar copy( progressBar ); + DALI_TEST_CHECK( copy ); + + END_TEST; +} + +int UtcDaliProgressBarCopyAssignment(void) +{ + ToolkitTestApplication application; + + ProgressBar progressBar = ProgressBar::New(); + DALI_TEST_CHECK( progressBar ); + + ProgressBar copy; + copy = progressBar; + DALI_TEST_CHECK( copy ); + DALI_TEST_EQUALS( progressBar, copy, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliProgressBarMoveConstructor(void) +{ + ToolkitTestApplication application; + + ProgressBar progressBar = ProgressBar::New(); + DALI_TEST_EQUALS( 1, progressBar.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + progressBar.SetProperty( Actor::Property::SENSITIVE, false ); + DALI_TEST_CHECK( false == progressBar.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + + ProgressBar moved = std::move( progressBar ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + DALI_TEST_CHECK( !progressBar ); + + END_TEST; +} + +int UtcDaliProgressBarMoveAssignment(void) +{ + ToolkitTestApplication application; + + ProgressBar progressBar = ProgressBar::New(); + DALI_TEST_EQUALS( 1, progressBar.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + progressBar.SetProperty( Actor::Property::SENSITIVE, false ); + DALI_TEST_CHECK( false == progressBar.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + + ProgressBar moved; + moved = std::move( progressBar ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + DALI_TEST_CHECK( !progressBar ); + + END_TEST; +} + int UtcDaliProgressBarDownCast(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp b/automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp index 4d0de67..044018b 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp @@ -187,6 +187,25 @@ int UtcDaliPushButtonCopyConstructorP(void) END_TEST; } +int UtcDaliPushButtonMoveConstructor(void) +{ + ToolkitTestApplication application; + + PushButton button = PushButton::New(); + DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), false , TEST_LOCATION ); + button.SetProperty( Button::Property::TOGGLABLE, true ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), true , TEST_LOCATION ); + + PushButton moved = std::move( button ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( moved.GetProperty( Button::Property::TOGGLABLE ), true , TEST_LOCATION ); + DALI_TEST_CHECK( !button ); + + END_TEST; +} + int UtcDaliPushButtonAssignmentOperatorP(void) { TestApplication application; @@ -200,6 +219,26 @@ int UtcDaliPushButtonAssignmentOperatorP(void) END_TEST; } +int UtcDaliPushButtonMoveAssignment(void) +{ + ToolkitTestApplication application; + + PushButton button = PushButton::New(); + DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), false , TEST_LOCATION ); + button.SetProperty( Button::Property::TOGGLABLE, true ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), true , TEST_LOCATION ); + + PushButton moved; + moved = std::move( button ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( moved.GetProperty( Button::Property::TOGGLABLE ), true , TEST_LOCATION ); + DALI_TEST_CHECK( !button ); + + END_TEST; +} + int UtcDaliPushButtonNewP(void) { TestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp b/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp index d56de3e..ee1ebf5 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp @@ -86,6 +86,25 @@ int UtcDaliRadioButtonCopyConstructorP(void) END_TEST; } +int UtcDaliRadioButtonMoveConstructor(void) +{ + ToolkitTestApplication application; + + RadioButton button = RadioButton::New(); + DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), true , TEST_LOCATION ); + button.SetProperty( Button::Property::TOGGLABLE, false ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), false , TEST_LOCATION ); + + RadioButton moved = std::move( button ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( moved.GetProperty( Button::Property::TOGGLABLE ), false , TEST_LOCATION ); + DALI_TEST_CHECK( !button ); + + END_TEST; +} + int UtcDaliRadioButtonAssignmentOperatorP(void) { TestApplication application; @@ -99,6 +118,26 @@ int UtcDaliRadioButtonAssignmentOperatorP(void) END_TEST; } +int UtcDaliRadioButtonMoveAssignment(void) +{ + ToolkitTestApplication application; + + RadioButton button = RadioButton::New(); + DALI_TEST_EQUALS( 1, button.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), true , TEST_LOCATION ); + button.SetProperty( Button::Property::TOGGLABLE, false ); + DALI_TEST_EQUALS( button.GetProperty( Button::Property::TOGGLABLE ), false , TEST_LOCATION ); + + RadioButton moved; + moved = std::move( button ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( moved.GetProperty( Button::Property::TOGGLABLE ), false , TEST_LOCATION ); + DALI_TEST_CHECK( !button ); + + END_TEST; +} + int UtcDaliRadioButtonNewP(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp index c1fee47..4e3974d 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp @@ -289,6 +289,24 @@ int UtcDaliToolkitScrollViewCopyConstructorP(void) END_TEST; } +int UtcDaliScrollViewMoveConstructor(void) +{ + ToolkitTestApplication application; + + ScrollView scrollView = ScrollView::New(); + DALI_TEST_EQUALS( 1, scrollView.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) ); + DALI_TEST_EQUALS( scrollView.GetProperty( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION ); + + ScrollView moved = std::move( scrollView ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( moved.GetProperty( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION ); + DALI_TEST_CHECK( !scrollView ); + + END_TEST; +} + int UtcDaliToolkitScrollViewAssignmentOperatorP(void) { ToolkitTestApplication application; @@ -296,12 +314,32 @@ int UtcDaliToolkitScrollViewAssignmentOperatorP(void) ScrollView scrollView = ScrollView::New(); scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) ); - ScrollView copy = scrollView; + ScrollView copy; + copy = scrollView; DALI_TEST_CHECK( copy ); DALI_TEST_CHECK( copy.GetProperty( ScrollView::Property::SCROLL_POSITION ) == scrollView.GetProperty( ScrollView::Property::SCROLL_POSITION ) ); END_TEST; } +int UtcDaliScrollViewMoveAssignment(void) +{ + ToolkitTestApplication application; + + ScrollView scrollView = ScrollView::New(); + DALI_TEST_EQUALS( 1, scrollView.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) ); + DALI_TEST_EQUALS( scrollView.GetProperty( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION ); + + ScrollView moved; + moved = std::move( scrollView ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_EQUALS( moved.GetProperty( ScrollView::Property::SCROLL_POSITION ), Vector2(10.0f, 10.0f), TEST_LOCATION ); + DALI_TEST_CHECK( !scrollView ); + + END_TEST; +} + int UtcDaliScrollViewDestructorP(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp index ccec03e..e9cc39b 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp @@ -77,6 +77,71 @@ int UtcDaliSliderNew(void) END_TEST; } +int UtcDaliSliderCopyConstructor(void) +{ + ToolkitTestApplication application; + + Slider slider = Slider::New(); + DALI_TEST_CHECK( slider ); + + Slider copy( slider ); + DALI_TEST_CHECK( copy ); + + END_TEST; +} + +int UtcDaliSliderCopyAssignment(void) +{ + ToolkitTestApplication application; + + Slider slider = Slider::New(); + DALI_TEST_CHECK( slider ); + + Slider copy; + copy = slider; + DALI_TEST_CHECK( copy ); + DALI_TEST_EQUALS( slider, copy, TEST_LOCATION ); + + END_TEST; +} + +int UtcDaliSliderMoveConstructor(void) +{ + ToolkitTestApplication application; + + Slider slider = Slider::New(); + DALI_TEST_EQUALS( 1, slider.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + slider.SetProperty( Actor::Property::SENSITIVE, false ); + DALI_TEST_CHECK( false == slider.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + + Slider moved = std::move( slider ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + DALI_TEST_CHECK( !slider ); + + END_TEST; +} + +int UtcDaliSliderMoveAssignment(void) +{ + ToolkitTestApplication application; + + Slider slider = Slider::New(); + DALI_TEST_EQUALS( 1, slider.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + slider.SetProperty( Actor::Property::SENSITIVE, false ); + DALI_TEST_CHECK( false == slider.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + + Slider moved; + moved = std::move( slider ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( false == moved.GetProperty< bool >( Actor::Property::SENSITIVE ) ); + DALI_TEST_CHECK( !slider ); + + END_TEST; +} + int UtcDaliSliderDestructor(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp index 51b1cd7..f86d8aa 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp @@ -360,6 +360,23 @@ int UtcDaliToolkitTextEditorCopyConstructorP(void) END_TEST; } +int UtcDaliTextEditorMoveConstructor(void) +{ + ToolkitTestApplication application; + + TextEditor textEditor = TextEditor::New(); + textEditor.SetProperty( TextEditor::Property::TEXT, "Test" ); + DALI_TEST_CHECK( textEditor.GetProperty( TextEditor::Property::TEXT ) == "Test" ); + + TextEditor moved = std::move( textEditor ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( moved.GetProperty( TextEditor::Property::TEXT ) == "Test" ); + DALI_TEST_CHECK( !textEditor ); + + END_TEST; +} + int UtcDaliToolkitTextEditorAssignmentOperatorP(void) { ToolkitTestApplication application; @@ -373,6 +390,24 @@ int UtcDaliToolkitTextEditorAssignmentOperatorP(void) END_TEST; } +int UtcDaliTextEditorMoveAssignment(void) +{ + ToolkitTestApplication application; + + TextEditor textEditor = TextEditor::New(); + textEditor.SetProperty( TextEditor::Property::TEXT, "Test" ); + DALI_TEST_CHECK( textEditor.GetProperty( TextEditor::Property::TEXT ) == "Test" ); + + TextEditor moved; + moved = std::move( textEditor ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( moved.GetProperty( TextEditor::Property::TEXT ) == "Test" ); + DALI_TEST_CHECK( !textEditor ); + + END_TEST; +} + int UtcDaliTextEditorNewP(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index 4751e34..d7ca31f 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -387,6 +387,23 @@ int UtcDaliToolkitTextFieldCopyConstructorP(void) END_TEST; } +int UtcDaliTextFieldMoveConstructor(void) +{ + ToolkitTestApplication application; + + TextField textField = TextField::New(); + textField.SetProperty( TextEditor::Property::TEXT, "Test" ); + DALI_TEST_CHECK( textField.GetProperty( TextField::Property::TEXT ) == "Test" ); + + TextField moved = std::move( textField ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( moved.GetProperty( TextField::Property::TEXT ) == "Test" ); + DALI_TEST_CHECK( !textField ); + + END_TEST; +} + int UtcDaliToolkitTextFieldAssignmentOperatorP(void) { ToolkitTestApplication application; @@ -400,6 +417,24 @@ int UtcDaliToolkitTextFieldAssignmentOperatorP(void) END_TEST; } +int UtcDaliTextFieldMoveAssignment(void) +{ + ToolkitTestApplication application; + + TextField textField = TextField::New(); + textField.SetProperty( TextEditor::Property::TEXT, "Test" ); + DALI_TEST_CHECK( textField.GetProperty( TextField::Property::TEXT ) == "Test" ); + + TextField moved; + moved = std::move( textField ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( moved.GetProperty( TextField::Property::TEXT ) == "Test" ); + DALI_TEST_CHECK( !textField ); + + END_TEST; +} + int UtcDaliTextFieldNewP(void) { ToolkitTestApplication application; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp index 884079e..f9128fd 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp @@ -230,6 +230,23 @@ int UtcDaliToolkitTextLabelCopyConstructorP(void) END_TEST; } +int UtcDaliTextLabelMoveConstructor(void) +{ + ToolkitTestApplication application; + + TextLabel textLabel = TextLabel::New(); + textLabel.SetProperty( TextLabel::Property::TEXT, "Test" ); + DALI_TEST_CHECK( textLabel.GetProperty( TextLabel::Property::TEXT ) == "Test" ); + + TextLabel moved = std::move( textLabel ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( moved.GetProperty( TextLabel::Property::TEXT ) == "Test" ); + DALI_TEST_CHECK( !textLabel ); + + END_TEST; +} + int UtcDaliToolkitTextLabelAssignmentOperatorP(void) { ToolkitTestApplication application; @@ -243,6 +260,24 @@ int UtcDaliToolkitTextLabelAssignmentOperatorP(void) END_TEST; } +int UtcDaliTextLabelMoveAssignment(void) +{ + ToolkitTestApplication application; + + TextLabel textLabel = TextLabel::New(); + textLabel.SetProperty( TextLabel::Property::TEXT, "Test" ); + DALI_TEST_CHECK( textLabel.GetProperty( TextLabel::Property::TEXT ) == "Test" ); + + TextLabel moved; + moved = std::move( textLabel ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( moved.GetProperty( TextLabel::Property::TEXT ) == "Test" ); + DALI_TEST_CHECK( !textLabel ); + + END_TEST; +} + // Positive test case for a method int UtcDaliToolkitTextLabelGetPropertyP(void) { @@ -1653,4 +1688,4 @@ int UtcDaliToolkitTextlabelLastCharacterIndex(void) DALI_TEST_EQUALS( indexArray.GetElementAt(0).Get(), 10, TEST_LOCATION ); END_TEST; -} \ No newline at end of file +} diff --git a/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp index 24651f6..54cb6f7 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-VideoView.cpp @@ -274,6 +274,43 @@ int UtcDaliVideoViewCopyAndAssignment(void) END_TEST; } +int UtcDaliVideoViewMoveConstructor(void) +{ + ToolkitTestApplication application; + + VideoView view = Toolkit::VideoView::New(); + DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + view.SetProperty( VideoView::Property::LOOPING, true ); + DALI_TEST_CHECK( view.GetProperty( VideoView::Property::LOOPING ) ); + + VideoView moved = std::move( view ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( moved.GetProperty( VideoView::Property::LOOPING ) ); + DALI_TEST_CHECK( !view ); + + END_TEST; +} + +int UtcDaliVideoViewMoveAssignment(void) +{ + ToolkitTestApplication application; + + VideoView view = Toolkit::VideoView::New(); + DALI_TEST_EQUALS( 1, view.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + view.SetProperty( VideoView::Property::LOOPING, true ); + DALI_TEST_CHECK( view.GetProperty( VideoView::Property::LOOPING ) ); + + VideoView moved; + moved = std::move( view ); + DALI_TEST_CHECK( moved ); + DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION ); + DALI_TEST_CHECK( moved.GetProperty( VideoView::Property::LOOPING ) ); + DALI_TEST_CHECK( !view ); + + END_TEST; +} + int UtcDaliVideoViewTypeRegistry(void) { ToolkitTestApplication application; diff --git a/dali-toolkit/public-api/controls/buttons/button.cpp b/dali-toolkit/public-api/controls/buttons/button.cpp index 2855636..02adab4 100644 --- a/dali-toolkit/public-api/controls/buttons/button.cpp +++ b/dali-toolkit/public-api/controls/buttons/button.cpp @@ -36,19 +36,13 @@ namespace Toolkit Button::Button() {} -Button::Button( const Button& button ) -: Control( button ) -{ -} +Button::Button( const Button& button ) = default; -Button& Button::operator=( const Button& button ) -{ - if( &button != this ) - { - Control::operator=( button ); - } - return *this; -} +Button::Button( Button&& rhs ) = default; + +Button& Button::operator=( const Button& button ) = default; + +Button& Button::operator=( Button&& rhs ) = default; Button::~Button() { diff --git a/dali-toolkit/public-api/controls/buttons/button.h b/dali-toolkit/public-api/controls/buttons/button.h index 2544d46..c9c79d6 100644 --- a/dali-toolkit/public-api/controls/buttons/button.h +++ b/dali-toolkit/public-api/controls/buttons/button.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_BUTTON_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -236,6 +236,14 @@ public: Button( const Button& button ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + Button( Button&& rhs ); + + /** * @brief Assignment operator. * @SINCE_1_0.0 * @param[in] button Handle to an object @@ -244,6 +252,15 @@ public: Button& operator=( const Button& button ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + Button& operator=( Button&& rhs ); + + /** * @brief Downcasts a handle to Button handle. * * If handle points to a Button, the downcast produces valid handle. diff --git a/dali-toolkit/public-api/controls/buttons/check-box-button.cpp b/dali-toolkit/public-api/controls/buttons/check-box-button.cpp index e2f7f56..69dbdd3 100644 --- a/dali-toolkit/public-api/controls/buttons/check-box-button.cpp +++ b/dali-toolkit/public-api/controls/buttons/check-box-button.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -34,19 +34,13 @@ CheckBoxButton::CheckBoxButton() { } -CheckBoxButton::CheckBoxButton( const CheckBoxButton& checkBox ) -: Button( checkBox ) -{ -} +CheckBoxButton::CheckBoxButton( const CheckBoxButton& checkBox ) = default; -CheckBoxButton& CheckBoxButton::operator=( const CheckBoxButton& checkBox ) -{ - if( &checkBox != this ) - { - Button::operator=( checkBox ); - } - return *this; -} +CheckBoxButton::CheckBoxButton( CheckBoxButton&& rhs ) = default; + +CheckBoxButton& CheckBoxButton::operator=( const CheckBoxButton& checkBox ) = default; + +CheckBoxButton& CheckBoxButton::operator=( CheckBoxButton&& rhs ) = default; CheckBoxButton::~CheckBoxButton() { diff --git a/dali-toolkit/public-api/controls/buttons/check-box-button.h b/dali-toolkit/public-api/controls/buttons/check-box-button.h index 675ae70..4ae4608 100644 --- a/dali-toolkit/public-api/controls/buttons/check-box-button.h +++ b/dali-toolkit/public-api/controls/buttons/check-box-button.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_CHECK_BOX_BUTTON_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -97,6 +97,14 @@ public: CheckBoxButton( const CheckBoxButton& checkBox ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + CheckBoxButton( CheckBoxButton&& rhs ); + + /** * @brief Assignment operator. * @SINCE_1_0.0 * @param[in] checkBox Handle to an object @@ -105,6 +113,15 @@ public: CheckBoxButton& operator=( const CheckBoxButton& checkBox ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + CheckBoxButton& operator=( CheckBoxButton&& rhs ); + + /** * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. diff --git a/dali-toolkit/public-api/controls/buttons/push-button.cpp b/dali-toolkit/public-api/controls/buttons/push-button.cpp index e8ae5a1..0cc3706 100644 --- a/dali-toolkit/public-api/controls/buttons/push-button.cpp +++ b/dali-toolkit/public-api/controls/buttons/push-button.cpp @@ -41,19 +41,13 @@ PushButton::PushButton( Internal::PushButton& implementation ) { } -PushButton::PushButton( const PushButton& pushButton ) -: Button( pushButton ) -{ -} +PushButton::PushButton( const PushButton& pushButton ) = default; -PushButton& PushButton::operator=( const PushButton& pushButton ) -{ - if( &pushButton != this ) - { - Button::operator=( pushButton ); - } - return *this; -} +PushButton::PushButton( PushButton&& rhs ) = default; + +PushButton& PushButton::operator=( const PushButton& pushButton ) = default; + +PushButton& PushButton::operator=( PushButton&& rhs ) = default; PushButton::PushButton( Dali::Internal::CustomActor* internal ) : Button( internal ) diff --git a/dali-toolkit/public-api/controls/buttons/push-button.h b/dali-toolkit/public-api/controls/buttons/push-button.h index 4a6b0c2..e237cc8 100644 --- a/dali-toolkit/public-api/controls/buttons/push-button.h +++ b/dali-toolkit/public-api/controls/buttons/push-button.h @@ -134,6 +134,14 @@ public: PushButton( const PushButton& pushButton ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + PushButton( PushButton&& rhs ); + + /** * @brief Assignment operator. * @SINCE_1_0.0 * @param[in] pushButton Handle to an object @@ -142,6 +150,15 @@ public: PushButton& operator=( const PushButton& pushButton ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + PushButton& operator=( PushButton&& rhs ); + + /** * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. diff --git a/dali-toolkit/public-api/controls/buttons/radio-button.cpp b/dali-toolkit/public-api/controls/buttons/radio-button.cpp index 7538723..d9d8d60 100644 --- a/dali-toolkit/public-api/controls/buttons/radio-button.cpp +++ b/dali-toolkit/public-api/controls/buttons/radio-button.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -39,19 +39,13 @@ RadioButton::RadioButton( Internal::RadioButton& implementation ) { } -RadioButton::RadioButton( const RadioButton& radioButton ) - : Button( radioButton ) -{ -} +RadioButton::RadioButton( const RadioButton& radioButton ) = default; -RadioButton& RadioButton::operator=( const RadioButton& radioButton ) -{ - if( &radioButton != this ) - { - Button::operator=( radioButton ); - } - return *this; -} +RadioButton::RadioButton( RadioButton&& rhs ) = default; + +RadioButton& RadioButton::operator=( const RadioButton& radioButton ) = default; + +RadioButton& RadioButton::operator=( RadioButton&& rhs ) = default; RadioButton::RadioButton( Dali::Internal::CustomActor* internal ) : Button( internal ) diff --git a/dali-toolkit/public-api/controls/buttons/radio-button.h b/dali-toolkit/public-api/controls/buttons/radio-button.h index d241e74..b125ab3 100644 --- a/dali-toolkit/public-api/controls/buttons/radio-button.h +++ b/dali-toolkit/public-api/controls/buttons/radio-button.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_RADIO_BUTTON_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2029 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. @@ -103,6 +103,14 @@ class DALI_TOOLKIT_API RadioButton: public Button RadioButton( const RadioButton& radioButton ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + RadioButton( RadioButton&& rhs ); + + /** * @brief Assignment operator. * @SINCE_1_0.0 * @param[in] radioButton Handle to an object @@ -111,6 +119,15 @@ class DALI_TOOLKIT_API RadioButton: public Button RadioButton& operator=( const RadioButton& radioButton ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + RadioButton& operator=( RadioButton&& rhs ); + + /** * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. diff --git a/dali-toolkit/public-api/controls/control.cpp b/dali-toolkit/public-api/controls/control.cpp index d9b2f8f..07170ff 100644 --- a/dali-toolkit/public-api/controls/control.cpp +++ b/dali-toolkit/public-api/controls/control.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -40,23 +40,17 @@ Control::Control() { } -Control::Control( const Control& uiControl ) -: CustomActor( uiControl ) -{ -} +Control::Control( const Control& uiControl ) = default; + +Control::Control( Control&& rhs ) = default; Control::~Control() { } -Control& Control::operator=( const Control& handle ) -{ - if( &handle != this ) - { - CustomActor::operator=( handle ); - } - return *this; -} +Control& Control::operator=( const Control& handle ) = default; + +Control& Control::operator=( Control&& rhs ) = default; Control Control::DownCast( BaseHandle handle ) { diff --git a/dali-toolkit/public-api/controls/control.h b/dali-toolkit/public-api/controls/control.h index b8b5621..6ecfd8b 100644 --- a/dali-toolkit/public-api/controls/control.h +++ b/dali-toolkit/public-api/controls/control.h @@ -200,6 +200,14 @@ public: // Creation & Destruction Control(const Control& uiControl); /** + * @brief Move constructor. + * + * @SINCE_1_9.23 + * @param[in] rhs Handle to move + */ + Control( Control&& rhs ); + + /** * @brief Dali::Control is intended as a base class. * * This is non-virtual since derived Handle types must not contain data or virtual methods. @@ -210,7 +218,7 @@ public: // Creation & Destruction public: // operators /** - * @brief Assignment operator. + * @brief Copy assignment operator. * * Changes this handle to point to another real object. * @SINCE_1_0.0 @@ -219,6 +227,15 @@ public: // operators */ Control& operator=( const Control& handle ); + /** + * @brief Move assignment operator. + * + * @SINCE_1_9.23 + * @param[in] rhs Object to assign this to + * @return Reference to this + */ + Control& operator=( Control&& rhs ); + public: /** diff --git a/dali-toolkit/public-api/controls/flex-container/flex-container.cpp b/dali-toolkit/public-api/controls/flex-container/flex-container.cpp index ec95d8c..0c0227d 100644 --- a/dali-toolkit/public-api/controls/flex-container/flex-container.cpp +++ b/dali-toolkit/public-api/controls/flex-container/flex-container.cpp @@ -36,19 +36,13 @@ FlexContainer::FlexContainer() { } -FlexContainer::FlexContainer( const FlexContainer& handle ) -: Control( handle ) -{ -} +FlexContainer::FlexContainer( const FlexContainer& handle ) = default; -FlexContainer& FlexContainer::operator=( const FlexContainer& handle ) -{ - if( &handle != this ) - { - Control::operator=( handle ); - } - return *this; -} +FlexContainer::FlexContainer( FlexContainer&& rhs ) = default; + +FlexContainer& FlexContainer::operator=( const FlexContainer& handle ) = default; + +FlexContainer& FlexContainer::operator=( FlexContainer&& rhs ) = default; FlexContainer::~FlexContainer() { diff --git a/dali-toolkit/public-api/controls/flex-container/flex-container.h b/dali-toolkit/public-api/controls/flex-container/flex-container.h index 78965f8..c89ef8e 100644 --- a/dali-toolkit/public-api/controls/flex-container/flex-container.h +++ b/dali-toolkit/public-api/controls/flex-container/flex-container.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_FLEX_CONTAINER_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -241,6 +241,14 @@ public: FlexContainer( const FlexContainer& handle ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + FlexContainer( FlexContainer&& rhs ); + + /** * @brief Assignment operator. Changes this handle to point to another real object. * @SINCE_1_1.35 * @param[in] handle Handle to an object @@ -249,6 +257,15 @@ public: FlexContainer& operator=( const FlexContainer& handle ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + FlexContainer& operator=( FlexContainer&& rhs ); + + /** * @brief Destructor. * * @details This is non-virtual since derived Handle types must not contain data or virtual methods. diff --git a/dali-toolkit/public-api/controls/image-view/image-view.cpp b/dali-toolkit/public-api/controls/image-view/image-view.cpp index f06b667..980c0a5 100644 --- a/dali-toolkit/public-api/controls/image-view/image-view.cpp +++ b/dali-toolkit/public-api/controls/image-view/image-view.cpp @@ -35,19 +35,13 @@ ImageView::ImageView() { } -ImageView::ImageView( const ImageView& imageView ) -: Control( imageView ) -{ -} +ImageView::ImageView( const ImageView& imageView ) = default; -ImageView& ImageView::operator=( const ImageView& imageView ) -{ - if( &imageView != this ) - { - Control::operator=( imageView ); - } - return *this; -} +ImageView::ImageView( ImageView&& rhs ) = default; + +ImageView& ImageView::operator=( const ImageView& imageView ) = default; + +ImageView& ImageView::operator=( ImageView&& rhs ) = default; ImageView::~ImageView() { diff --git a/dali-toolkit/public-api/controls/image-view/image-view.h b/dali-toolkit/public-api/controls/image-view/image-view.h index 47806df..b2fc518 100644 --- a/dali-toolkit/public-api/controls/image-view/image-view.h +++ b/dali-toolkit/public-api/controls/image-view/image-view.h @@ -194,6 +194,14 @@ public: ImageView( const ImageView& imageView ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + ImageView( ImageView&& rhs ); + + /** * @brief Assignment operator. * * @SINCE_1_0.0 @@ -203,6 +211,15 @@ public: ImageView& operator=( const ImageView& imageView ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + ImageView& operator=( ImageView&& rhs ); + + /** * @brief Downcasts a handle to ImageView handle. * * If handle points to a ImageView, the downcast produces valid handle. diff --git a/dali-toolkit/public-api/controls/model3d-view/model3d-view.cpp b/dali-toolkit/public-api/controls/model3d-view/model3d-view.cpp index e1dc94c..1ebdd2b 100644 --- a/dali-toolkit/public-api/controls/model3d-view/model3d-view.cpp +++ b/dali-toolkit/public-api/controls/model3d-view/model3d-view.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -33,19 +33,13 @@ namespace Toolkit Model3dView::Model3dView() {} -Model3dView::Model3dView( const Model3dView& model3dView ) -: Control( model3dView ) -{ -} +Model3dView::Model3dView( const Model3dView& model3dView ) = default; -Model3dView& Model3dView::operator=( const Model3dView& model3dView ) -{ - if( &model3dView != this ) - { - Control::operator=( model3dView ); - } - return *this; -} +Model3dView::Model3dView( Model3dView&& rhs ) = default; + +Model3dView& Model3dView::operator=( const Model3dView& model3dView ) = default; + +Model3dView& Model3dView::operator=( Model3dView&& rhs ) = default; Model3dView::~Model3dView() { diff --git a/dali-toolkit/public-api/controls/model3d-view/model3d-view.h b/dali-toolkit/public-api/controls/model3d-view/model3d-view.h index dfa6830..358fd9f 100755 --- a/dali-toolkit/public-api/controls/model3d-view/model3d-view.h +++ b/dali-toolkit/public-api/controls/model3d-view/model3d-view.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_MODEL3D_VIEW_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -142,6 +142,14 @@ public: Model3dView( const Model3dView& model3dView ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + Model3dView( Model3dView&& rhs ); + + /** * @brief Assignment operator. * @SINCE_1_1.4 * @param[in] model3dView Handle to an object @@ -150,6 +158,15 @@ public: Model3dView& operator=( const Model3dView& model3dView ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + Model3dView& operator=( Model3dView&& rhs ); + + /** * @brief Downcasts an Object handle to Model3dView. * * If handle points to a Model3dView, the downcast produces valid handle. diff --git a/dali-toolkit/public-api/controls/progress-bar/progress-bar.cpp b/dali-toolkit/public-api/controls/progress-bar/progress-bar.cpp index d34a5a8..849de38 100644 --- a/dali-toolkit/public-api/controls/progress-bar/progress-bar.cpp +++ b/dali-toolkit/public-api/controls/progress-bar/progress-bar.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -31,19 +31,13 @@ ProgressBar::ProgressBar() { } -ProgressBar::ProgressBar( const ProgressBar& handle ) -: Control( handle ) -{ -} +ProgressBar::ProgressBar( const ProgressBar& handle ) = default; -ProgressBar& ProgressBar::operator=( const ProgressBar& handle ) -{ - if( &handle != this ) - { - Control::operator=( handle ); - } - return *this; -} +ProgressBar::ProgressBar( ProgressBar&& rhs ) = default; + +ProgressBar& ProgressBar::operator=( const ProgressBar& handle ) = default; + +ProgressBar& ProgressBar::operator=( ProgressBar&& rhs ) = default; ProgressBar::ProgressBar(Internal::ProgressBar& implementation) : Control(implementation) diff --git a/dali-toolkit/public-api/controls/progress-bar/progress-bar.h b/dali-toolkit/public-api/controls/progress-bar/progress-bar.h index 407e026..7497fbd 100644 --- a/dali-toolkit/public-api/controls/progress-bar/progress-bar.h +++ b/dali-toolkit/public-api/controls/progress-bar/progress-bar.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_PROGRESS_BAR_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -180,6 +180,14 @@ public: ProgressBar( const ProgressBar& handle ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + ProgressBar( ProgressBar&& rhs ); + + /** * @brief Assignment operator. * * Changes this handle to point to another real object. @@ -190,6 +198,15 @@ public: ProgressBar& operator=( const ProgressBar& handle ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + ProgressBar& operator=( ProgressBar&& rhs ); + + /** * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/item-view.cpp b/dali-toolkit/public-api/controls/scrollable/item-view/item-view.cpp index 12a6baf..7435b13 100644 --- a/dali-toolkit/public-api/controls/scrollable/item-view/item-view.cpp +++ b/dali-toolkit/public-api/controls/scrollable/item-view/item-view.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -40,19 +40,13 @@ ItemView::ItemView( Dali::Internal::CustomActor* internal ) VerifyCustomActorPointer(internal); } -ItemView::ItemView( const ItemView& itemView ) -: Scrollable(itemView) -{ -} +ItemView::ItemView( const ItemView& itemView ) = default; -ItemView& ItemView::operator=( const ItemView& itemView ) -{ - if( &itemView != this ) - { - Control::operator=( itemView ); - } - return *this; -} +ItemView::ItemView( ItemView&& rhs ) = default; + +ItemView& ItemView::operator=( const ItemView& itemView ) = default; + +ItemView& ItemView::operator=( ItemView&& rhs ) = default; ItemView ItemView::New(ItemFactory& factory) { diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/item-view.h b/dali-toolkit/public-api/controls/scrollable/item-view/item-view.h index 692d129..5bc7eea 100755 --- a/dali-toolkit/public-api/controls/scrollable/item-view/item-view.h +++ b/dali-toolkit/public-api/controls/scrollable/item-view/item-view.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_ITEM_VIEW_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -215,6 +215,14 @@ public: ItemView( const ItemView& itemView ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + ItemView( ItemView&& rhs ); + + /** * @brief Assignment operator. * @SINCE_1_0.0 * @param[in] itemView Handle to an object @@ -223,6 +231,15 @@ public: ItemView& operator=( const ItemView& itemView ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + ItemView& operator=( ItemView&& rhs ); + + /** * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp index 471f371..effc31a 100644 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp +++ b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -298,19 +298,13 @@ ScrollView::ScrollView( Dali::Internal::CustomActor* internal ) VerifyCustomActorPointer(internal); } -ScrollView::ScrollView( const ScrollView& handle ) -: Scrollable( handle ) -{ -} +ScrollView::ScrollView( const ScrollView& handle ) = default; -ScrollView& ScrollView::operator=( const ScrollView& handle ) -{ - if( &handle != this ) - { - Control::operator=( handle ); - } - return *this; -} +ScrollView::ScrollView( ScrollView&& rhs ) = default; + +ScrollView& ScrollView::operator=( const ScrollView& handle ) = default; + +ScrollView& ScrollView::operator=( ScrollView&& rhs ) = default; ScrollView ScrollView::New() { diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h index 4acf64c..14b9909 100755 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h +++ b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_SCROLL_VIEW_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -737,6 +737,14 @@ public: ScrollView( const ScrollView& handle ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + ScrollView( ScrollView&& rhs ); + + /** * @brief Assignment operator. * * Changes this handle to point to another real object. @@ -747,6 +755,15 @@ public: ScrollView& operator=( const ScrollView& handle ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + ScrollView& operator=( ScrollView&& rhs ); + + /** * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. diff --git a/dali-toolkit/public-api/controls/scrollable/scrollable.cpp b/dali-toolkit/public-api/controls/scrollable/scrollable.cpp index 9e1c66f..3802239 100644 --- a/dali-toolkit/public-api/controls/scrollable/scrollable.cpp +++ b/dali-toolkit/public-api/controls/scrollable/scrollable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -41,19 +41,13 @@ Scrollable::Scrollable( Dali::Internal::CustomActor* internal ) VerifyCustomActorPointer(internal); } -Scrollable::Scrollable( const Scrollable& handle ) -: Control( handle ) -{ -} +Scrollable::Scrollable( const Scrollable& handle ) = default; -Scrollable& Scrollable::operator=( const Scrollable& handle ) -{ - if( &handle != this ) - { - Control::operator=( handle ); - } - return *this; -} +Scrollable::Scrollable( Scrollable&& rhs ) = default; + +Scrollable& Scrollable::operator=( const Scrollable& handle ) = default; + +Scrollable& Scrollable::operator=( Scrollable&& rhs ) = default; Scrollable::~Scrollable() { diff --git a/dali-toolkit/public-api/controls/scrollable/scrollable.h b/dali-toolkit/public-api/controls/scrollable/scrollable.h index 38050ae..c3f235c 100644 --- a/dali-toolkit/public-api/controls/scrollable/scrollable.h +++ b/dali-toolkit/public-api/controls/scrollable/scrollable.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_SCROLLABLE_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -124,6 +124,14 @@ public: Scrollable( const Scrollable& handle ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + Scrollable( Scrollable&& rhs ); + + /** * @brief Assignment operator. * * Changes this handle to point to another real object. @@ -134,6 +142,15 @@ public: Scrollable& operator=( const Scrollable& handle ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + Scrollable& operator=( Scrollable&& rhs ); + + /** * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. diff --git a/dali-toolkit/public-api/controls/slider/slider.cpp b/dali-toolkit/public-api/controls/slider/slider.cpp index 8aa47d0..ed7cda9 100644 --- a/dali-toolkit/public-api/controls/slider/slider.cpp +++ b/dali-toolkit/public-api/controls/slider/slider.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -33,19 +33,13 @@ Slider::Slider() { } -Slider::Slider( const Slider& handle ) -: Control( handle ) -{ -} +Slider::Slider( const Slider& handle ) = default; -Slider& Slider::operator=( const Slider& handle ) -{ - if( &handle != this ) - { - Control::operator=( handle ); - } - return *this; -} +Slider::Slider( Slider&& rhs ) = default; + +Slider& Slider::operator=( const Slider& handle ) = default; + +Slider& Slider::operator=( Slider&& rhs ) = default; Slider::Slider(Internal::Slider& implementation) : Control(implementation) diff --git a/dali-toolkit/public-api/controls/slider/slider.h b/dali-toolkit/public-api/controls/slider/slider.h index 603e110..1788734 100644 --- a/dali-toolkit/public-api/controls/slider/slider.h +++ b/dali-toolkit/public-api/controls/slider/slider.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_SLIDER_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -193,6 +193,14 @@ public: Slider( const Slider& handle ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + Slider( Slider&& rhs ); + + /** * @brief Assignment operator. * * Changes this handle to point to another real object. @@ -203,6 +211,15 @@ public: Slider& operator=( const Slider& handle ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + Slider& operator=( Slider&& rhs ); + + /** * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. diff --git a/dali-toolkit/public-api/controls/text-controls/text-editor.cpp b/dali-toolkit/public-api/controls/text-controls/text-editor.cpp index f02d843..f3c26f9 100644 --- a/dali-toolkit/public-api/controls/text-controls/text-editor.cpp +++ b/dali-toolkit/public-api/controls/text-controls/text-editor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -36,19 +36,13 @@ TextEditor::TextEditor() { } -TextEditor::TextEditor( const TextEditor& handle ) -: Control( handle ) -{ -} +TextEditor::TextEditor( const TextEditor& handle ) = default; -TextEditor& TextEditor::operator=( const TextEditor& handle ) -{ - if( &handle != this ) - { - Control::operator=( handle ); - } - return *this; -} +TextEditor::TextEditor( TextEditor&& rhs ) = default; + +TextEditor& TextEditor::operator=( const TextEditor& handle ) = default; + +TextEditor& TextEditor::operator=( TextEditor&& rhs ) = default; TextEditor::~TextEditor() { diff --git a/dali-toolkit/public-api/controls/text-controls/text-editor.h b/dali-toolkit/public-api/controls/text-controls/text-editor.h index acebb97..18bb112 100644 --- a/dali-toolkit/public-api/controls/text-controls/text-editor.h +++ b/dali-toolkit/public-api/controls/text-controls/text-editor.h @@ -532,14 +532,30 @@ public: TextEditor( const TextEditor &handle ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + TextEditor( TextEditor&& rhs ); + + /** * @brief Assignment operator. * * @SINCE_1_1.37 * @param[in] handle The handle to copy from * @return A reference to this */ - TextEditor& - operator=( const TextEditor &handle ); + TextEditor& operator=( const TextEditor &handle ); + + /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + TextEditor& operator=( TextEditor&& rhs ); /** * @brief Destructor. diff --git a/dali-toolkit/public-api/controls/text-controls/text-field.cpp b/dali-toolkit/public-api/controls/text-controls/text-field.cpp index fc58261..1ebedb6 100644 --- a/dali-toolkit/public-api/controls/text-controls/text-field.cpp +++ b/dali-toolkit/public-api/controls/text-controls/text-field.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -36,19 +36,13 @@ TextField::TextField() { } -TextField::TextField( const TextField& handle ) -: Control( handle ) -{ -} +TextField::TextField( const TextField& handle ) = default; -TextField& TextField::operator=( const TextField& handle ) -{ - if( &handle != this ) - { - Control::operator=( handle ); - } - return *this; -} +TextField::TextField( TextField&& rhs ) = default; + +TextField& TextField::operator=( const TextField& handle ) = default; + +TextField& TextField::operator=( TextField&& rhs ) = default; TextField::~TextField() { diff --git a/dali-toolkit/public-api/controls/text-controls/text-field.h b/dali-toolkit/public-api/controls/text-controls/text-field.h index c5d257d..b705039 100644 --- a/dali-toolkit/public-api/controls/text-controls/text-field.h +++ b/dali-toolkit/public-api/controls/text-controls/text-field.h @@ -539,6 +539,14 @@ public: TextField( const TextField& handle ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + TextField( TextField&& rhs ); + + /** * @brief Assignment operator. * * @SINCE_1_0.0 @@ -548,6 +556,15 @@ public: TextField& operator=( const TextField& handle ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + TextField& operator=( TextField&& rhs ); + + /** * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. diff --git a/dali-toolkit/public-api/controls/text-controls/text-label.cpp b/dali-toolkit/public-api/controls/text-controls/text-label.cpp index 7a61615..39450c7 100644 --- a/dali-toolkit/public-api/controls/text-controls/text-label.cpp +++ b/dali-toolkit/public-api/controls/text-controls/text-label.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -44,19 +44,13 @@ TextLabel::TextLabel() { } -TextLabel::TextLabel( const TextLabel& handle ) -: Control( handle ) -{ -} +TextLabel::TextLabel( const TextLabel& handle ) = default; -TextLabel& TextLabel::operator=( const TextLabel& handle ) -{ - if( &handle != this ) - { - Control::operator=( handle ); - } - return *this; -} +TextLabel::TextLabel( TextLabel&& rhs ) = default; + +TextLabel& TextLabel::operator=( const TextLabel& handle ) = default; + +TextLabel& TextLabel::operator=( TextLabel&& rhs ) = default; TextLabel::~TextLabel() { diff --git a/dali-toolkit/public-api/controls/text-controls/text-label.h b/dali-toolkit/public-api/controls/text-controls/text-label.h index f61d675..4fe6447 100644 --- a/dali-toolkit/public-api/controls/text-controls/text-label.h +++ b/dali-toolkit/public-api/controls/text-controls/text-label.h @@ -399,6 +399,14 @@ public: TextLabel( const TextLabel& handle ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + TextLabel( TextLabel&& rhs ); + + /** * @brief Assignment operator. * * @SINCE_1_0.0 @@ -408,6 +416,15 @@ public: TextLabel& operator=( const TextLabel& handle ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + TextLabel& operator=( TextLabel&& rhs ); + + /** * @brief Destructor. * * This is non-virtual since derived Handle types must not contain data or virtual methods. diff --git a/dali-toolkit/public-api/controls/video-view/video-view.cpp b/dali-toolkit/public-api/controls/video-view/video-view.cpp index ef478ff..5f827a5 100644 --- a/dali-toolkit/public-api/controls/video-view/video-view.cpp +++ b/dali-toolkit/public-api/controls/video-view/video-view.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -35,20 +35,13 @@ VideoView::VideoView() { } -VideoView::VideoView( const VideoView& videoView ) -: Control( videoView ) -{ -} +VideoView::VideoView( const VideoView& videoView ) = default; -VideoView& VideoView::operator=( const VideoView& videoView ) -{ - if( &videoView != this ) - { - Control::operator=( videoView ); - } +VideoView::VideoView( VideoView&& rhs ) = default; - return *this; -} +VideoView& VideoView::operator=( const VideoView& videoView ) = default; + +VideoView& VideoView::operator=( VideoView&& rhs ) = default; VideoView::~VideoView() { diff --git a/dali-toolkit/public-api/controls/video-view/video-view.h b/dali-toolkit/public-api/controls/video-view/video-view.h index 88728ee..e97bb27 100755 --- a/dali-toolkit/public-api/controls/video-view/video-view.h +++ b/dali-toolkit/public-api/controls/video-view/video-view.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_VIDEO_VIEW_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -255,6 +255,14 @@ public: VideoView( const VideoView& videoView ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + VideoView( VideoView&& rhs ); + + /** * @brief Assignment operator. * * @SINCE_1_1.38 @@ -264,6 +272,15 @@ public: VideoView& operator=( const VideoView& videoView ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + * @return A reference to this + */ + VideoView& operator=( VideoView&& rhs ); + + /** * @brief Downcasts a handle to VideoView handle. * * If handle points to a VideoView, the downcast produces valid handle. diff --git a/dali-toolkit/public-api/image-loader/async-image-loader.cpp b/dali-toolkit/public-api/image-loader/async-image-loader.cpp index a1d21e7..cd84dd6 100644 --- a/dali-toolkit/public-api/image-loader/async-image-loader.cpp +++ b/dali-toolkit/public-api/image-loader/async-image-loader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -40,16 +40,13 @@ AsyncImageLoader::AsyncImageLoader( Internal::AsyncImageLoader* impl ) { } -AsyncImageLoader::AsyncImageLoader( const AsyncImageLoader& handle ) -: BaseHandle( handle ) -{ -} +AsyncImageLoader::AsyncImageLoader( const AsyncImageLoader& handle ) = default; -AsyncImageLoader& AsyncImageLoader::operator=( const AsyncImageLoader& handle ) -{ - BaseHandle::operator=( handle ); - return *this; -} +AsyncImageLoader::AsyncImageLoader( AsyncImageLoader&& rhs ) = default; + +AsyncImageLoader& AsyncImageLoader::operator=( const AsyncImageLoader& handle ) = default; + +AsyncImageLoader& AsyncImageLoader::operator=( AsyncImageLoader&& rhs ) = default; AsyncImageLoader AsyncImageLoader::DownCast( BaseHandle handle ) { diff --git a/dali-toolkit/public-api/image-loader/async-image-loader.h b/dali-toolkit/public-api/image-loader/async-image-loader.h index 3a30253..e163b07 100755 --- a/dali-toolkit/public-api/image-loader/async-image-loader.h +++ b/dali-toolkit/public-api/image-loader/async-image-loader.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_ASYNC_IMAGE_LOADER_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -128,6 +128,14 @@ public: AsyncImageLoader( const AsyncImageLoader& handle ); /** + * @brief Move constructor + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + AsyncImageLoader( AsyncImageLoader&& rhs ); + + /** * @brief This assignment operator is required for (smart) pointer semantics. * @SINCE_1_2_14 * @@ -137,6 +145,14 @@ public: AsyncImageLoader& operator=( const AsyncImageLoader& handle ); /** + * @brief Move assignment + * @SINCE_1_9.23 + * + * @param[in] rhs A reference to the moved handle + */ + AsyncImageLoader& operator=( AsyncImageLoader&& rhs ); + + /** * @brief Creates a new loader to load the image asynchronously in a worker thread. * @SINCE_1_2_14 *