Change copy constructor and copy assignment in common classes to use the default... 28/239928/1
authorRichard Huang <r.huang@samsung.com>
Thu, 30 Jul 2020 13:30:24 +0000 (14:30 +0100)
committerRichard Huang <r.huang@samsung.com>
Thu, 30 Jul 2020 13:30:24 +0000 (14:30 +0100)
Change-Id: I4bba8268b159fbf032bedc8120286e481d9820ca

26 files changed:
dali/public-api/actors/actor.cpp
dali/public-api/actors/custom-actor.cpp
dali/public-api/actors/layer.cpp
dali/public-api/animation/animation.cpp
dali/public-api/animation/constraint.cpp
dali/public-api/animation/key-frames.cpp
dali/public-api/animation/linear-constrainer.cpp
dali/public-api/animation/path.cpp
dali/public-api/images/pixel-data.cpp
dali/public-api/object/base-handle.cpp
dali/public-api/object/handle.cpp
dali/public-api/object/object-registry.cpp
dali/public-api/object/property-conditions.cpp
dali/public-api/object/property-notification.cpp
dali/public-api/object/type-info.cpp
dali/public-api/object/type-registry.cpp
dali/public-api/render-tasks/render-task-list.cpp
dali/public-api/render-tasks/render-task.cpp
dali/public-api/rendering/frame-buffer.cpp
dali/public-api/rendering/geometry.cpp
dali/public-api/rendering/property-buffer.cpp
dali/public-api/rendering/renderer.cpp
dali/public-api/rendering/sampler.cpp
dali/public-api/rendering/shader.cpp
dali/public-api/rendering/texture-set.cpp
dali/public-api/rendering/texture.cpp

index 6df6576..2b0f44f 100644 (file)
@@ -54,16 +54,9 @@ Actor::~Actor()
 {
 }
 
-Actor::Actor(const Actor& copy)
-: Handle(copy)
-{
-}
+Actor::Actor(const Actor& copy) = default;
 
-Actor& Actor::operator=(const Actor& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+Actor& Actor::operator=(const Actor& rhs) = default;
 
 Actor::Actor( Actor&& rhs ) = default;
 
index 3d26536..c4cc18f 100644 (file)
@@ -53,16 +53,9 @@ CustomActor::~CustomActor()
 {
 }
 
-CustomActor::CustomActor(const CustomActor& copy)
-: Actor(copy)
-{
-}
+CustomActor::CustomActor(const CustomActor& copy) = default;
 
-CustomActor& CustomActor::operator=(const CustomActor& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+CustomActor& CustomActor::operator=(const CustomActor& rhs) = default;
 
 CustomActor::CustomActor( CustomActor&& rhs ) = default;
 
index 38e965d..4946570 100644 (file)
@@ -46,16 +46,9 @@ Layer::~Layer()
 {
 }
 
-Layer::Layer(const Layer& copy)
-: Actor(copy)
-{
-}
+Layer::Layer(const Layer& copy) = default;
 
-Layer& Layer::operator=(const Layer& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+Layer& Layer::operator=(const Layer& rhs) = default;
 
 Layer::Layer( Layer&& rhs ) = default;
 
index ee344e7..aea5404 100644 (file)
@@ -53,16 +53,9 @@ Animation::~Animation()
 {
 }
 
-Animation::Animation(const Animation& handle)
-: BaseHandle(handle)
-{
-}
+Animation::Animation(const Animation& handle) = default;
 
-Animation& Animation::operator=(const Animation& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+Animation& Animation::operator=(const Animation& rhs) = default;
 
 Animation::Animation( Animation&& rhs ) = default;
 
index fb5ebaa..1302ab7 100644 (file)
@@ -53,16 +53,9 @@ Constraint::~Constraint()
 {
 }
 
-Constraint::Constraint( const Constraint& constraint )
-: BaseHandle( constraint )
-{
-}
+Constraint::Constraint( const Constraint& constraint ) = default;
 
-Constraint& Constraint::operator=( const Constraint& rhs )
-{
-  BaseHandle::operator=( rhs );
-  return *this;
-}
+Constraint& Constraint::operator=( const Constraint& rhs ) = default;
 
 Constraint::Constraint( Constraint&& rhs ) = default;
 
index 27d1ee0..a4ef9bb 100644 (file)
@@ -46,16 +46,9 @@ KeyFrames::~KeyFrames()
 {
 }
 
-KeyFrames::KeyFrames(const KeyFrames& handle)
-: BaseHandle(handle)
-{
-}
+KeyFrames::KeyFrames(const KeyFrames& handle) = default;
 
-KeyFrames& KeyFrames::operator=(const KeyFrames& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+KeyFrames& KeyFrames::operator=(const KeyFrames& rhs) = default;
 
 KeyFrames::KeyFrames( KeyFrames&& rhs ) = default;
 
index c62a442..3c46654 100644 (file)
@@ -44,21 +44,14 @@ LinearConstrainer::~LinearConstrainer()
 {
 }
 
-LinearConstrainer::LinearConstrainer(const LinearConstrainer& handle)
-:Handle(handle)
-{
-}
+LinearConstrainer::LinearConstrainer(const LinearConstrainer& handle) = default;
 
 LinearConstrainer::LinearConstrainer(Internal::LinearConstrainer* internal)
 : Handle(internal)
 {
 }
 
-LinearConstrainer& LinearConstrainer::operator=(const LinearConstrainer& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+LinearConstrainer& LinearConstrainer::operator=(const LinearConstrainer& rhs) = default;
 
 LinearConstrainer::LinearConstrainer( LinearConstrainer&& rhs ) = default;
 
index 83159f5..4b868bd 100644 (file)
@@ -43,21 +43,14 @@ Path::~Path()
 {
 }
 
-Path::Path(const Path& handle)
-:Handle(handle)
-{
-}
+Path::Path(const Path& handle) = default;
 
 Path::Path(Internal::Path* internal)
 : Handle(internal)
 {
 }
 
-Path& Path::operator=(const Path& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+Path& Path::operator=(const Path& rhs) = default;
 
 Path::Path( Path&& rhs ) = default;
 
index 998dfb4..2118260 100644 (file)
@@ -48,16 +48,9 @@ PixelData::PixelData( Internal::PixelData* internal )
 {
 }
 
-PixelData::PixelData(const PixelData& handle)
-: BaseHandle( handle )
-{
-}
+PixelData::PixelData(const PixelData& handle) = default;
 
-PixelData& PixelData::operator=(const PixelData& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+PixelData& PixelData::operator=(const PixelData& rhs) = default;
 
 PixelData::PixelData( PixelData&& rhs ) = default;
 
index 8b16a04..775e599 100644 (file)
@@ -42,20 +42,9 @@ BaseHandle::~BaseHandle()
 {
 }
 
-BaseHandle::BaseHandle(const BaseHandle& handle)
-  : mObjectHandle(handle.mObjectHandle)
-{
-}
+BaseHandle::BaseHandle(const BaseHandle& handle) = default;
 
-BaseHandle& BaseHandle::operator=(const BaseHandle& rhs)
-{
-  if( this != &rhs )
-  {
-    this->mObjectHandle = rhs.mObjectHandle;
-  }
-
-  return *this;
-}
+BaseHandle& BaseHandle::operator=(const BaseHandle& rhs) = default;
 
 BaseHandle::BaseHandle( BaseHandle&& rhs ) = default;
 
index 0844835..a22fc74 100644 (file)
@@ -48,20 +48,9 @@ Handle::~Handle()
 {
 }
 
-Handle::Handle( const Handle& handle )
-: BaseHandle( handle )
-{
-}
+Handle::Handle( const Handle& handle ) = default;
 
-Handle& Handle::operator=( const Handle& rhs )
-{
-  if( this != &rhs )
-  {
-    BaseHandle::operator=(rhs);
-  }
-
-  return *this;
-}
+Handle& Handle::operator=( const Handle& rhs ) = default;
 
 Handle::Handle( Handle&& rhs ) = default;
 
index 9c5af86..f33f9fd 100644 (file)
@@ -32,16 +32,9 @@ ObjectRegistry::~ObjectRegistry()
 {
 }
 
-ObjectRegistry::ObjectRegistry(const ObjectRegistry& copy)
-: BaseHandle(copy)
-{
-}
+ObjectRegistry::ObjectRegistry(const ObjectRegistry& copy) = default;
 
-ObjectRegistry& ObjectRegistry::operator=(const ObjectRegistry& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+ObjectRegistry& ObjectRegistry::operator=(const ObjectRegistry& rhs) = default;
 
 ObjectRegistry::ObjectRegistry( ObjectRegistry&& rhs ) = default;
 
index 7637a6c..e30c74d 100644 (file)
@@ -36,16 +36,9 @@ PropertyCondition::~PropertyCondition()
 
 }
 
-PropertyCondition::PropertyCondition( const PropertyCondition& handle )
-: BaseHandle(handle)
-{
-}
+PropertyCondition::PropertyCondition( const PropertyCondition& handle ) = default;
 
-PropertyCondition& PropertyCondition::operator=( const PropertyCondition& rhs )
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+PropertyCondition& PropertyCondition::operator=( const PropertyCondition& rhs ) = default;
 
 PropertyCondition::PropertyCondition( PropertyCondition&& rhs ) = default;
 
index ff5f275..7e2c27d 100644 (file)
@@ -48,16 +48,9 @@ PropertyNotification::~PropertyNotification()
 {
 }
 
-PropertyNotification::PropertyNotification(const PropertyNotification& copy)
-: BaseHandle(copy)
-{
-}
+PropertyNotification::PropertyNotification(const PropertyNotification& copy) = default;
 
-PropertyNotification& PropertyNotification::operator=(const PropertyNotification& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+PropertyNotification& PropertyNotification::operator=(const PropertyNotification& rhs) = default;
 
 PropertyNotification::PropertyNotification( PropertyNotification&& rhs ) = default;
 
index 8eceb10..16d06a2 100644 (file)
@@ -34,16 +34,9 @@ TypeInfo::~TypeInfo()
 {
 }
 
-TypeInfo::TypeInfo(const TypeInfo& copy)
-: BaseHandle(copy)
-{
-}
+TypeInfo::TypeInfo(const TypeInfo& copy) = default;
 
-TypeInfo& TypeInfo::operator=(const TypeInfo& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+TypeInfo& TypeInfo::operator=(const TypeInfo& rhs) = default;
 
 TypeInfo::TypeInfo( TypeInfo&& rhs ) = default;
 
index d72c680..a3f4a64 100644 (file)
@@ -36,16 +36,9 @@ TypeRegistry::~TypeRegistry()
 {
 }
 
-TypeRegistry::TypeRegistry(const TypeRegistry& copy)
-: BaseHandle(copy)
-{
-}
+TypeRegistry::TypeRegistry(const TypeRegistry& copy) = default;
 
-TypeRegistry& TypeRegistry::operator=(const TypeRegistry& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+TypeRegistry& TypeRegistry::operator=(const TypeRegistry& rhs) = default;
 
 TypeRegistry::TypeRegistry( TypeRegistry&& rhs ) = default;
 
index e52e2f4..fa12c98 100644 (file)
@@ -37,16 +37,9 @@ RenderTaskList::~RenderTaskList()
 {
 }
 
-RenderTaskList::RenderTaskList(const RenderTaskList& handle)
-: BaseHandle(handle)
-{
-}
+RenderTaskList::RenderTaskList(const RenderTaskList& handle) = default;
 
-RenderTaskList& RenderTaskList::operator=(const RenderTaskList& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+RenderTaskList& RenderTaskList::operator=(const RenderTaskList& rhs) = default;
 
 RenderTaskList::RenderTaskList( RenderTaskList&& rhs ) =  default;
 
index 520738f..7e76dda 100644 (file)
@@ -62,16 +62,9 @@ RenderTask::~RenderTask()
 {
 }
 
-RenderTask::RenderTask(const RenderTask& handle)
-: Handle(handle)
-{
-}
+RenderTask::RenderTask(const RenderTask& handle) = default;
 
-RenderTask& RenderTask::operator=(const RenderTask& rhs)
-{
-  BaseHandle::operator=(rhs);
-  return *this;
-}
+RenderTask& RenderTask::operator=(const RenderTask& rhs) = default;
 
 RenderTask::RenderTask( RenderTask&& rhs ) =  default;
 
index 0badfa9..31ef8db 100644 (file)
@@ -65,21 +65,14 @@ FrameBuffer::~FrameBuffer()
 {
 }
 
-FrameBuffer::FrameBuffer( const FrameBuffer& handle )
-: BaseHandle( handle )
-{
-}
+FrameBuffer::FrameBuffer( const FrameBuffer& handle ) = default;
 
 FrameBuffer FrameBuffer::DownCast( BaseHandle handle )
 {
   return FrameBuffer( dynamic_cast<Dali::Internal::FrameBuffer*>(handle.GetObjectPtr()));
 }
 
-FrameBuffer& FrameBuffer::operator=( const FrameBuffer& handle )
-{
-  BaseHandle::operator=( handle );
-  return *this;
-}
+FrameBuffer& FrameBuffer::operator=( const FrameBuffer& handle ) = default;
 
 FrameBuffer::FrameBuffer( Internal::FrameBuffer* pointer )
 : BaseHandle( pointer )
index 2b69e87..b1d0766 100644 (file)
@@ -38,21 +38,14 @@ Geometry::~Geometry()
 {
 }
 
-Geometry::Geometry( const Geometry& handle )
-: BaseHandle( handle )
-{
-}
+Geometry::Geometry( const Geometry& handle ) = default;
 
 Geometry Geometry::DownCast( BaseHandle handle )
 {
   return Geometry( dynamic_cast<Dali::Internal::Geometry*>(handle.GetObjectPtr()));
 }
 
-Geometry& Geometry::operator=( const Geometry& handle )
-{
-  BaseHandle::operator=( handle );
-  return *this;
-}
+Geometry& Geometry::operator=( const Geometry& handle ) = default;
 
 Geometry::Geometry( Geometry&& rhs ) =  default;
 
index 91fdd46..839f202 100644 (file)
@@ -40,21 +40,14 @@ PropertyBuffer::~PropertyBuffer()
 {
 }
 
-PropertyBuffer::PropertyBuffer( const PropertyBuffer& handle )
-: BaseHandle( handle )
-{
-}
+PropertyBuffer::PropertyBuffer( const PropertyBuffer& handle ) = default;
 
 PropertyBuffer PropertyBuffer::DownCast( BaseHandle handle )
 {
   return PropertyBuffer( dynamic_cast<Dali::Internal::PropertyBuffer*>(handle.GetObjectPtr()));
 }
 
-PropertyBuffer& PropertyBuffer::operator=( const PropertyBuffer& handle )
-{
-  BaseHandle::operator=( handle );
-  return *this;
-}
+PropertyBuffer& PropertyBuffer::operator=( const PropertyBuffer& handle ) = default;
 
 PropertyBuffer::PropertyBuffer( PropertyBuffer&& rhs ) =  default;
 
index 14f42ea..0d89476 100644 (file)
@@ -40,21 +40,14 @@ Renderer::~Renderer()
 {
 }
 
-Renderer::Renderer( const Renderer& handle )
-: Handle( handle )
-{
-}
+Renderer::Renderer( const Renderer& handle ) = default;
 
 Renderer Renderer::DownCast( BaseHandle handle )
 {
   return Renderer( dynamic_cast<Dali::Internal::Renderer*>(handle.GetObjectPtr()));
 }
 
-Renderer& Renderer::operator=( const Renderer& handle )
-{
-  BaseHandle::operator=( handle );
-  return *this;
-}
+Renderer& Renderer::operator=( const Renderer& handle ) = default;
 
 Renderer::Renderer( Renderer&& rhs ) =  default;
 
index ac57115..1b3722a 100644 (file)
@@ -38,21 +38,14 @@ Sampler::~Sampler()
 {
 }
 
-Sampler::Sampler( const Sampler& handle )
-: BaseHandle( handle )
-{
-}
+Sampler::Sampler( const Sampler& handle ) = default;
 
 Sampler Sampler::DownCast( BaseHandle handle )
 {
   return Sampler( dynamic_cast<Dali::Internal::Sampler*>(handle.GetObjectPtr()));
 }
 
-Sampler& Sampler::operator=( const Sampler& handle )
-{
-  BaseHandle::operator=( handle );
-  return *this;
-}
+Sampler& Sampler::operator=( const Sampler& handle ) = default;
 
 Sampler::Sampler( Sampler&& rhs ) =  default;
 
index 7b9cfa5..a6d3ed4 100644 (file)
@@ -40,21 +40,14 @@ Shader::~Shader()
 {
 }
 
-Shader::Shader( const Shader& handle )
-: Handle( handle )
-{
-}
+Shader::Shader( const Shader& handle ) = default;
 
 Shader Shader::DownCast( BaseHandle handle )
 {
   return Shader( dynamic_cast<Dali::Internal::Shader*>(handle.GetObjectPtr()));
 }
 
-Shader& Shader::operator=( const Shader& handle )
-{
-  BaseHandle::operator=( handle );
-  return *this;
-}
+Shader& Shader::operator=( const Shader& handle ) = default;
 
 Shader::Shader( Shader&& rhs ) =  default;
 
index fdcb141..ae3440d 100644 (file)
@@ -40,21 +40,14 @@ TextureSet::~TextureSet()
 {
 }
 
-TextureSet::TextureSet( const TextureSet& handle )
-: BaseHandle( handle )
-{
-}
+TextureSet::TextureSet( const TextureSet& handle ) = default;
 
 TextureSet TextureSet::DownCast( BaseHandle handle )
 {
   return TextureSet( dynamic_cast<Dali::Internal::TextureSet*>(handle.GetObjectPtr()));
 }
 
-TextureSet& TextureSet::operator=( const TextureSet& handle )
-{
-  BaseHandle::operator=( handle );
-  return *this;
-}
+TextureSet& TextureSet::operator=( const TextureSet& handle ) = default;
 
 TextureSet::TextureSet( TextureSet&& rhs ) =  default;
 
index 0a8b80d..ea8e911 100644 (file)
@@ -46,21 +46,14 @@ Texture::~Texture()
 {
 }
 
-Texture::Texture( const Texture& handle )
-: BaseHandle( handle )
-{
-}
+Texture::Texture( const Texture& handle ) = default;
 
 Texture Texture::DownCast( BaseHandle handle )
 {
   return Texture( dynamic_cast<Dali::Internal::Texture*>(handle.GetObjectPtr()));
 }
 
-Texture& Texture::operator=( const Texture& handle )
-{
-  BaseHandle::operator=( handle );
-  return *this;
-}
+Texture& Texture::operator=( const Texture& handle ) = default;
 
 Texture::Texture( Texture&& rhs ) =  default;